Re: GC problem on Android
Ivan Maidanski <ivmai@...
2013-04-03 09:16:03 GMT
Tue, 2 Apr 2013, 14:28 +02:00 from Manuel.Serrano <at> inria.fr:
It took me couple of days before sending the patch of my previous mail
because I was actually busy struggling with another problem I had on
Android. I came to the conclusion that there is an error somewhere in
the collector implementation that makes applications break on Android.
The problem is not easy to reproduce. Actually I only see it on an
actual Nexus4 device running Android 4.2.2. All the other platforms I
have tested (Google Emulator/Android 4.2.2, Nexus 7/Android 4.2.2, Asus
transformer/Android 4.2.1, Samsung GS3/Android 4.1.2, HTC desired
HD/Android 2.3.5, Samsung GalaxyTab'7/2.3.4) work like a charm. The most
confusing thing is that the Nexus 7 works but not the Nexus 4. Apart
the Linux kernel (3.4.x on the Nexus 4, 3.0.x on the Nexus 7), the two
platforms are almost identical (quad-core ARM9, same Android version).
Which test case to fail? What are the gcc options specified?
I have Galaxy S3 (4.1), Nexus i9250 (4.1), Nexus 10 Tab (4.2), and Nexus 7 (4.2.2) available for testing.
I've just run gctest on Nexus 7 (from master branch):
C:\android-ndk\toolchains\arm-linux-androideabi-4.7\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe -fno-short-enums -I c:/android-ndk/platforms/android-9/arch-arm/usr/include -nostdlib -lc -Wl,-rpath-link=c:/android-ndk/platforms/android-9/arch-arm/usr/lib,-dynamic-linker=/system/bin/linker,--gc-sections,-z,nocopyreloc -L c:/android-ndk/platforms/android-9/arch-arm/usr/lib c:/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_static.o c:/android-ndk/platforms/android-9/arch-arm/usr/lib/crtend_android.o -O2 -fno-strict-aliasing -I include -I libatomic_ops/src -DGC_THREADS -DNO_EXECUTE_PERMISSION -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -DGC_GCJ_SUPPORT -DNO_DEBUGGING -DUSE_MMAP -DUSE_MUNMAP -DALL_INTERIOR_POINTERS -DJAVA_FINALIZATION -DATOMIC_UNCOLLECTABLE -DIGNORE_DYNAMIC_LOADING -mcpu=cortex-a9 -DDONT_USE_ATEXIT -DGC_NOT_DLL -s tests/test.c extra/gc.c -lgcc -ldl
Completed 6 tests
Allocated 10981406 collectable objects
Allocated 1218 uncollectable objects
Allocated 7085658 atomic objects
Allocated 136648 stubborn objects
Finalized 13519/13519 objects - finalization is probably ok
Total number of bytes allocated is 590082877
Final heap size is 671744 bytes
Completed 252 collections (using 4 marker threads)
Collector appears to work
The problem is not easy to debug mostly because I'm not able to use gdb
The symptom is as follows: when I compile my application enabling
multithreading _and_ when I don't compile with -DTHREAD_LOCAL_ALLOC,
then the application crashes, even before the first collection takes
place. If I disable multithreading support or if I compile with
-DTHREAD_LOCAL_ALLOC, then it runs smoothly and all the tests succeed.
I have tested three versions of collector (7.2d, 7.3alpha1, and
7.3alpha3). They all behave similarly.
Since I have found a configuration where everything is fine, this
problem is not crucial for me. However, I'm worried by the symptom and I
will sleep better if we could find and fix that bug. I would be pleased
to help. Just tell me what to do.
Gc mailing list