[x86/Linux] Fix SIGSEGV on Debugger.Break() during debugging. tizen_5.5_mobile_hotfix submit/tizen_5.5_mobile_hotfix/20210923.022210
authorMikhail Kurinnoi <m.kurinnoi@samsung.com>
Mon, 20 Sep 2021 15:20:04 +0000 (08:20 -0700)
committerHyungju Lee <leee.lee@samsung.com>
Thu, 23 Sep 2021 02:21:40 +0000 (11:21 +0900)
SIGSEGV occur in src/vm/i386/cgenx86.cpp `HelperMethodFrame::UpdateRegDisplay()` at line `pRD->pCurrentContext->Eip = pRD->ControlPC = m_MachState.GetRetAddr();`, since `pRD->pCurrentContext` is NULL.
The point of issue - wrong code block compilation in DebuggerWalkStack() in case of Linux x86.

src/debug/ee/frameinfo.cpp

index 3efbddd..a4741df 100644 (file)
@@ -2097,7 +2097,7 @@ StackWalkAction DebuggerWalkStack(Thread *thread,
 #endif
             memset((void *)&data, 0, sizeof(data));
 
-#if defined(_TARGET_X86_)
+#if !defined(WIN64EXCEPTIONS)
             // @todo - this seems pointless. context->Eip will be 0; and when we copy it over to the DebuggerRD,
             // the context will be completely null.
             data.regDisplay.ControlPC = context->Eip;