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

AV debugging a console app on OSX #5435

Closed
jeffschwMSFT opened this issue Mar 24, 2016 · 5 comments
Closed

AV debugging a console app on OSX #5435

jeffschwMSFT opened this issue Mar 24, 2016 · 5 comments

Comments

@jeffschwMSFT
Copy link
Member

Repo:
• Dotnet new (console app)
• Load in VS Code
• Set breakpoint on Console.WriteLine
• Start debugging
o Adjust launch.json

The crash is immediate before the break point is hit. I hit it 6 times in a row, and then it is hit and miss happening about 1 out of 4 times. I believe this is today’s dotnet-cli, so there is not a newer one.

Process: dotnet [1135]
Path: /usr/local/share/dotnet/dotnet
Identifier: dotnet
Version: 0
Code Type: X86-64 (Native)
Parent Process: clrdbg [1134]
Responsible: Electron [1058]
User ID: 501

Date/Time: 2016-03-24 08:40:51.490 -0700
OS Version: Mac OS X 10.11.3 (15D21)
Report Version: 11
Anonymous UUID: C338F9E8-014F-0911-4231-3B3EA16021B4

Sleep/Wake UUID: 5E4DE1D4-C3FC-4757-9165-216FE084E771

Time Awake Since Boot: 6600 seconds
Time Since Wake: 920 seconds

System Integrity Protection: enabled

Crashed Thread: 3

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT

Thread 3 Crashed:
0 libsystem_platform.dylib 0x00007fff8f1fdfbd platform_memmove$VARIANT$Haswell + 157
1 libcoreclr.dylib 0x000000010159836e DbgTransportSession::SendMessage(DbgTransportSession::Message
, bool) + 302
2 libcoreclr.dylib 0x000000010159a29f DbgTransportSession::TransportWorker() + 3967
3 libcoreclr.dylib 0x0000000101598109 DbgTransportSession::TransportWorkerStatic(void_) + 9
4 libcoreclr.dylib 0x000000010152f178 CorUnix::CPalThread::ThreadEntry(void*) + 328
5 libsystem_pthread.dylib 0x00007fff8a2e3c13 _pthread_body + 131
6 libsystem_pthread.dylib 0x00007fff8a2e3b90 _pthread_start + 168
7 libsystem_pthread.dylib 0x00007fff8a2e1375 thread_start + 13

@sergiy-k
Copy link
Contributor

cc @tzwlai Should this be fixed in RC2?

@gregg-miskelly
Copy link
Contributor

I am not sure if this will turn out to be useful or not, but I caught this race once with PAL process logging enabled for both debugger and target processes. This starts from the CreateProcess of the target.

