MobiVM / robovm

Ahead of time compiler for JVM bytecode targetting iOS, Mac OSX and Linux
https://mobivm.github.io
957 stars 132 forks source link

Missing frames in symbolicated crash #522

Open bhPerblue opened 4 years ago

bhPerblue commented 4 years ago

Issue details

Symbolicated native crashes have several frames that are still offsets after symbolication.

Reproduction steps/code

clone https://github.com/bhPerblue/GDXSybolicationBug run with ./gradlew launchIOSDevice wait for crash extract crash with xcode symbolicate using the dsym found in ios/build/robovm.tmp/IOSLauncher.app.dSYM

Configuration

iPhone SE running version 14

Build Tools:

Versions:

Please provide the version of RoboVM, XCode and JDK used

Build Targets:

iPhone SE running version 14


Stacktrace

Thread 367:
0   libsystem_kernel.dylib          0x00000001b8e737ac __psynch_mutexwait + 8
1   libsystem_pthread.dylib         0x00000001d44a02f4 _pthread_mutex_firstfit_lock_wait + 92
2   libsystem_pthread.dylib         0x00000001d44a0244 _pthread_mutex_firstfit_lock_slow + 216
3   IOSLauncher                     0x000000010569a690 catch_exception_raise + 155868
4   IOSLauncher                     0x000000010567ef10 catch_exception_raise + 43356
5   IOSLauncher                     0x00000001056749b0 catch_exception_raise + 1020
6   IOSLauncher                     0x0000000105674be0 catch_exception_raise + 1580
7   IOSLauncher                     0x00000001056729f0 0x104a78000 + 12560880
8   IOSLauncher                     0x0000000104cd8e50 0x104a78000 + 2494032
9   IOSLauncher                     0x0000000104f8cdd8 [J]com.mygdx.game.MyGdxGame$1.run()V + 5328344 (MyGdxGame$1.java:39)
10  IOSLauncher                     0x0000000104ff9044 [J]java.lang.Thread.run()V + 5771332 (Thread.java:839)
11  IOSLauncher                     0x000000010568bafc catch_exception_raise + 95560
12  IOSLauncher                     0x0000000105681c64 catch_exception_raise + 54960
13  IOSLauncher                     0x0000000105681888 catch_exception_raise + 53972
14  IOSLauncher                     0x000000010568b008 catch_exception_raise + 92756
15  IOSLauncher                     0x00000001056a4a60 catch_exception_raise + 197804
16  IOSLauncher                     0x00000001056a1a1c catch_exception_raise + 185448
17  IOSLauncher                     0x00000001056a5fc0 catch_exception_raise + 203276
18  libsystem_pthread.dylib         0x00000001d449aca8 _pthread_start + 320
19  libsystem_pthread.dylib         0x00000001d44a3788 thread_start + 8
dkimitsa commented 4 years ago

proper repo link https://github.com/bhPerblue/GDXSybolicationBug

bhPerblue commented 4 years ago

Thanks for catching that! I've corrected the original ticket.

dkimitsa commented 4 years ago

all these missing frames are due missing debug information in native code. having enabling it will produce better traces like this:

Thread 380 Crashed:
0   libsystem_kernel.dylib          0x00000001c458883c __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001df7d09e8 pthread_kill + 212
2   libsystem_c.dylib               0x00000001a2675914 abort + 100
3   IOSLauncher                     0x0000000101cc4bb4 GC_suspend_thread_list + 25594804 (darwin_stop_world.c:492)
4   IOSLauncher                     0x0000000101cc4ce4 GC_stop_world + 25595108 (darwin_stop_world.c:567)
5   IOSLauncher                     0x0000000101cb2960 GC_stopped_mark + 25520480 (alloc.c:742)
6   IOSLauncher                     0x0000000101cb2868 GC_try_to_collect_inner + 25520232 (alloc.c:461)
7   IOSLauncher                     0x0000000101cb41e4 GC_collect_or_expand + 25526756 (alloc.c:1414)
8   IOSLauncher                     0x0000000101cb4520 GC_allocobj + 25527584 (alloc.c:1504)
9   IOSLauncher                     0x0000000101cb8d44 GC_generic_malloc_inner + 25546052 (malloc.c:132)
10  IOSLauncher                     0x0000000101cb8f28 GC_generic_malloc + 25546536 (malloc.c:181)
11  IOSLauncher                     0x0000000101c9dd40 rvmAllocateMemoryForArray + 25435456 (memory.c:1020)
12  IOSLauncher                     0x0000000101c937bc newArray + 25393084 (array.c:82)
13  IOSLauncher                     0x0000000101c939ec rvmNewObjectArray + 25393644 (array.c:165)
14  IOSLauncher                     0x0000000101c917c0 _bcNewObjectArray + 25384896 (bc.c:858)
15  IOSLauncher                     0x0000000100700e68 0x10045c000 + 2772584
16  IOSLauncher                     0x0000000100eb3dd0 0x10045c000 + 10845648
17  IOSLauncher                     0x0000000100eb3ecc [J]com.mygdx.game.MyGdxGame$1.run()V + 10845900 (MyGdxGame$1.java:37)
18  IOSLauncher                     0x0000000100fc8bb8 0x10045c000 + 11979704
19  IOSLauncher                     0x0000000100fcee38 [J]java.lang.Thread.run()V + 12004920 (Thread.java:837)
20  IOSLauncher                     0x0000000101caa904 0x10045c000 + 25487620
21  IOSLauncher                     0x0000000101ca0a64 callVoidMethod + 25447012 (method.c:625)
22  IOSLauncher                     0x0000000101ca0688 rvmCallVoidInstanceMethodA + 25446024 (method.c:0)
23  IOSLauncher                     0x0000000101ca9e10 startThreadEntryPoint + 25484816 (thread.c:540)
24  IOSLauncher                     0x0000000101cc2bbc GC_inner_start_routine + 25586620 (pthread_start.c:57)
25  IOSLauncher                     0x0000000101cbfd68 GC_call_with_stack_base + 25574760 (misc.c:1860)
26  IOSLauncher                     0x0000000101cc402c GC_start_routine + 25591852 (pthread_support.c:1674)
27  libsystem_pthread.dylib         0x00000001df7cfb70 _pthread_start + 288
28  libsystem_pthread.dylib         0x00000001df7d4880 thread_start + 8

Same time it will increase VM library size on disk from 26Mb to 88Mb (and this is only for iOS). It would not increase IPA size as all debug symbols are stripped after .dsym is generated update: if only line number debug information requested to be generated it tooks about 36 vs 26Mb on disk.