Closed Bug 1372546 Opened 7 years ago Closed 7 years ago

media/webrtc/trunk/webrtc/base/base_rtc_task_queue/Unified_cpp_trunk_webrtc_base0.cpp:(.text._ZN3rtc9TaskQueueC2EPKc+0x20): undefined reference to `event_base_new'

Categories

(Core :: WebRTC, defect, P1)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1386164
Tracking Status
firefox-esr52 --- unaffected
firefox54 --- unaffected
firefox55 --- unaffected
firefox56 --- fix-optional
firefox57 --- fix-optional

People

(Reporter: jbeich, Unassigned)

References

Details

(Keywords: regression)

$ echo "ac_add_options --with-system-libevent" >>.mozconfig
$ ./mach build
[...]
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `MessageLoop::MessageLoop(MessageLoop::Type, nsIThread*)':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN11MessageLoopC2ENS_4TypeEP9nsIThread+0x2bf): undefined reference to `event_base_new'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::WatchFileDescriptor(int, bool, base::MessagePumpLibevent::Mode, base::MessagePumpLibevent::FileDescriptorWatcher*, base::MessagePumpLibevent::Watcher*)':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent19WatchFileDescriptorEibNS0_4ModeEPNS0_21FileDescriptorWatcherEPNS0_7WatcherE+0x72): undefined reference to `event_del'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent19WatchFileDescriptorEibNS0_4ModeEPNS0_21FileDescriptorWatcherEPNS0_7WatcherE+0xbe): undefined reference to `event_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent19WatchFileDescriptorEibNS0_4ModeEPNS0_21FileDescriptorWatcherEPNS0_7WatcherE+0xce): undefined reference to `event_base_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent19WatchFileDescriptorEibNS0_4ModeEPNS0_21FileDescriptorWatcherEPNS0_7WatcherE+0xdc): undefined reference to `event_add'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent19WatchFileDescriptorEibNS0_4ModeEPNS0_21FileDescriptorWatcherEPNS0_7WatcherE+0xf5): undefined reference to `event_del'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `MessageLoopForIO::CatchSignal(int, base::MessagePumpLibevent::SignalEvent*, base::MessagePumpLibevent::SignalWatcher*)':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN16MessageLoopForIO11CatchSignalEiPN4base19MessagePumpLibevent11SignalEventEPNS1_13SignalWatcherE+0x5b): undefined reference to `event_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN16MessageLoopForIO11CatchSignalEiPN4base19MessagePumpLibevent11SignalEventEPNS1_13SignalWatcherE+0x67): undefined reference to `event_base_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN16MessageLoopForIO11CatchSignalEiPN4base19MessagePumpLibevent11SignalEventEPNS1_13SignalWatcherE+0x75): undefined reference to `event_add'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::CatchSignal(int, base::MessagePumpLibevent::SignalEvent*, base::MessagePumpLibevent::SignalWatcher*)':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent11CatchSignalEiPNS0_11SignalEventEPNS0_13SignalWatcherE+0x57): undefined reference to `event_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent11CatchSignalEiPNS0_11SignalEventEPNS0_13SignalWatcherE+0x63): undefined reference to `event_base_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent11CatchSignalEiPNS0_11SignalEventEPNS0_13SignalWatcherE+0x71): undefined reference to `event_add'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::FileDescriptorWatcher::~FileDescriptorWatcher()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent21FileDescriptorWatcherD2Ev+0x1b): undefined reference to `event_del'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::FileDescriptorWatcher::StopWatchingFileDescriptor()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent21FileDescriptorWatcher26StopWatchingFileDescriptorEv+0x1c): undefined reference to `event_del'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::OnWakeup(int, short, void*)':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent8OnWakeupEisPv+0x44): undefined reference to `event_base_loopbreak'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::MessagePumpLibevent()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibeventC2Ev+0x2f): undefined reference to `event_base_new'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::Init()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent4InitEv+0xc7): undefined reference to `event_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent4InitEv+0xd4): undefined reference to `event_base_set'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent4InitEv+0xdf): undefined reference to `event_add'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::~MessagePumpLibevent()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibeventD2Ev+0x18): undefined reference to `event_del'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibeventD2Ev+0x4d): undefined reference to `event_base_free'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::~MessagePumpLibevent()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibeventD0Ev+0x18): undefined reference to `event_del'
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibeventD0Ev+0x47): undefined reference to `event_base_free'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::SignalEvent::~SignalEvent()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent11SignalEventD2Ev+0x19): undefined reference to `event_del'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::SignalEvent::StopCatching()':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent11SignalEvent12StopCatchingEv+0x1a): undefined reference to `event_del'
../../ipc/chromium/Unified_cpp_ipc_chromium0.o: In function `base::MessagePumpLibevent::Run(base::MessagePump::Delegate*)':
ipc/chromium/Unified_cpp_ipc_chromium0.cpp:(.text._ZN4base19MessagePumpLibevent3RunEPNS_11MessagePump8DelegateE+0xf5): undefined reference to `event_base_loop'
../../media/webrtc/trunk/webrtc/base/base_rtc_task_queue/Unified_cpp_trunk_webrtc_base0.o: In function `rtc::TaskQueue::TaskQueue(char const*)':
media/webrtc/trunk/webrtc/base/base_rtc_task_queue/Unified_cpp_trunk_webrtc_base0.cpp:(.text._ZN3rtc9TaskQueueC2EPKc+0x20): undefined reference to `event_base_new'
/usr/bin/ld: ../../media/webrtc/trunk/webrtc/base/base_rtc_task_queue/Unified_cpp_trunk_webrtc_base0.o: relocation R_X86_64_PC32 against `event_base_new' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
$ pkg info -x event
libevent-2.1.8
stuck compiling with
ac_add_options --without-system-libevent
in mozconfig
to avoid this
Rank: 15
Priority: -- → P1
I was unable to get a working firefox after doing the --without-system-libevent
It compiles ok, but hangs at startup with 100% cpu usage and increasing RAM usage, UNLESS I recompile with debug info then it works, sort of, well it doesn't hang but the GUI is all borked! I should create a new issue because it's possibly unrelated to my inability to succeed in linking with --with-system-libevent

done: https://bugzilla.mozilla.org/show_bug.cgi?id=1376197
Here's what I see, with(mozconfig's): ac_add_options --with-system-libevent

94:10.30 ../../build/unix/gold/ld: error: /tmp/obj-x86_64-pc-linux-gnu/toolkit/library/../../media/webrtc/trunk/webrtc/base/base_rtc_task_queue/Unified_cpp_trunk_webrtc_base0.o: requires dynamic R_X86_64_PC32 reloc against 'event_set' which may overflow at runtime; recompile with -fPIC
94:10.30 ../../build/unix/gold/ld: error: read-only segment has dynamic relocations
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_loopbreak' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_free' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_loop' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_add' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_new' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_add' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_add' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_set' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_new' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_add' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_once' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_add' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_loop' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_loopbreak' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_del' is not defined locally
94:10.31 ../../build/unix/gold/ld: error: hidden symbol 'event_base_free' is not defined locally
94:10.31 collect2: error: ld returned 1 exit status
94:10.31 make[5]: *** [/home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/config/rules.mk:721: libxul.so] Error 1
94:10.31 make[5]: Leaving directory '/tmp/obj-x86_64-pc-linux-gnu/toolkit/library'
94:10.31 make[4]: *** [/home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/config/recurse.mk:73: toolkit/library/target] Error 2
94:10.31 make[4]: Leaving directory '/tmp/obj-x86_64-pc-linux-gnu'
94:10.32 make[3]: *** [/home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/config/recurse.mk:33: compile] Error 2
94:10.32 make[3]: Leaving directory '/tmp/obj-x86_64-pc-linux-gnu'
94:10.32 make[2]: *** [/home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/config/rules.mk:455: default] Error 2
94:10.32 make[2]: Leaving directory '/tmp/obj-x86_64-pc-linux-gnu'
94:10.32 make[1]: *** [/home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/client.mk:419: realbuild] Error 2
94:10.32 make[1]: Leaving directory '/home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg'
94:10.32 make: *** [client.mk:170: build] Error 2
94:10.33 0 compiler warnings present.
Looks like I was already using -fPIC

 1:48.68 Executing: /usr/bin/ccache /usr/bin/g++ -std=gnu++11 -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -pipe -march=native -Wno-trigraphs -fno-schedule-insns2 -fno-delete-null-pointer-checks -mtune=native -fomit-frame-pointer -Ofast -fno-fast-math -D_FORTIFY_SOURCE=2 -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -Os -fno-omit-frame-pointer -fPIC -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so /tmp/obj-x86_64-pc-linux-gnu/toolkit/library/tmpcSxf8Z.list -lpthread -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-rpath,/usr/lib/firefox -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -B ../../build/unix/gold -Wl,-version-script,symverscript -Wl,-rpath-link,/tmp/obj-x86_64-pc-linux-gnu/dist/bin -Wl,-rpath-link,/usr/lib -fdiagnostics-color ../../security/nss/lib/crmf/crmf_crmf/libcrmf.a ../../js/src/build/libjs_static.a x86_64-unknown-linux-gnu/debug/libgkrust.a ../../security/sandbox/linux/libmozsandbox.so ../../config/external/nspr/pr/libnspr4.so ../../config/external/nspr/libc/libplc4.so ../../config/external/nspr/ds/libplds4.so ../../config/external/lgpllibs/liblgpllibs.so ../../security/nss/lib/nss/nss_nss3/libnss3.so ../../security/nss/lib/util/util_nssutil3/libnssutil3.so ../../security/nss/lib/smime/smime_smime3/libsmime3.so ../../config/external/sqlite/libmozsqlite3.so ../../security/nss/lib/ssl/ssl_ssl3/libssl3.so ../../widget/gtk/mozgtk/stub/libmozgtk_stub.so -ldl -lpthread -ldl -lc -L/usr/lib/../lib -lffi -lz -lm -lfreetype -lfontconfig -lrt -L/usr/lib64 -lXrender -lXext -lXdamage -lXfixes -lXcomposite -ljpeg -lhunspell-1.6 -levent -lvpx -lpixman-1 -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lX11-xcb -lxcb-shm -lxcb -lX11 -lpangoft2-1.0 -lXt -lgthread-2.0
I tried adding all libevent headers to config/system-headers but this had no effect.

#if MOZ_SYSTEM_LIBEVENT==1
evdns.h
event.h
evhttp.h
evrpc.h
evutil.h
event2/buffer.h
event2/buffer_compat.h
event2/bufferevent.h
event2/bufferevent_compat.h
event2/bufferevent_ssl.h
event2/bufferevent_struct.h
event2/dns.h
event2/dns_compat.h
event2/dns_struct.h
event2/event-config.h
event2/event.h
event2/event_compat.h
event2/event_struct.h
event2/http.h
event2/http_compat.h
event2/http_struct.h
event2/keyvalq_struct.h
event2/listener.h
event2/rpc.h
event2/rpc_compat.h
event2/rpc_struct.h
event2/tag.h
event2/tag_compat.h
event2/thread.h
event2/util.h
event2/visibility.h


as per this suggestion https://bugzilla.mozilla.org/show_bug.cgi?id=1332788#c2
looks to me that the errors in Comment 4 are coming from this file:
media/webrtc/trunk/webrtc/base/task_queue_libevent.cc

specifically one include line:
#include "libevent/include/event.h"

which doesn't seem to care for when using --with-system-libevent
it must be assuming --without-system-libevent at all times since there is no surrounding #ifdef around that path-ed include!

However I tried:
#include "event.h"
and
#include <event.h>
and
#include <event.h>
#include <event2/event.h>

they each fail with:
 0:08.85 In file included from /tmp/obj-x86_64-pc-linux-gnu/media/webrtc/trunk/webrtc/base/base_rtc_task_queue/Unified_cpp_trunk_webrtc_base0.cpp:11:0:
 0:08.85 /home/xftroxgpx/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/media/webrtc/trunk/webrtc/base/task_queue_libevent.cc:35:9: error: field ‘ev’ has incomplete type ‘event’
 0:08.85    event ev;
 0:08.85          ^~
and many other errors.

I would try ac_add_options --disable-webrtc  however I'm not sure it will compile(currently compiling) since the last time(months ago perhaps) it failed with:
# 0:26.05 /home/z/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/dom/media/webrtc/MediaEngineCameraVideoSource.h:14:53: fatal error: webrtc/video_engine/include/vie_capture.h: No such file or directory



Maybe someone knowledgeable can step in and suggest the proper fix here? Would be gr9 :)
Compiles ok with ac_add_options --disable-webrtc
(and the implied  ac_add_options --with-system-libevent )

Tested

changeset:   366410:217b7fcf5894
tag:         tip
You might want to try fiddling with the libevent settings in build/gyp.mozbuild, and also with the conditionals/etc in the *.gyp files that interact with libevent

See media/webrtc/trunk/webrtc/base/basy.gyp
Thanks. However, since I do want both options in Comment 8 and it compiles ok thus far, I opted to leave it alone and focus on another firefox issue. Appreciate it though. Cheers!
(In reply to Emanuel Czirai from comment #10)
> Thanks. However, since I do want both options in Comment 8 and it compiles
> ok thus far, I opted to leave it alone and focus on another firefox issue.
> Appreciate it though. Cheers!

Sure, but that turns off a major browser feature.
Randell, how serious is this? Should we treat it as fix-optional?
Flags: needinfo?(rjesup)
(In reply to Panos Astithas [:past] (please needinfo?) from comment #12)
> Randell, how serious is this? Should we treat it as fix-optional?

Not that serious, though annoying.  yes, fix-optional.  This affects BSD (and could affect linux distros perhaps that set --with-system-libevent, if any do -- they might)

Getting the latest webrtc.org code working with the libevent code we have in ipc/* was painful enough....  Fixing this might mean undoing some of those changes and finding different workarounds for include paths, etc.

--disable-webrtc is not a solution, but --with-system-libevent is not a "standard" configuration on any of the platforms we directly support that I know of. (Glandium, do you know how the various distros/downstreams do regarding libevent?)
Flags: needinfo?(rjesup) → needinfo?(mh+mozilla)
I only know about Debian, and we use --with-system-libevent.
Flags: needinfo?(mh+mozilla)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.