Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime crash with Hot Reload in libmono-component-debugger.so #105774

Closed
jeromelaban opened this issue Jul 18, 2024 · 3 comments · Fixed by #105781
Closed

Runtime crash with Hot Reload in libmono-component-debugger.so #105774

jeromelaban opened this issue Jul 18, 2024 · 3 comments · Fixed by #105781
Assignees
Labels
area-Debugger-mono in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@jeromelaban
Copy link
Contributor

jeromelaban commented Jul 18, 2024

Android framework version

net8.0-android, net9.0-android

Affected platform version

net 8.0.303, net9.0 p6

Description

Modifying a class in a very specific way will crash the app, with traces like this:

tablet_m-dpi_10_1in_-_api_34_1	Error	22416	DEBUG	backtrace:
#00 pc 0000000000029468  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
dotnet/android#1 pc 0000000000028f45  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
dotnet/android#2 pc 000000000003137c  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
dotnet/android#3 pc 000000000001b772  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
dotnet/android#4 pc 0000000000022c3f  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
dotnet/android#5 pc 00000000000254ce  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
dotnet/android#6 pc 00000000002c0bab  /data/app/~~YxzEw8uRs6euAg36gYGjcA==/com.companyname.mauiapp2-D7Yx-o9RLqpNV8ZSuFDlBA==/lib/x86_64/libmonosgen-2.0.so (BuildId: 529a184b6995fdc8e342e42c6d58e3b8ba06442f)
dotnet/android#7 pc 00000000000cd06a  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+58) (BuildId: fa337969c798946280caa45e2d71a2e7)
dotnet/android#8 pc 0000000000062d88  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+56) (BuildId: fa337969c798946280caa45e2d71a2e7)

(Stack with net9 pre 6)

Steps to Reproduce

  1. Open this repro in VS 2022: 9120-MauiApp2.zip

  2. Open HRFAILURE.cs

  3. Build and debug the app with the #if true

  4. Once the app is started, change the #if to false

  5. Press the apply code changes button

Did you find any workaround?

Reducing the number of SuppressMessage kind of helps, but it feels like a memory corruption of some kind.

Relevant log output

No response

@grendello
Copy link
Contributor

@jeromelaban it's most likely an issue in MonoVM, not .NET For Android. However, would you mind recording a logcat just to be sure? Please follow these steps from VS Developer Prompt:

> adb logcat -G 65M
> adb shell setprop debug.mono.log default,assembly,mono_log_level=debug,mono_log_mask=all
> adb logcat -c
rem Deploy, start and crash the app then wait 10 seconds and:
> adb logcat -d > logcat.txt

And attach the resulting file, thanks!

@jeromelaban
Copy link
Contributor Author

jeromelaban commented Jul 19, 2024

@grendello Indeed, it's likely a fix to be made in dotnet/runtime, but as it reproduces on android/ios, I took a chance :)

Here's the logcat: 9120-logcat.zip

Likely relevant details

