Closed Bug 1187533 Opened 6 years ago Closed 6 years ago

[gtk3] AddressSanitizer: 384 byte(s) leaked in 1 allocation(s).

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

05:13:02     INFO -  /builds/slave/test/build/application/firefox/llvm-symbolizer: symbol lookup error: /builds/slave/test/build/application/firefox/libmozgtk2.so: undefined symbol: __asan_init_v3
05:13:02     INFO -  ==2119==WARNING: Can't read from symbolizer at fd 3
05:13:02     INFO -  /builds/slave/test/build/application/firefox/llvm-symbolizer: symbol lookup error: /builds/slave/test/build/application/firefox/libmozgtk2.so: undefined symbol: __asan_init_v3
05:13:02     INFO -  ==2119==WARNING: Can't read from symbolizer at fd 3
05:13:02     INFO -  /builds/slave/test/build/application/firefox/llvm-symbolizer: symbol lookup error: /builds/slave/test/build/application/firefox/libmozgtk2.so: undefined symbol: __asan_init_v3
05:13:02     INFO -  ==2119==WARNING: Can't read from symbolizer at fd 3
05:13:02     INFO -  567 INFO TEST-START | layout/inspector/tests/test_isinheritableproperty.html
05:13:02     INFO -  /builds/slave/test/build/application/firefox/llvm-symbolizer: symbol lookup error: /builds/slave/test/build/application/firefox/libmozgtk2.so: undefined symbol: __asan_init_v3
05:13:02     INFO -  ==2119==WARNING: Can't read from symbolizer at fd 3
05:13:02     INFO -  ==2119==WARNING: Failed to use and restart external symbolizer!
05:13:02     INFO -  =================================================================
05:13:02     INFO -  ==2119==ERROR: LeakSanitizer: detected memory leaks
05:13:02     INFO -  Direct leak of 384 byte(s) in 1 object(s) allocated from:
05:13:02     INFO -      #0 0x4750f1 (/builds/slave/test/build/application/firefox/plugin-container+0x4750f1)
05:13:02     INFO -      #1 0x7f65efd5d662 (/builds/slave/test/build/application/firefox/libxul.so+0x92c0662)
05:13:02     INFO -      #2 0x7f65efdba8d5 (/builds/slave/test/build/application/firefox/libxul.so+0x931d8d5)
05:13:02     INFO -      #3 0x7f65efc2619d (/builds/slave/test/build/application/firefox/libxul.so+0x918919d)
05:13:02     INFO -      #4 0x7f65efc1154a (/builds/slave/test/build/application/firefox/libxul.so+0x917454a)
05:13:02     INFO -  -----------------------------------------------------
05:13:02     INFO -  Suppressions used:
05:13:02     INFO -    count      bytes template
05:13:02     INFO -      185       8352 libfontconfig.so
05:13:02     INFO -       25       4460 libglib-2.0.so
05:13:02     INFO -        1         32 libXrandr.so
05:13:02     INFO -  -----------------------------------------------------
05:13:02     INFO -  SUMMARY: AddressSanitizer: 384 byte(s) leaked in 1 allocation(s).


Assuming those _asan_init missing symbols are relevant, this could be caused by bug 1063359. I'll test this.
Backing out bug 1063359 doesn't make those undefined symbol errors disappear.
No longer blocks: 1063359
The current situation looks like this: Firefox launches the plugin-container
with two environment variables set:
  LD_LIBRARY_PATH=$FIREFOX_DIR:$LD_LIBRARY_PATH
  LD_PRELOAD=$FIREFOX_DIR/libmozgtk2.so:$LD_PRELOAD

libxul.so has a dependency on libmozgtk.so (without "2"), but libmozgtk2.so
has a SONAME of libmozgtk.so, so ld.so recognizes libmozgtk2.so as a
dependency of libxul.so, and uses it instead of the actual libmozgtk.so,
making the plugin-container use Gtk+2 instead of Gtk+3 to load Gtk+2 plugins.

Now, ASan sets things up in shared libraries such that they needs a symbol
from the executable binary. So in the case of plugin-container, the
plugin-container executable itself contains some ASan symbols such as
__asan_init_v3. libmozgtk2.so, OTOH, contains an undefined weak reference to
that symbol, like all other Firefox shared libraries.

Since libmozgtk2.so is LD_PRELOADed, it is loaded _before_ the
plugin-container executable, and __asan_init_v3 can't be resolved.

Disabling ASan for libmozgtk2.so would be a possibility, but the build system
doesn't really know how to do that, and filtering out -fsanitize=address
can be fragile.

The alternative possibility, implemented here, is to change the library
loading strategy, renaming libmozgtk2.so to gtk2/libmozgtk.so, and setting
the following environment variable when Firefox launches the plugin-container:
  LD_LIBRARY_PATH=$FIREFOX_DIR/gtk2:$FIREFOX_DIR:$LD_LIBRARY_PATH
Assignee: nobody → mh+mozilla
Attachment #8639078 - Flags: review?(wmccloskey)
Comment on attachment 8639078 [details] [diff] [review]
Change how Gtk+2 plugin-container is started on Gtk+3 builds

Review of attachment 8639078 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the great explanation!
Attachment #8639078 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/c838e1e4de5d
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.