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

RESOLVED FIXED in Firefox 63

Status

task
RESOLVED FIXED
Last year
10 months ago

People

(Reporter: truber, Assigned: truber)

Tracking

(Depends on 1 bug)

Trunk
mozilla63
x86
Android
Dependency tree / graph

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(1 attachment)

To support fuzzing on Android we need debug builds with --enable-fuzzing.
Assignee

Comment 2

11 months ago
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)
Assignee

Comment 4

11 months ago
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.
Assignee

Comment 5

11 months ago
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+
Assignee

Updated

11 months ago
Keywords: checkin-needed

Comment 9

11 months ago
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
Assignee

Comment 11

11 months ago
Missed merge with 98578393d6357aa701b062b231ed867209b9825c. Updated diff to add node toolchain.
Flags: needinfo?(jschwartzentruber)
Keywords: checkin-needed

Comment 12

11 months ago
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

Comment 13

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d602a2f69ff8
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Assignee

Updated

11 months ago
See Also: → 1466021
Assignee

Updated

11 months ago
See Also: → 1483907

Comment 14

11 months ago
Backout by dluca@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/4248cea4f9a1
Backed out changeset d602a2f69ff8 on request from truber. a=backout
Assignee

Updated

11 months ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee

Updated

11 months ago
Depends on: 1483907
See Also: 1483907
Assignee

Comment 15

10 months ago
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.
Assignee

Updated

10 months ago
Keywords: checkin-needed

Comment 16

10 months ago
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

Comment 17

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b073a55c2be7
Status: REOPENED → RESOLVED
Closed: 11 months ago10 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.