mozalloc_abort: abort() on Android 2.3 low-memory device




Firefox for Android
Build Config & IDE Support
3 years ago
5 months ago


(Reporter: Roman Tsisyk, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



3 years ago
Created attachment 8610734 [details]

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0 Iceweasel/33.1
Build ID: 20141111034249
Firefox for Android

Steps to reproduce:

I try to run Fennec / GeckoViewExample on Android 2.3.7 ARMv6 device with 384Mb RAM. 

Fennec was compiled from hg trunk on 2015-05-26 with the following .mozconfig:
ac_add_options --target=arm-linux-androideabi
ac_add_options --with-arch=armv5te # I'm not sure that armv5te is correct, but I have SIGILL on arch=armv6

#mk_add_options MOZ_OBJDIR=./obj-i386-linux-androideabi/
#ac_add_options --target=i386-linux-android

ac_add_options --enable-jemalloc # doesn't affect behaviour

ac_add_options --with-android-min-sdk=9
ac_add_options --with-android-max-sdk=10
ac_add_options --enable-android-resource-constrained
ac_add_options --disable-android-include-fonts

Device information:
HTC Aria (Liberty), Android 2.3.3 (CM)

Processor       : ARMv6-compatible processor rev 5 (v6l)
BogoMIPS        : 245.61
Features        : swp half thumb fastmult vfp edsp java
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x1
CPU part        : 0xb36

MemTotal:         298028 kB

The produced apk works on 4.x device with more RAM.
May be this 2.3 device is unlucky, but I want to get working app for as much devices as possible.

I can try to debug Java / C++ code, just give me an idea where to start.

Actual results:

D/dalvikvm(  717): VFY: dead code 0x0008-000c in Lorg/mozilla/gecko/RestrictedProfiles;.getRestrictions (Landroid/content/Context;)Landroid/os/Bundle;         
E/GeckoCrashHandler(  717): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 17 ("Gecko")                                                                          
E/GeckoCrashHandler(  717): org.mozilla.gecko.mozglue.GeckoLoader$AbortException: abort() called from :0x4cd7f060 ()                                           
E/GeckoCrashHandler(  717):     at org.mozilla.gecko.mozglue.GeckoLoader.abort(                                                           
E/GeckoCrashHandler(  717):     at org.mozilla.gecko.mozglue.GeckoLoader.loadGeckoLibsNative(Native Method)                                                    
E/GeckoCrashHandler(  717):     at org.mozilla.gecko.mozglue.GeckoLoader.loadGeckoLibsNative(Native Method)                                                    
E/GeckoCrashHandler(  717):     at org.mozilla.gecko.mozglue.GeckoLoader.loadGeckoLibs(                                                   
E/GeckoCrashHandler(  717):     at org.mozilla.gecko.GeckoThread.initGeckoEnvironment(                                                    
E/GeckoCrashHandler(  717):     at   

See crash.log

Comment 1

3 years ago
APK is here (is to large to attach):   /2015-05-26/


3 years ago
OS: Unspecified → Android
Hardware: Unspecified → ARM


3 years ago
Component: Untriaged → General
Product: Firefox → Firefox for Android
ARMv6 is no longer a supported target for Firefox for Android as of Firefox 33.

However it might be possible to still use: ac_add_options --with-arch=armv6
Component: General → Build Config & IDE Support

Comment 3

3 years ago
Yes, I know that armv6 is no longer supported. I tried to use --with-arch=armv6, but I got SIGILL on startup. BTW, What's the difference between -march=armv6 and -march=armv5te in GCC? I see that Android NDK uses armv5te..

I can try to re-compile with armv6 and check again.
I also tried to enable/disable jemalloc, but this didn't help.

Is it OK that allocator calls abort() on out of memory?
It's very likely that parts of mozglue or libxul no longer work correctly on ARMv6; because it's not a supported target, we don't notice when we break things, and we don't really mind -- the point of declaring that we don't support an architecture is to avoid having to do the work of maintaining it.

If you're willing (as you mention) to do the digging and write and test a patch, I expect that we'd accept it if it's not invasive.

Start here: mozglue/android/APKOpen.cpp, loadGeckoLibsNative. You should be able to attach a debugger:

Comment 5

5 months ago
Android 2 is no longer supported.
Last Resolved: 5 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.