{0xf1fdb-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80E001E00 (id 0) added to the process thread list
{0xf1fdb-0x101950550} TRACE [PROCESS] at getPath.4162: file /Users/greggm/clicon/run/clicon exists
{0xf1fdb-0x101950550} TRACE [PROCESS] at InternalCreateProcess.1016: New process created: id=0xabf1
{0xf1fdb-0x101e9c880} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80C005A00 (id 0xf1fdb) added to the process thread list
{0xf1fdb-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80B806000 (id 0) added to the process thread list
{0xf2032-0x101e9c880} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80B80E400 (id 0xf2032) added to the process thread list
=telemetry,event-name="VS/Diagnostics/Debugger/clrdbg/ProcessCreate",properties={VS.Diagnostics.Debugger.clrdbg.Version="14.0.25005.0 built by: LAUNCHCMDSUPPORT(GREGGM5-GREGGM)",VS.Diagnostics.Debugger.clrdbg.OSFamily="Darwin",VS.Diagnostics.Debugger.clrdbg.KernelRelease="14.5.0"}
{0xf1fdb-0x101e9c880} TRACE [PROCESS] at Register.1503: PAL_RuntimeStartupHelper.Register startup '/clrst0000abf10000000056f973d2' continue '/clrco0000abf10000000056f973d2'
{0xf1fdb-0x101e9c880} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80B80F000 (id 0) added to the process thread list
{0xf2033-0x101e9c880} TRACE [PROCESS] at StartupHelperThread.1675: PAL's StartupHelperThread starting
{0xf1fdb-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80D001A00 (id 0) added to the process thread list
{0xf2035-0x101e9c880} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80D002600 (id 0xf2035) added to the process thread list
^running
(gdb)
~"{0xf1ffd-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC07900B400 (id 0xf1ffd) added to the process thread list\n"
~"{0xf1ffd-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC07900C000 (id 0) added to the process thread list\n"
~"{0xf1ffd-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC07904F400 (id 0) added to the process thread list\n"
~"{0xf1ffd-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC079800000 (id 0) added to the process thread list\n"
~"{0xf1ffd-0x10d622b40} TRACE [PROCESS] at PAL_NotifyRuntimeStarted.1785: PAL_NotifyRuntimeStarted opening startup '/clrst0000abf10000000056f973d2' continue '/clrco0000abf10000000056f973d2'\n"
{0xf2033-0x101e9c880} TRACE [PROCESS] at InvokeStartupCallback.1602: InvokeStartupCallback executing callback /Users/greggm/clicon/run/libcoreclr.dylib
{0xf2033-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80E002A00 (id 0xf2033) added to the process thread list
{0xf2033-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80C004E00 (id 0xf2033) added to the process thread list
{0xf2033-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80E009000 (id 0) added to the process thread list
{0xf2033-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80D00C400 (id 0) added to the process thread list
{0xf2050-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80B80FC00 (id 0) added to the process thread list
{0xf2035-0x101950550} TRACE [PROCESS] at PROCRemoveThread.3046: Thread 00007FE80D001A00 removed from the process thread list
{0xf2033-0x101950550} TRACE [PROCESS] at PROCRemoveThread.3032: Thread 0x00007FE80C004E00 (id 0xf2033) removed from the process thread list
{0xf2035-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80B826000 (id 0xf2035) added to the process thread list
{0xf2035-0x101e9c880} TRACE [PROCESS] at PROCRemoveThread.3159: Thread 0x00007FE80D002600 (id 0xf2035) removed from the process thread list
{0xf2033-0x101e9c880} TRACE [PROCESS] at PROCRemoveThread.3159: Thread 0x00007FE80B80F000 (id 0xf2033) removed from the process thread list
{0xf2035-0x102d3c360} TRACE [PROCESS] at PROCRemoveThread.3159: Thread 0x00007FE80B826000 (id 0xf2035) removed from the process thread list
~"{0xf203f-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC07C000000 (id 0) added to the process thread list\n"
{0xf2033-0x102d3c360} TRACE [PROCESS] at PROCRemoveThread.3173: Thread 00007FE80E002A00 removed from the process thread list
{0xf204f-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80C004E00 (id 0xf204f) added to the process thread list
=thread-created,id="991229"
~"{0xf1ffd-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC07B021E00 (id 0) added to the process thread list\n"
=message,text="The target process is running .NET Core build dotnet/coreclr#1. In this build, launch may not be reliable. Please upgrade to targeting NETStandard 1.0.0-rc2-23901 or newer.",send-to="message-box",severity="warning"
=telemetry,event-name="VS/Diagnostics/Debugger/clrdbg/TargetRuntimeLoaded",properties={VS.Diagnostics.Debugger.clrdbg.TargetRuntimeVersion.MS="0x00040006",VS.Diagnostics.Debugger.clrdbg.TargetRuntimeVersion.LS="0x00010000",VS.Diagnostics.Debugger.clrdbg.Version="14.0.25005.0 built by: LAUNCHCMDSUPPORT(GREGGM5-GREGGM)",VS.Diagnostics.Debugger.clrdbg.OSFamily="Darwin",VS.Diagnostics.Debugger.clrdbg.KernelRelease="14.5.0"}
=library-loaded,id="{5d134f95-2970-4d83-8cec-e269b96e23ae}",target-name="/Users/greggm/clicon/run/mscorlib.dll",host-name="/Users/greggm/clicon/run/mscorlib.dll",symbols-loaded="0",base-address="0x10f55d000",size="2367488"
=library-loaded,id="{5d134f95-2970-4d83-8cec-e269b96e23b0}",target-name="/Users/greggm/clicon/run/clicon.dll",host-name="/Users/greggm/clicon/run/clicon.dll",symbols-loaded="1",base-address="0x10f54a000",size="32768"
=library-loaded,id="{5d134f95-2970-4d83-8cec-e269b96e23b4}",target-name="/Users/greggm/clicon/run/System.Runtime.dll",host-name="/Users/greggm/clicon/run/System.Runtime.dll",symbols-loaded="0",base-address="0x110eee000",size="49152"
=library-loaded,id="{5d134f95-2970-4d83-8cec-e269b96e23b6}",target-name="/Users/greggm/clicon/run/System.Console.dll",host-name="/Users/greggm/clicon/run/System.Console.dll",symbols-loaded="0",base-address="0x110f11000",size="106496"
~"{0xf203b-0x10d622b40} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FC07B02E400 (id 0xf203b) added to the process thread list\n"
{0xf2032-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80E002A00 (id 0xf2032) added to the process thread list
-ASSERT FAILED: "\"Failed to get active frame?\""
    Expression: 0
    Location:   line 240 in /Users/greggm/clrdbg/src/debugger/concord/impl/ManagedDM/V2/V2InstrBreakpoint.cpp
    Function:   Fire
{0xf204f-0x101950550} TRACE [PROCESS] at PROCGetProcessStatus.3295: Looking for status of process; trying wait(){0xf204f-0x101950550} TRACE [PROCESS] at PROCGetProcessStatus.3341: waitpid() failed with ECHILD; calling kill instead{0xf204f-0x101950550} TRACE [PROCESS] at PROCGetProcessStatus.3394: State of process 0x0000abf1 : 3 (exit code 0)
{0xf2050-0x102d3c360} TRACE [PROCESS] at PROCRemoveThread.3173: Thread 00007FE80D00C400 removed from the process thread list
ASSERT FAILED: "Failed to continue the process"
    Expression: hr == S_OK
    Location:   line 966 in /Users/greggm/clrdbg/src/debugger/concord/impl/ManagedDM/V2/V2DbiCallback.cpp
    Function:   ContinueExecution
{0xf1ffc-0x101950550} TRACE [PROCESS] at PROCRemoveThread.3046: Thread 00007FE80E001E00 removed from the process thread list
*stopped,reason="exited",exit-code="0"
(gdb)
{0xf204f-0x101950550} TRACE [PROCESS] at PROCRemoveThread.3032: Thread 0x00007FE80C004E00 (id 0xf204f) removed from the process thread list
{0xf2342-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80D001A00 (id 0xf2342) added to the process thread list
{0xf204f-0x102d3c360} TRACE [PROCESS] at PROCRemoveThread.3173: Thread 00007FE80E009000 removed from the process thread list
{0xf2342-0x101950550} TRACE [PROCESS] at PROCAddThread.2988: Thread 0x00007FE80C004E00 (id 0) added to the process thread list
{0xf2343-0x101e9c880} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80D002600 (id 0xf2343) added to the process thread list
{0xf2032-0x101950550} TRACE [PROCESS] at PROCRemoveThread.3046: Thread 00007FE80B806000 removed from the process thread list
{0xf2032-0x101e9c880} TRACE [PROCESS] at PROCRemoveThread.3173: Thread 00007FE80B80E400 removed from the process thread list
{0xf2032-0x102d3c360} TRACE [PROCESS] at PROCRemoveThread.3159: Thread 0x00007FE80E002A00 (id 0xf2032) removed from the process thread list
{0xf2343-0x102d3c360} TRACE [PROCESS] at PROCAddThread.3115: Thread 0x00007FE80E002A00 (id 0xf2343) added to the process thread list
^R
{0xf2342-0x101950550} TRACE [PROCESS] at PROCRemoveThread.3046: Thread 00007FE80D001A00 removed from the process thread list

@tzwlai tzwlai assigned mikem8361 and unassigned tzwlai Mar 28, 2016
@gregg-miskelly
Copy link
Contributor

I have a core dump of the issue. The crash is while processing a MT_ReadMemory message. Issue appears to be that pMessage->m_pbDataBlock points to junk.

mellinoe referenced this issue in dotnet/coreclr Mar 30, 2016
Fix ReadMemory AV (Issue #3916)
@mikem8361
Copy link
Member

Fix with PR dotnet/coreclr#3976

@gregg-miskelly
Copy link
Contributor

This is related to dotnet/coreclr#3987

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 30, 2020
@msftgits msftgits added this to the 1.0.0-rc2 milestone Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants