Closed Bug 1679272 Opened 10 months ago Closed 10 months ago

Broken build in docshell/base/nsDocShell.cpp after recent change

Categories

(Core :: DOM: Core & HTML, defect)

Other
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1679273

People

(Reporter: dan, Assigned: dan)

References

Details

Attachments

(3 files, 1 obsolete file)

I am getting a build failure on ppc64le and s390x platforms after a change that went in the last ~24 hours. Seems the problem is a missing included header which is indirectly included on other platforms. Bisecting to the exact commit is difficult as we are hitting multiple issues at the same time (all went in in the last day)

docshell/base/Unified_cpp_docshell_base0.o
/usr/bin/g++ -std=gnu++17 -o Unified_cpp_docshell_base0.o -c  -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/stl_wrappers -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/system_wrappers -include /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_LINUX=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/docshell/base -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/ipc/ipdl/_ipdlheaders -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/ipc/chromium/src -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/ipc/glue -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/shistory -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/dom/base -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/dom/bindings -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/js/xpconnect/src -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/layout/base -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/layout/generic -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/layout/style -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/layout/xul -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/netwerk/base -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/netwerk/protocol/viewsource -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/toolkit/components/browser -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/toolkit/components/find -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/tools/profiler -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/nspr -I/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/mozilla-config.h -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O2 -fno-omit-frame-pointer -funwind-tables -Wno-error=shadow  -MD -MP -MF .deps/Unified_cpp_docshell_base0.o.pp   Unified_cpp_docshell_base0.cpp
In file included from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/nsXPTCUtils.h:10,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/js/xpconnect/src/xpcprivate.h:119,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/BrowsingContext.cpp:63,
                 from Unified_cpp_docshell_base0.cpp:11:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/xptcall.h: In constructor ‘nsXPTCVariant::nsXPTCVariant()’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/xptcall.h:79:42: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct nsXPTCVariant’ with no trivial copy-assignment; use value-initialization instead [-Wclass-memaccess]
   79 |     memset(this, 0, sizeof(nsXPTCVariant));
      |                                          ^
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/xptcall.h:44:8: note: ‘struct nsXPTCVariant’ declared here
   44 | struct nsXPTCVariant {
      |        ^~~~~~~~~~~~~
In file included from Unified_cpp_docshell_base0.cpp:101:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp: In member function ‘nsresult nsDocShell::LoadURI(nsDocShellLoadState*, bool, bool)’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp:759:7: error: ‘MakeScopeExit’ was not declared in this scope
  759 |       MakeScopeExit([&]() { mIsNavigating = oldIsNavigating; });
      |       ^~~~~~~~~~~~~
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp: In member function ‘virtual nsresult nsDocShell::GoBack(bool)’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp:3291:30: error: ‘MakeScopeExit’ was not declared in this scope
 3291 |   auto cleanupIsNavigating = MakeScopeExit([&]() { mIsNavigating = false; });
      |                              ^~~~~~~~~~~~~
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp: In member function ‘virtual nsresult nsDocShell::GoForward(bool)’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp:3307:30: error: ‘MakeScopeExit’ was not declared in this scope
 3307 |   auto cleanupIsNavigating = MakeScopeExit([&]() { mIsNavigating = false; });
      |                              ^~~~~~~~~~~~~
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp: In member function ‘virtual nsresult nsDocShell::GotoIndex(int32_t)’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp:3325:30: error: ‘MakeScopeExit’ was not declared in this scope
 3325 |   auto cleanupIsNavigating = MakeScopeExit([&]() { mIsNavigating = false; });
      |                              ^~~~~~~~~~~~~
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp: In member function ‘nsresult nsDocShell::OpenInitializedChannel(nsIChannel*, nsIURILoader*, uint32_t)’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp:10360:7: error: ‘MakeScopeExit’ was not declared in this scope
10360 |       MakeScopeExit([&] { mInitialClientSource.reset(); });
      |       ^~~~~~~~~~~~~
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp: In member function ‘nsresult nsDocShell::OpenRedirectedChannel(nsDocShellLoadState*)’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/nsDocShell.cpp:10418:7: error: ‘MakeScopeExit’ was not declared in this scope
10418 |       MakeScopeExit([&] { mInitialClientSource.reset(); });
      |       ^~~~~~~~~~~~~
In file included from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/nsTHashtable.h:23,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/nsBaseHashtable.h:14,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/nsDataHashtable.h:11,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/IHistory.h:11,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/BaseHistory.h:8,
                 from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/BaseHistory.cpp:7,
                 from Unified_cpp_docshell_base0.cpp:2:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/mozilla/PodOperations.h: In instantiation of ‘void mozilla::PodZero(T*) [with T = xpc::GlobalProperties]’:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/js/xpconnect/src/xpcprivate.h:2218:45:   required from here
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/dist/include/mozilla/PodOperations.h:35:9: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct xpc::GlobalProperties’; use assignment or value-initialization instead [-Wclass-memaccess]
   35 |   memset(aT, 0, sizeof(T));
      |   ~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/docshell/base/BrowsingContext.cpp:63,
                 from Unified_cpp_docshell_base0.cpp:11:
/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/js/xpconnect/src/xpcprivate.h:2217:8: note: ‘struct xpc::GlobalProperties’ declared here
 2217 | struct GlobalProperties {
      |        ^~~~~~~~~~~~~~~~
gmake[4]: *** [/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/config/rules.mk:676: Unified_cpp_docshell_base0.o] Error 1
gmake[4]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu/docshell/base'
gmake[3]: *** [/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/config/recurse.mk:72: docshell/base/target-objects] Error 2
gmake[3]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu'
gmake[2]: *** [/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/config/recurse.mk:34: compile] Error 2
gmake[2]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu'
gmake[1]: *** [/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/config/rules.mk:355: default] Error 2
gmake[1]: Leaving directory '/home/jenkins/workspace/Firefox-default/label/ppc64le/firefox/obj-powerpc64le-unknown-linux-gnu'
gmake: *** [client.mk:89: build] Error 2

proposed fix

diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index f0052a15148..e79494ce744 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -33,6 +33,7 @@
 #include "mozilla/PresShell.h"
 #include "mozilla/ResultExtensions.h"
 #include "mozilla/SchedulerGroup.h"
+#include "mozilla/ScopeExit.h"
 #include "mozilla/ScrollTypes.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPrefs_browser.h"
diff --git a/docshell/base/nsDocShellTreeOwner.cpp b/docshell/base/nsDocShellTreeOwner.cpp
index 4c57ee9b995..b2313c8c727 100644
--- a/docshell/base/nsDocShellTreeOwner.cpp
+++ b/docshell/base/nsDocShellTreeOwner.cpp
@@ -12,6 +12,7 @@
 #include "nsContentUtils.h"
 #include "nsSize.h"
 #include "mozilla/ReflowInput.h"
+#include "mozilla/ScopeExit.h"
 #include "nsComponentManagerUtils.h"
 #include "nsString.h"
 #include "nsAtom.h"

Is that sufficient to fix the build? Can you put up a patch on Phabricator? I can review it.

Explicitly include mozilla/ScopeExit.h to unbreak build on ppc64le and s390x platforms.
Seems the header is included indirectly on other platforms.

Unfortunately there are at least 2 other issues that needs fixing (bug 1679271 and bug 1679273), all came in since yesterday.

Assignee: nobody → dan

Ok, I will provide a fix for Bug 1679273.

You can run ./mach build -- -k so that it continues on errors, so that you can get an overview of unrelated issues. If there are more issues, feel free to attach the build log.

Yeah, seems there are more occurrences of this issue (will update the patch) and the one from bug 1679273 too.

Component: MFBT → DOM: Core & HTML
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

I now did a build without MOZ_GECKO_PROFILER and found several more issues. I will provide a fix for all of those in Bug 1679273.

Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1679273

OK, thanks a lot.

I have just finished fixing all those "‘MakeScopeExit’ was not declared in this scope" errors(there were many), so I will attach the patch for a reference.

Sorry for the overlapping work, I just figured out how to build without MOZ_GECKO_PROFILER. You can also add them to D97959, and I will remove them from my patch again. I did the build on Linux x64, so there still might be some differences to your platforms.

Attached file scopeExit.patch

regenerated from hg repo using "hg export ."

Simon, feel free to drop my submission and use yours if it's causing troubles when merging.

Attachment #9189718 - Attachment is obsolete: true
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ce148e5bf5c
Include ScopeExit.h exactly where used. r=andi
You need to log in before you can comment on or make changes to this bug.