Closed Bug 1419959 Opened 6 years ago Closed 6 years ago

toolkit/xre/nsEmbedFunctions.cpp:289:4: error: #error "OOP crash reporter unsupported on this platform"

Categories

(Toolkit :: Crash Reporting, defect)

Unspecified
FreeBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox-esr52 --- unaffected
firefox57 --- unaffected
firefox58 --- unaffected
firefox59 --- fixed

People

(Reporter: jbeich, Assigned: jbeich)

References

Details

(Keywords: regression)

Attachments

(1 file)

CrashReporter isn't implemented on DragonFly, FreeBSD, NetBSD, OpenBSD and GNU/kFreeBSD. Solaris had one until bug 1255813.

$ c++ -v
FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on LLVM 5.0.0svn)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin

$ ./mach bootstrap
$ ./mach build
[...]
In file included from objdir/ipc/glue/Unified_cpp_ipc_glue0.cpp:92:
ipc/glue/GeckoChildProcessHost.cpp:769:25: error: no member named
      'CreateNotificationPipeForChild' in namespace 'CrashReporter'
    if (!CrashReporter::CreateNotificationPipeForChild(
         ~~~~~~~~~~~~~~~^
toolkit/xre/nsEmbedFunctions.cpp:289:4: error: "OOP crash reporter unsupported
      on this platform"
#  error "OOP crash reporter unsupported on this platform"
   ^
toolkit/xre/nsEmbedFunctions.cpp:505:4: error: "OOP crash reporting unsupported
      on this platform"
#  error "OOP crash reporting unsupported on this platform"
   ^
Other files built fine after bug 1402519. Either non-dummy implementation now leaks into --disable-crashreporter or some #include is missing.
The idea behind #1402519 is nice in itself for poor tier3 platforms, now if only it was a proven-and-tested-in-CI configuration.. :)
(In reply to Jan Beich from comment #1)
> Other files built fine after bug 1402519. Either non-dummy implementation
> now leaks into --disable-crashreporter or some #include is missing.

The issue was in the GeckoChildProcessHost code which called CreateNotificationPipeForChild() for BSDs too w/o the dummy exception handler implementing it. I'm implementing a fix and I'll reland later today.
Only 1 error out of 3 was fixed. Maybe #elif defined(OS_LINUX) can be turned into #else. Wasn't the dummy supposed to abstract away platform differences?

$ ./mach build
[...]
gmake[1]: Entering directory '/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/toolkit/xre'
/usr/bin/c++ -std=gnu++14 -o nsEmbedFunctions.o -c -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/dist/stl_wrappers -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/dist/system_wrappers -include /tmp/mozilla-central/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DPROXY_PRINTING=1 -DOS_POSIX=1 -DOS_FREEBSD=1 -DOS_BSD=1 -DUSE_GLX_TEST '-DMOZ_APP_NAME="firefox"' '-DMOZ_APP_BASENAME="Firefox"' '-DMOZ_APP_VERSION="59.0a1"' '-DOS_TARGET="FreeBSD"' '-DMOZ_WIDGET_TOOLKIT="gtk3"' -DMOZ_UPDATER '-DTARGET_OS_ABI="FreeBSD_x86_64-gcc3"' -DGRE_MILESTONE=59.0a1 -DAPP_VERSION=59.0a1 '-DAPP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}' -DMOZ_BUILD_APP_IS_BROWSER -DTOPOBJDIR=/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/tmp/mozilla-central/toolkit/xre -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/toolkit/xre -I/tmp/mozilla-central/toolkit/components/printingui -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/ipc/ipdl/_ipdlheaders -I/tmp/mozilla-central/ipc/chromium/src -I/tmp/mozilla-central/ipc/glue -I/tmp/mozilla-central/toolkit/components/find -I/tmp/mozilla-central/toolkit/components/printingui/ipc -I/tmp/mozilla-central/toolkit/components/windowwatcher -I/tmp/mozilla-central/toolkit/profile -I/tmp/mozilla-central/config -I/tmp/mozilla-central/dom/base -I/tmp/mozilla-central/dom/commandhandler -I/tmp/mozilla-central/dom/ipc -I/tmp/mozilla-central/dom/webbrowserpersist -I/tmp/mozilla-central/testing/gtest/mozilla -I/tmp/mozilla-central/toolkit/crashreporter -I/tmp/mozilla-central/xpcom/build -I/tmp/mozilla-central/widget/xremoteclient -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/dist/include -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/dist/include/nspr -I/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/mozilla-config.h -Qunused-arguments -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Qunused-arguments -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wloop-analysis -Wc++1z-compat -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pipe -O -fno-omit-frame-pointer -I/tmp/mozilla-central/widget/gtk/compat-gtk3 -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/atk-1.0 -I/usr/local/include/gtk-3.0/unix-print -D_THREAD_SAFE -pthread -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread -Wno-error=shadow  -MD -MP -MF .deps/nsEmbedFunctions.o.pp -DMOZ_BUILDID=20171124033447  /tmp/mozilla-central/toolkit/xre/nsEmbedFunctions.cpp
/tmp/mozilla-central/toolkit/xre/nsEmbedFunctions.cpp:289:4: error: "OOP crash reporter unsupported
      on this platform"
#  error "OOP crash reporter unsupported on this platform"
   ^
/tmp/mozilla-central/toolkit/xre/nsEmbedFunctions.cpp:505:4: error: "OOP crash reporting unsupported
      on this platform"
#  error "OOP crash reporting unsupported on this platform"
   ^
2 errors generated.
Summary: ipc/glue/GeckoChildProcessHost.cpp:769:25: error: 'CreateNotificationPipeForChild' is not a member of 'CrashReporter' → toolkit/xre/nsEmbedFunctions.cpp:289:4: error: #error "OOP crash reporter unsupported on this platform"
(In reply to Jan Beich from comment #4)
> Maybe #elif defined(OS_LINUX) can be turned into #else.

No joy.

../../build/unix/gold/ld: error: /tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/toolkit/library/../xre/nsEmbedFunctions.o: requires dynamic R_X86_64_PC32 reloc against '_ZN13CrashReporter25SetRemoteExceptionHandlerEv' which may overflow at runtime; recompile with -fPIC
../../build/unix/gold/ld: error: read-only segment has dynamic relocations
/tmp/mozilla-central/obj-x86_64-unknown-freebsd12.0/toolkit/library/../xre/nsEmbedFunctions.o:/tmp/mozilla-central/toolkit/xre/nsEmbedFunctions.cpp:function XRE_SetRemoteExceptionHandler(char const*): warning: undefined reference to 'CrashReporter::SetRemoteExceptionHandler()'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Looking in toolkit/crashreporter/nsDummyExceptionHandler.cpp the code expects OS_BSD and OS_SOLARIS but OS_* defines are invalid outside of Chromium (see bug 1386207 and bug 1386812).

What exactly Gecko expects with dummy platform whitelists? It seems Windows is the only special snowflake. OS X and Linux can be unified. Other Unices (Tier3) can jump on the same bandwagon.
Comment on attachment 8931568 [details]
Bug 1419959 - Unbreak build on Tier3 platforms after bug 1402519.

https://reviewboard.mozilla.org/r/202692/#review208034

This is fine, what I didn't realize is that before my patch that code was not compiled on tier-3 platforms so it was out-of-sync WRT nsExceptionHandler.h. Since the broken code was from Chromium I'd expect it's supposed to work on non-Linux variants which means there's hope to implement crash reporting on other platforms in the future.
Attachment #8931568 - Flags: review?(gsvelto) → review+
Comment on attachment 8931568 [details]
Bug 1419959 - Unbreak build on Tier3 platforms after bug 1402519.

https://reviewboard.mozilla.org/r/202692/#review208034

> WRT nsExceptionHandler.h

Doh, I forgot to drop OS_BSD from that file.
Comment on attachment 8931568 [details]
Bug 1419959 - Unbreak build on Tier3 platforms after bug 1402519.

https://reviewboard.mozilla.org/r/202692/#review208034

> there's hope to implement crash reporting on other platforms in the future.

[Google Breakpad](https://www.freshports.org/devel/breakpad) exists on FreeBSD. The patches look simple but, unfortunately, haven't been upstreamed. Porting CrashReporter may be a first step towards GeckoProfiler. I've yet to investigate, though.
Keywords: checkin-needed
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/4aec28745fb0
Unbreak build on Tier3 platforms after bug 1402519. r=gsvelto
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4aec28745fb0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Assignee: nobody → jbeich
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: