Crashing on iOS and Android after usage over 1000 times #739

Open
opened 2026-01-29 14:44:25 +00:00 by claunia · 0 comments
Owner

Originally created by @taublast on GitHub (May 25, 2025).

EDIT: in context of the final repro:

I have a net9.0-android net9.0-ios MAUI app that uses Markding for chat list bubbles labels. This works fine until cells call Parse method over 1000 times when scrolling recycled cells.

Removing those lines from Markdig fork made crashes to disappear while being able to call Parse when Markdig project is referenced in solution and compiled for Debug:

#if NET5_0_OR_GREATER
[module: System.Runtime.CompilerServices.SkipLocalsInit]
#endif

This fixed crashing when Markdig fork is refereced as project. When it's compiled for Release crashes come back again.

Those native crashes obviously can't be catched in debugger becaus they happen inside .NET optimized binaries.

Crashes:

Android:

05-24 21:08:12.399 19548 19548 D ViewRootImpl@332085e[MainActivity]: ViewPostIme pointer 1
05-24 21:08:12.419 19628 19628 E crash_dump64: unknown process state: t
05-24 21:08:12.452 19628 19628 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
05-24 21:08:12.453  1142  1142 I /system/bin/tombstoned: received crash request for pid 19584
05-24 21:08:12.454 19628 19628 I crash_dump64: performing dump of process 19548 (target tid = 19584)
05-24 21:08:12.463 19628 19628 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-24 21:08:12.463 19628 19628 F DEBUG   : Build fingerprint: 'samsung/beyond2qltesq/beyond2q:10/QP1A.190711.020/G975USQS4DTG1:user/release-keys'
05-24 21:08:12.463 19628 19628 F DEBUG   : Revision: '17'
05-24 21:08:12.463 19628 19628 F DEBUG   : ABI: 'arm64'
05-24 21:08:12.463 19628 19628 F DEBUG   : Timestamp: 2025-05-24 21:08:12+0300
05-24 21:08:12.463 19628 19628 F DEBUG   : pid: 19548, tid: 19584, name: GLThread 6  >>> com.appomobi.app.dev <<<
05-24 21:08:12.463 19628 19628 F DEBUG   : uid: 10303
05-24 21:08:12.463 19628 19628 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
05-24 21:08:12.463 19628 19628 F DEBUG   : Cause: null pointer dereference
05-24 21:08:12.463 19628 19628 F DEBUG   :     x0  0000000000000207  x1  00000000000000d8  x2  0000000b0000001b  x3  000000010000001d
05-24 21:08:12.463 19628 19628 F DEBUG   :     x4  00000073a7d89bf0  x5  0000000000000004  x6  00000074c1a7b000  x7  00000000003adc3a
05-24 21:08:12.463 19628 19628 F DEBUG   :     x8  0000000000000000  x9  0000000000000000  x10 0000000000000000  x11 0000007428f437c2
05-24 21:08:12.463 19628 19628 F DEBUG   :     x12 0000007428f40a1e  x13 0000000000000048  x14 0000000000000000  x15 0000000000000000
05-24 21:08:12.463 19628 19628 F DEBUG   :     x16 00000074291ccd28  x17 00000074bbeca440  x18 00000073baa68000  x19 00000073bae4fa30
05-24 21:08:12.464 19628 19628 F DEBUG   :     x20 0000007428f41784  x21 00000000000000d8  x22 0000000000000001  x23 0000000000000000
05-24 21:08:12.464 19628 19628 F DEBUG   :     x24 0000000000000000  x25 0000000000000028  x26 000000000000001d  x27 00000073c3bfbf28
05-24 21:08:12.464 19628 19628 F DEBUG   :     x28 0000000000000028  x29 00000073bae4f970
05-24 21:08:12.464 19628 19628 F DEBUG   :     sp  00000073bae4f940  lr  00000074290a5454  pc  00000074290a41f8
05-24 21:08:12.464 19628 19628 F DEBUG   :
05-24 21:08:12.464 19628 19628 F DEBUG   : backtrace:
05-24 21:08:12.464 19628 19628 F DEBUG   :       #00 pc 00000000001ca1f8  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.464 19628 19628 F DEBUG   :       #01 pc 00000000001b4ae4  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.464 19628 19628 F DEBUG   :       #02 pc 00000000001b44fc  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.464 19628 19628 F DEBUG   :       #03 pc 00000000001cddbc  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.464 19628 19628 F DEBUG   :       #04 pc 00000000001cdbf0  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.464 19628 19628 F DEBUG   :       #05 pc 00000000001a5cdc  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.464 19628 19628 F DEBUG   :       #06 pc 000000000019aafc  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.465 19628 19628 F DEBUG   :       #07 pc 0000000000258674  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (mono_runtime_invoke_checked+140) (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.465 19628 19628 F DEBUG   :       #08 pc 000000000026f2a0  /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a)
05-24 21:08:12.465 19628 19628 F DEBUG   :       #09 pc 00000000000e6f10  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: b0750023d0cf44584c064da02400c159)
05-24 21:08:12.465 19628 19628 F DEBUG   :       #10 pc 00000000000850c8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: b0750023d0cf44584c064da02400c159)

iOS :

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Codes: 0x0000000000000001, 0x0000000000000008
VM Region Info: 0x8 is not in any region.  Bytes before following region: 68719476728
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      commpage (reserved)     1000000000-7000000000 [384.0G] ---/--- SM=NUL  ...(unallocated)
Triggered by Thread:  0

Thread 0 name:  tid_103 Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   AppoMobi.Mobile               	       0x10033a228 interp_optimize_code + 8368
1   AppoMobi.Mobile               	       0x10032090c generate + 1148
2   AppoMobi.Mobile               	       0x1003202e8 mono_interp_transform_method + 948
3   AppoMobi.Mobile               	       0x10033e008 tier_up_method + 616
4   AppoMobi.Mobile               	       0x10033dd7c mono_interp_tier_up_frame_enter + 44
5   AppoMobi.Mobile               	       0x100310b38 mono_interp_exec_method + 45804
6   AppoMobi.Mobile               	       0x100303618 interp_entry_from_trampoline + 656
7   AppoMobi.Mobile               	       0x1000b9970 native_to_interp_trampoline + 112
8   AppoMobi.Mobile               	       0x100381638 -[SKMetalViewRetained drawInMTKView:] + 104
9   MetalKit                      	       0x1fb36e2c8 -[MTKView draw] + 155
10  QuartzCore                    	       0x19bc0c034 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 407
11  QuartzCore                    	       0x19bc1c9f0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 455
12  QuartzCore                    	       0x19bc49dc0 CA::Transaction::commit() + 643
13  QuartzCore                    	       0x19bc17950 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 1523
14  QuartzCore                    	       0x19bc26e38 display_timer_callback(__CFMachPort*, void*, long, void*) + 367
15  CoreFoundation                	       0x19a7c8de4 __CFMachPortPerform + 171
16  CoreFoundation                	       0x19a7e3fa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 55
17  CoreFoundation                	       0x19a7e5bb4 __CFRunLoopDoSource1 + 511
18  CoreFoundation                	       0x19a7c9744 __CFRunLoopRun + 2331
19  CoreFoundation                	       0x19a7cdd20 CFRunLoopRunSpecific + 583
20  GraphicsServices              	       0x1d289d998 GSEventRunModal + 159
21  UIKitCore                     	       0x19ca6034c -[UIApplication _run] + 867
22  UIKitCore                     	       0x19ca5ffc4 UIApplicationMain + 311
23  AppoMobi.Mobile               	       0x1000d05a4 xamarin_UIApplicationMain + 60
24  AppoMobi.Mobile               	       0x100314714 do_icall + 316
25  AppoMobi.Mobile               	       0x100312ce8 do_icall_wrapper + 348
26  AppoMobi.Mobile               	       0x100306260 mono_interp_exec_method + 2580
27  AppoMobi.Mobile               	       0x100303e1c interp_runtime_invoke + 236
28  AppoMobi.Mobile               	       0x1002d26f4 mono_jit_runtime_invoke + 1244
29  AppoMobi.Mobile               	       0x10027a500 mono_runtime_invoke_checked + 148
30  AppoMobi.Mobile               	       0x100280404 mono_runtime_exec_main_checked + 116
31  AppoMobi.Mobile               	       0x1002d9110 mono_jit_exec + 356
32  AppoMobi.Mobile               	       0x100101bf4 xamarin_main + 2028
33  AppoMobi.Mobile               	       0x100345450 main + 64
34  dyld                          	       0x1b7f8c344 start + 1859

Thank you for this awesome lib, using it for https://github.com/taublast/DrawnUi

Originally created by @taublast on GitHub (May 25, 2025). EDIT: in context of the final repro: I have a net9.0-android net9.0-ios MAUI app that uses Markding for chat list bubbles labels. This works fine until cells call `Parse` method over 1000 times when scrolling recycled cells. Removing those lines from Markdig fork made crashes to disappear while being able to call `Parse` when Markdig project is referenced in solution and compiled for Debug: ```csharp #if NET5_0_OR_GREATER [module: System.Runtime.CompilerServices.SkipLocalsInit] #endif ``` This fixed crashing when Markdig fork is refereced as project. When it's compiled for Release crashes come back again. Those native crashes obviously can't be catched in debugger becaus they happen inside .NET optimized binaries. Crashes: Android: ``` 05-24 21:08:12.399 19548 19548 D ViewRootImpl@332085e[MainActivity]: ViewPostIme pointer 1 05-24 21:08:12.419 19628 19628 E crash_dump64: unknown process state: t 05-24 21:08:12.452 19628 19628 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone 05-24 21:08:12.453 1142 1142 I /system/bin/tombstoned: received crash request for pid 19584 05-24 21:08:12.454 19628 19628 I crash_dump64: performing dump of process 19548 (target tid = 19584) 05-24 21:08:12.463 19628 19628 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 05-24 21:08:12.463 19628 19628 F DEBUG : Build fingerprint: 'samsung/beyond2qltesq/beyond2q:10/QP1A.190711.020/G975USQS4DTG1:user/release-keys' 05-24 21:08:12.463 19628 19628 F DEBUG : Revision: '17' 05-24 21:08:12.463 19628 19628 F DEBUG : ABI: 'arm64' 05-24 21:08:12.463 19628 19628 F DEBUG : Timestamp: 2025-05-24 21:08:12+0300 05-24 21:08:12.463 19628 19628 F DEBUG : pid: 19548, tid: 19584, name: GLThread 6 >>> com.appomobi.app.dev <<< 05-24 21:08:12.463 19628 19628 F DEBUG : uid: 10303 05-24 21:08:12.463 19628 19628 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 05-24 21:08:12.463 19628 19628 F DEBUG : Cause: null pointer dereference 05-24 21:08:12.463 19628 19628 F DEBUG : x0 0000000000000207 x1 00000000000000d8 x2 0000000b0000001b x3 000000010000001d 05-24 21:08:12.463 19628 19628 F DEBUG : x4 00000073a7d89bf0 x5 0000000000000004 x6 00000074c1a7b000 x7 00000000003adc3a 05-24 21:08:12.463 19628 19628 F DEBUG : x8 0000000000000000 x9 0000000000000000 x10 0000000000000000 x11 0000007428f437c2 05-24 21:08:12.463 19628 19628 F DEBUG : x12 0000007428f40a1e x13 0000000000000048 x14 0000000000000000 x15 0000000000000000 05-24 21:08:12.463 19628 19628 F DEBUG : x16 00000074291ccd28 x17 00000074bbeca440 x18 00000073baa68000 x19 00000073bae4fa30 05-24 21:08:12.464 19628 19628 F DEBUG : x20 0000007428f41784 x21 00000000000000d8 x22 0000000000000001 x23 0000000000000000 05-24 21:08:12.464 19628 19628 F DEBUG : x24 0000000000000000 x25 0000000000000028 x26 000000000000001d x27 00000073c3bfbf28 05-24 21:08:12.464 19628 19628 F DEBUG : x28 0000000000000028 x29 00000073bae4f970 05-24 21:08:12.464 19628 19628 F DEBUG : sp 00000073bae4f940 lr 00000074290a5454 pc 00000074290a41f8 05-24 21:08:12.464 19628 19628 F DEBUG : 05-24 21:08:12.464 19628 19628 F DEBUG : backtrace: 05-24 21:08:12.464 19628 19628 F DEBUG : #00 pc 00000000001ca1f8 /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.464 19628 19628 F DEBUG : #01 pc 00000000001b4ae4 /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.464 19628 19628 F DEBUG : #02 pc 00000000001b44fc /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.464 19628 19628 F DEBUG : #03 pc 00000000001cddbc /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.464 19628 19628 F DEBUG : #04 pc 00000000001cdbf0 /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.464 19628 19628 F DEBUG : #05 pc 00000000001a5cdc /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.464 19628 19628 F DEBUG : #06 pc 000000000019aafc /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.465 19628 19628 F DEBUG : #07 pc 0000000000258674 /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (mono_runtime_invoke_checked+140) (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.465 19628 19628 F DEBUG : #08 pc 000000000026f2a0 /data/app/com.appomobi.app.dev-1cCxhzd6k8gLUYOw8Ea3Hg==/lib/arm64/libmonosgen-2.0.so (BuildId: 1be7c7c5272957bf2e9a5560cbbed0b969688e5a) 05-24 21:08:12.465 19628 19628 F DEBUG : #09 pc 00000000000e6f10 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: b0750023d0cf44584c064da02400c159) 05-24 21:08:12.465 19628 19628 F DEBUG : #10 pc 00000000000850c8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: b0750023d0cf44584c064da02400c159) ``` iOS : ``` Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008 Exception Codes: 0x0000000000000001, 0x0000000000000008 VM Region Info: 0x8 is not in any region. Bytes before following region: 68719476728 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> commpage (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated) Triggered by Thread: 0 Thread 0 name: tid_103 Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 AppoMobi.Mobile 0x10033a228 interp_optimize_code + 8368 1 AppoMobi.Mobile 0x10032090c generate + 1148 2 AppoMobi.Mobile 0x1003202e8 mono_interp_transform_method + 948 3 AppoMobi.Mobile 0x10033e008 tier_up_method + 616 4 AppoMobi.Mobile 0x10033dd7c mono_interp_tier_up_frame_enter + 44 5 AppoMobi.Mobile 0x100310b38 mono_interp_exec_method + 45804 6 AppoMobi.Mobile 0x100303618 interp_entry_from_trampoline + 656 7 AppoMobi.Mobile 0x1000b9970 native_to_interp_trampoline + 112 8 AppoMobi.Mobile 0x100381638 -[SKMetalViewRetained drawInMTKView:] + 104 9 MetalKit 0x1fb36e2c8 -[MTKView draw] + 155 10 QuartzCore 0x19bc0c034 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 407 11 QuartzCore 0x19bc1c9f0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 455 12 QuartzCore 0x19bc49dc0 CA::Transaction::commit() + 643 13 QuartzCore 0x19bc17950 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 1523 14 QuartzCore 0x19bc26e38 display_timer_callback(__CFMachPort*, void*, long, void*) + 367 15 CoreFoundation 0x19a7c8de4 __CFMachPortPerform + 171 16 CoreFoundation 0x19a7e3fa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 55 17 CoreFoundation 0x19a7e5bb4 __CFRunLoopDoSource1 + 511 18 CoreFoundation 0x19a7c9744 __CFRunLoopRun + 2331 19 CoreFoundation 0x19a7cdd20 CFRunLoopRunSpecific + 583 20 GraphicsServices 0x1d289d998 GSEventRunModal + 159 21 UIKitCore 0x19ca6034c -[UIApplication _run] + 867 22 UIKitCore 0x19ca5ffc4 UIApplicationMain + 311 23 AppoMobi.Mobile 0x1000d05a4 xamarin_UIApplicationMain + 60 24 AppoMobi.Mobile 0x100314714 do_icall + 316 25 AppoMobi.Mobile 0x100312ce8 do_icall_wrapper + 348 26 AppoMobi.Mobile 0x100306260 mono_interp_exec_method + 2580 27 AppoMobi.Mobile 0x100303e1c interp_runtime_invoke + 236 28 AppoMobi.Mobile 0x1002d26f4 mono_jit_runtime_invoke + 1244 29 AppoMobi.Mobile 0x10027a500 mono_runtime_invoke_checked + 148 30 AppoMobi.Mobile 0x100280404 mono_runtime_exec_main_checked + 116 31 AppoMobi.Mobile 0x1002d9110 mono_jit_exec + 356 32 AppoMobi.Mobile 0x100101bf4 xamarin_main + 2028 33 AppoMobi.Mobile 0x100345450 main + 64 34 dyld 0x1b7f8c344 start + 1859 ``` Thank you for this awesome lib, using it for https://github.com/taublast/DrawnUi
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#739