You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Secondary frame stackoverflow test failure on linux #107226
is failing in runtime-coreclr superpmi-collect-test pipeline on linux x64, arm64 and arm:
Running stackoverflow test(largeframe main)"Stack overflow.""Repeated 42 times:""--------------------------------"" at TestStackOverflow.Program.InfiniteRecursionB2()"" at TestStackOverflow.Program.InfiniteRecursionA2()"" at TestStackOverflow.Program.InfiniteRecursionC2()""--------------------------------"" at TestStackOverflow.Program.InfiniteRecursionB2()"" at TestStackOverflow.Program.InfiniteRecursionA2()"" at TestStackOverflow.Program.Test(Boolean)"" at TestStackOverflow.Program.Main(System.String[])"""Running stackoverflow test(smallframe secondary)"Stack overflow.""Stack overflow."""System.Exception: Missing "TestStackOverflow.Program.Test" method frame at TestStackOverflow.Program.TestStackOverflowSmallFrameSecondaryThread() at __GeneratedMainWrapper.Main()Expected: 100Actual: 101END EXECUTION - FAILED
The problem is due to the superpmi libsuperpmi-shim-collector.sosigsegv handler being called as the first one and the GetCurrentPalThread returning NULL in this dll, because the PAL threads were created by the libcoreclr.so. That results in the sigsegv_handler printing "Stack overflow" and calling PROCAbort.
I am testing a fix that just calls the previous signal handler when GetCurrentPalThread returns NULL.
It is actually a bit more involved. The GetCurrentPalThread sometimes returns non-NULL even when called from the libsuperpmi-shim-collector.soSIGSEGV handler. That happens when the superpmi stuff ended up being called on that thread before the crash occurs. Which means we have jitted something on that thread. Then the PAL thread instance gets created also in the context of the libsuperpmi-shim-collector.so.
Nevertheless, it doesn't change the way to fix that I've mentioned above. I just wanted to share the full story here. If the PAL thread got registered, we still end up falling back to the SIGSEGV handler in the libcoreclr.so, because the superpmi doesn't implement hardware exception handling callbacks that could handle the stack overflow.
Activity
janvorli commentedon Sep 2, 2024
The problem is due to the superpmi
libsuperpmi-shim-collector.sosigsegvhandler being called as the first one and theGetCurrentPalThreadreturningNULLin this dll, because the PAL threads were created by thelibcoreclr.so. That results in thesigsegv_handlerprinting "Stack overflow" and callingPROCAbort.I am testing a fix that just calls the previous signal handler when
GetCurrentPalThreadreturnsNULL.janvorli commentedon Sep 2, 2024
It is actually a bit more involved. The
GetCurrentPalThreadsometimes returns non-NULL even when called from thelibsuperpmi-shim-collector.soSIGSEGVhandler. That happens when the superpmi stuff ended up being called on that thread before the crash occurs. Which means we have jitted something on that thread. Then the PAL thread instance gets created also in the context of thelibsuperpmi-shim-collector.so.Nevertheless, it doesn't change the way to fix that I've mentioned above. I just wanted to share the full story here. If the PAL thread got registered, we still end up falling back to the
SIGSEGVhandler in thelibcoreclr.so, because the superpmi doesn't implement hardware exception handling callbacks that could handle the stack overflow.