Closed Bug 1475573 Opened 2 years ago Closed 2 years ago

Create --enable-fuzzing debug build job for Android x86 firefox.

Categories

(Firefox Build System :: Task Configuration, task)

x86
Android
task
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: truber, Assigned: truber)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

To support fuzzing on Android we need debug builds with --enable-fuzzing.
Comment on attachment 8995190 [details]
Create --enable-fuzzing debug build job for Android x86 firefox.

I'm trying to add --enable-fuzzing on android, and hitting link errors like this:

 0:22.50 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:246: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.50 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:514: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.50 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:295: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.51 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:294: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.51 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:514: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.51 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:295: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.51 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:520: error: undefined reference to '__sanitizer_cov_trace_const_cmp1'
 0:22.51 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:302: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.53 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:520: error: undefined reference to '__sanitizer_cov_trace_const_cmp1'
 0:22.53 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:302: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.55 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:526: error: undefined reference to '__sanitizer_cov_trace_const_cmp1'
 0:22.58 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:246: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.58 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:514: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.58 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:295: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.58 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:294: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.58 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:558: error: undefined reference to '__sanitizer_cov_trace_const_cmp1'
 0:22.58 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:514: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.58 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:295: error: undefined reference to '__sanitizer_cov_trace_pc_guard'
 0:22.59 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:520: error: undefined reference to '__sanitizer_cov_trace_const_cmp1'
 0:22.59 /home/truber/src/m/u/obj-i386-linux-android/dist/include/js/HeapAPI.h:494: error: undefined reference to '__sanitizer_cov_trace_switch'
 0:22.59 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:302: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'
 0:22.60 /home/truber/src/m/u/obj-i386-linux-android/dist/include/mozilla/Vector.h:520: error: undefined reference to '__sanitizer_cov_trace_const_cmp1'
 0:22.60 /home/truber/src/m/u/js/src/vm/StructuredClone.cpp:302: error: undefined reference to '__sanitizer_cov_trace_const_cmp4'

I got around this in libplugin-container.so by the changes in ipc/app/moz.build, but it seems to be happening in every lib.

For desktop we only add this in browser/app/moz.build and everything seems to work, but making the change in mobile/android/moz.build or mobile/android/app/moz.build doesn't do it.

Is there a build file I can change that will affect everything for the android build?

https://treeherder.mozilla.org/#/jobs?repo=try&revision=ab0104ff986079fe7f65ae83508a99ac0ee2bee6
Attachment #8995190 - Flags: feedback?(nfroyd)
Comment on attachment 8995190 [details]
Create --enable-fuzzing debug build job for Android x86 firefox.

You probably want to add a USE_LIBS for fuzzer somewhere in:

https://searchfox.org/mozilla-central/source/build/gecko_templates.mozbuild#8-51

I don't think you want the explicit mozglue in USE_LIBS.
Attachment #8995190 - Flags: feedback?(nfroyd)
Thanks! Now it is building, it just won't launch.

The mozglue in ipc/app/moz.build is because otherwise I get undefined references to mozalloc.


When it launches I see the fennec GUI for an instant, then it crashes. Logcat contains:

07-26 16:41:04.176  6251  6272 E GeckoLinker: Couldn't map /data/user/0/org.mozilla.fennec_aurora/cache/libxul.so to decompress library
07-26 16:41:04.176  6251  6272 E GeckoLibLoad: Couldn't get a handle to libxul!
07-26 16:41:04.176  6251  6272 E GeckoLibLoad: Throw
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler: >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 305 ("Gecko")
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler: java.lang.Exception: Error loading gecko libraries
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler:     at org.mozilla.gecko.mozglue.GeckoLoader.loadGeckoLibsNative(Native Method)
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler:     at org.mozilla.gecko.mozglue.GeckoLoader.loadGeckoLibs(GeckoLoader.java:440)
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler:     at org.mozilla.gecko.GeckoThread.loadGeckoLibs(GeckoThread.java:282)
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler:     at org.mozilla.gecko.GeckoThread.initGeckoEnvironment(GeckoThread.java:322)
07-26 16:41:04.177  6251  6272 E GeckoCrashHandler:     at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:449)


/data/user/0/org.mozilla.fennec_aurora/cache contains only 'icons/', but if I install the latest nightly and run it in the same emulator, the cache gets populated with libxul.so etc. and it launches correctly.
Comment on attachment 8995190 [details]
Create --enable-fuzzing debug build job for Android x86 firefox.

The apk is working now. The crash on launch I was seeing was because of my local mozconfig not stripping symbols which made the emulator OOM unpacking libxul.

As you mentioned, the change to ipc/app/moz.build seems strange, but without adding 'fuzzer' to USE_LIBS I get errors like:

ipc/app/MozillaRuntimeMainAndroid.cpp:12: error: undefined reference to '__sanitizer_cov_trace_pc_guard'

.. and without 'mozglue' I get:

obj-firefox/dist/include/mozilla/mozalloc.h:156: error: undefined reference to 'moz_xmalloc'

https://treeherder.mozilla.org/#/jobs?repo=try&revision=fe0329354bafb8f0f1b45f1c29cc3c8668e168fa
Attachment #8995190 - Flags: review?(nfroyd)
Comment on attachment 8995190 [details]
Create --enable-fuzzing debug build job for Android x86 firefox.

Nathan Froyd [:froydnj] has approved the revision.

https://phabricator.services.mozilla.com/D2428
Attachment #8995190 - Flags: review+
Comment on attachment 8995190 [details]
Create --enable-fuzzing debug build job for Android x86 firefox.

For some reason, I have another review request?  I hope this doesn't flip the flag in phab...
Attachment #8995190 - Flags: review?(nfroyd) → review+
Comment on attachment 8995190 [details]
Create --enable-fuzzing debug build job for Android x86 firefox.

Nick Alexander :nalexander has approved the revision.

https://phabricator.services.mozilla.com/D2428
Attachment #8995190 - Flags: review+
Keywords: checkin-needed
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/acde419e016e
Create --enable-fuzzing debug build job for Android x86 firefox. r=froydnj,nalexander
Keywords: checkin-needed
Missed merge with 98578393d6357aa701b062b231ed867209b9825c. Updated diff to add node toolchain.
Flags: needinfo?(jschwartzentruber)
Keywords: checkin-needed
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d602a2f69ff8
Create --enable-fuzzing debug build job for Android x86 firefox. r=nalexander,froydnj
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d602a2f69ff8
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
See Also: → 1466021
See Also: → 1483907
Backout by dluca@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/4248cea4f9a1
Backed out changeset d602a2f69ff8 on request from truber. a=backout
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Depends on: 1483907
See Also: 1483907
Updated try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2fea3157d1f00fdfc5ba6d1f0e9ae250be1b3b16

I've just disabled libFuzzer for Android. The linker changes shouldn't be required, so until I figure out why they are, it's better to have a fuzzing build that we can start fuzzing on Android.
Keywords: checkin-needed
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b073a55c2be7
Create --enable-fuzzing debug build job for Android x86 firefox. r=nalexander,froydnj
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b073a55c2be7
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.