07-19 08:35:13.229 30742 30784 I Mono    : >>> EnC delta for base=/data/data/com.companyname.mauiapp2/files/.__override__/MauiApp2.dll (generation 1) applied
--------- beginning of crash
07-19 08:35:13.261 30742 30784 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 30784 (Debugger agent), pid 30742 (nyname.mauiapp2)
07-19 08:35:13.317 30888 30888 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
07-19 08:35:13.324   209   209 I tombstoned: received crash request for pid 30784
07-19 08:35:13.332 30888 30888 I crash_dump64: performing dump of process 30742 (target tid = 30784)
07-19 08:35:14.447     0     0 I logd    : logdr: UID=10195 GID=10195 PID=30888 n tail=500 logMask=8 pid=30742 start=0ns deadline=0ns
07-19 08:35:14.449     0     0 I logd    : logdr: UID=10195 GID=10195 PID=30888 n tail=500 logMask=1 pid=30742 start=0ns deadline=0ns
07-19 08:35:14.466 30888 30888 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-19 08:35:14.466 30888 30888 F DEBUG   : Build fingerprint: 'google/sdk_gphone64_x86_64/emu64xa:14/UE1A.230829.036.A2/11596452:userdebug/dev-keys'
07-19 08:35:14.466 30888 30888 F DEBUG   : Revision: '0'
07-19 08:35:14.467 30888 30888 F DEBUG   : ABI: 'x86_64'
07-19 08:35:14.467 30888 30888 F DEBUG   : Timestamp: 2024-07-19 08:35:13.339976000-0400
07-19 08:35:14.467 30888 30888 F DEBUG   : Process uptime: 30s
07-19 08:35:14.467 30888 30888 F DEBUG   : Cmdline: com.companyname.mauiapp2
07-19 08:35:14.467 30888 30888 F DEBUG   : pid: 30742, tid: 30784, name: Debugger agent  >>> com.companyname.mauiapp2 <<<
07-19 08:35:14.471 30888 30888 F DEBUG   : uid: 10195
07-19 08:35:14.472 30888 30888 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000008
07-19 08:35:14.474 30888 30888 F DEBUG   : Cause: null pointer dereference
07-19 08:35:14.475 30888 30888 F DEBUG   :     rax 0000000000000000  rbx 00007aed02e6b4f0  rcx 0000000000000000  rdx 00007aeac25fb700
07-19 08:35:14.476 30888 30888 F DEBUG   :     r8  0000000000000000  r9  0000000000000000  r10 0000000000000000  r11 0000000000000000
07-19 08:35:14.479 30888 30888 F DEBUG   :     r12 00007aecb3bb5c60  r13 00007aecb3bb58a0  r14 0000000000000001  r15 00007aecd2e76900
07-19 08:35:14.482 30888 30888 F DEBUG   :     rdi 0000000000000000  rsi 00007aeb72e62e40
07-19 08:35:14.483 30888 30888 F DEBUG   :     rbp 00007aec63390130  rsp 00007aeac25fb700  rip 00007aeacba76468
07-19 08:35:14.487 30888 30888 F DEBUG   : 9 total frames
07-19 08:35:14.490 30888 30888 F DEBUG   : backtrace:
07-19 08:35:14.493 30888 30888 F DEBUG   :       #00 pc 0000000000029468  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
07-19 08:35:14.494 30888 30888 F DEBUG   :       dotnet/android#1 pc 0000000000028f45  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
07-19 08:35:14.494 30888 30888 F DEBUG   :       dotnet/android#2 pc 000000000003137c  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
07-19 08:35:14.494 30888 30888 F DEBUG   :       dotnet/android#3 pc 000000000001b772  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
07-19 08:35:14.494 30888 30888 F DEBUG   :       dotnet/android#4 pc 0000000000022c3f  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
07-19 08:35:14.494 30888 30888 F DEBUG   :       dotnet/android#5 pc 00000000000254ce  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmono-component-debugger.so (BuildId: 06dc7ca04b7e0642407ee3ce3a695a334ee43e6a)
07-19 08:35:14.494 30888 30888 F DEBUG   :       dotnet/android#6 pc 00000000002c0bab  /data/app/~~JNsXHdWKSeB6StQzZkOeaQ==/com.companyname.mauiapp2-z26_qod_Lmz0MNbeSJnWVw==/lib/x86_64/libmonosgen-2.0.so (BuildId: 529a184b6995fdc8e342e42c6d58e3b8ba06442f)
07-19 08:35:14.495 30888 30888 F DEBUG   :       dotnet/android#7 pc 00000000000cd06a  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+58) (BuildId: fa337969c798946280caa45e2d71a2e7)
07-19 08:35:14.496 30888 30888 F DEBUG   :       dotnet/android#8 pc 0000000000062d88  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+56) (BuildId: fa337969c798946280caa45e2d71a2e7)

@jonathanpeppers jonathanpeppers transferred this issue from dotnet/android Jul 31, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 31, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 31, 2024
Copy link
Contributor

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

@thaystg thaystg added this to the 9.0.0 milestone Jul 31, 2024
@thaystg thaystg self-assigned this Jul 31, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Jul 31, 2024
@thaystg thaystg removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 31, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Jul 31, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Debugger-mono in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants