Skip to content

Frequent Crashes After Migrating App from Xamarin to .NET – Crash in libmonosgen #118229

@SejalH96

Description

@SejalH96

Description

After migrating our Android application from Xamarin to .NET 9 (SDK-style project), the app is frequently crashing at runtime. These crashes did not occur in the Xamarin version of the application.

The crash log consistently points to libmonosgen. Based on our observations, the issue is most likely linked to socket communication (continuous data transfer).

StackTrace:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Nokia/Phoenix_00WW/PNX_sprout:11/RKQ1.200906.002/00WW_6_21F:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2025-07-29 17:02:12+0530
pid: 27186, tid: 27295, name: .NET TP Worker  >>> com.matrix.satatyamv <<<
uid: 12401
signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0
    x0  0000006db4729128  x1  0000000000000089  x2  0000000000000002  x3  0000000000000000
    x4  0000000000000000  x5  00000000ffffffff  x6  00000000ffffffff  x7  0000006db46c7118
    x8  0000000000000062  x9  0000000000000089  x10 0000000000000009  x11 0000000000000002
    x12 0000006f9dd0d620  x13 0000000000019020  x14 0000000000000000  x15 0000006f9dc98378
    x16 0000007110496d18  x17 0000007110423bb0  x18 0000006d8c212000  x19 0000000000000002
    x20 0000000000000000  x21 0000006db4729128  x22 0000000000000089  x23 0000006d8cdf3fb8
    x24 0000006d8cdf4000  x25 000000000000000b  x26 0000000000019000  x27 0000006d8bafc000
    x28 0000006d8cdf4000  x29 0000006d8cbf4550
    lr  000000711042786c  sp  0000006d8cbf4530  pc  0000007110423bcc  pst 0000000040000000

backtrace:
      #00 pc 000000000004abcc  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) (BuildId: a6129197241eb9f68acb05fe7e48a951)
      #01 pc 000000000004e868  /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+144) (BuildId: a6129197241eb9f68acb05fe7e48a951)
      #02 pc 00000000000b5d84  /apex/com.android.runtime/lib64/bionic/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+216) (BuildId: a6129197241eb9f68acb05fe7e48a951)
      #03 pc 00000000002af124  /data/app/~~mKwtPYp6ishWhqqUe85k9w==/com.matrix.satatyamv-ddlwwWPgxKsO6weNgfDhEQ==/lib/arm64/libmonosgen-2.0.so (BuildId: f4843daf60ba28a3199f1b521e660a49e5c2959a)
      #04 pc 000000000029d710  /data/app/~~mKwtPYp6ishWhqqUe85k9w==/com.matrix.satatyamv-ddlwwWPgxKsO6weNgfDhEQ==/lib/arm64/libmonosgen-2.0.so (BuildId: f4843daf60ba28a3199f1b521e660a49e5c2959a)
      #05 pc 0000000000007328  <anonymous:6e15635000>

Reproduction Steps

=> Continuous data transfer using socket communication

Expected behavior

The application should handle socket communication stably without runtime crashes.

Actual behavior

The application frequently crashes with a fatal signal, pointing to libmonosgen.

Regression?

No response

Known Workarounds

No response

Configuration

.Net version: 9.0.4
Platform: Android

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions