Skip to content

Conversation

@mikem8361
Copy link
Contributor

Issue: #78956

After a core dump is generated because of a unhandled managed exception abort() is called but a SIGSEGV is generated in libpthread.so which is caught by the runtime and a second core dump is generated. The fix is to uninstall/uninitialize all the signal handlers, not just SIGABORT.

Issue: dotnet#78956

After a core dump is generated because of a unhandled managed exception
abort() is called but a SIGSEGV is generated in libpthread.so which is
caught by the runtime and a second core dump is generated. The fix is
to uninstall/uninitialize all the signal handlers, not just SIGABORT.
@mikem8361 mikem8361 requested a review from hoyosjs January 11, 2023 00:36
@mikem8361 mikem8361 self-assigned this Jan 11, 2023
@ghost ghost added the area-PAL-coreclr label Jan 11, 2023
@hoyosjs
Copy link
Member

hoyosjs commented Jan 11, 2023

cc: @janvorli

@janvorli
Copy link
Member

@mikem8361 do you have any details on why the SIGSEGV might be happening at all? Nevertheless, this change is good.

@hoyosjs
Copy link
Member

hoyosjs commented Jan 11, 2023

We've only been able to repro in AKS, and we didn't have a set of symbols available.

@mikem8361
Copy link
Contributor Author

Here is the stack trace from the second dump where abort() calls libpthread_2_31!funlockfile() which generates a SIGSEGV/generates this dump. Not sure that helps much.

00007f70`97a7b470 00007f70`988d58b3     libc_2_31!wait4+0x57
00007f70`97a7b4a0 00007f70`988d631f     libcoreclr!PROCCreateCrashDump+0x223 [/__w/1/s\src/coreclr/pal/src/thread/process.cpp @ 2465]
00007f70`97a7b500 00007f70`9889e0b0     libcoreclr!PROCCreateCrashDumpIfEnabled+0x2ff [/__w/1/s\src/coreclr/pal/src/thread/process.cpp @ 2654]
00007f70`97a7b580 00007f70`98f8d140     libcoreclr!sigsegv_handler+0x260 [/__w/1/s\src/coreclr/pal/src/exception/signal.cpp @ 15732480]
00007f70`97a7bac0 00007f70`98a96602     libpthread_2_31!funlockfile+0x50
00007fff`b5fcc330 00007f70`988d3b8b (T) libc_2_31!abort+0x1ee
00007fff`b5fcc460 00007f70`988d3ac0 (T) libcoreclr!PROCAbort+0x26 [/__w/1/s\src/coreclr/pal/src/thread/process.cpp @ 2684]
00007fff`b5fcc480 00007f70`986963e5     libcoreclr!PROCEndProcess+0xeb [/__w/1/s\src/coreclr/pal/src/thread/process.cpp @ 1342]
00007fff`b5fcc4b0 00007f70`986964c6     libcoreclr!UnwindManagedExceptionPass1+0x425 [/__w/1/s\src/coreclr/vm/exceptionhandling.cpp @ 4680]
00007fff`b5fccad0 00007f70`985e7cd9     libcoreclr!DispatchManagedException+0x86 [/__w/1/s\src/coreclr/vm/exceptionhandling.cpp @ 15732480]
00007fff`b5fccfd0 00007f70`19ff0b07     libcoreclr!IL_Throw+0x239 [/__w/1/s\src/coreclr/vm/jithelpers.cpp @ 15732480]
Unable to load image /app/CrashingApplication.dll, Win32 error 0n2
*** WARNING: Unable to verify checksum for CrashingApplication.dll
00007fff`b5fcd150 00007f70`9874b237     CrashingApplication!Program.<Main>$(System.String[])+0x77

@mikem8361
Copy link
Contributor Author

/backport to release/7.0

@github-actions
Copy link
Contributor

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3933111844

@ghost ghost locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants