Skip to content

Conversation

@janvorli
Copy link
Member

When stack overflow happens in native runtime code (e.g. in one of the
QCALLs, FCALLs etc.), we do not print stack trace to the console
and we fail fast with just a "Stack overflow" message. The reason is
that the stack overflow handling is executed on the failing thread and
it is not safe to call methods that are not async safe (reentrant).
The reason is that we could end up hanging or crashing when trying to
report the stack overflow.

However, we have the same potential issue on Windows and yet we try to
report the stack trace anyways. So this change modifies the behavior on
Unix to be the same.

I have also added a bunch of stack overflow reporting tests.

Close #35420
Close #32203

When stack overflow happens in native runtime code (e.g. in one of the
QCALLs, FCALLs etc.), we do not print stack trace to the console
and we fail fast with just a "Stack overflow" message. The reason is
that the stack overflow handling is executed on the failing thread and
it is not safe to call methods that are not async safe (reentrant).
The reason is that we could end up hanging or crashing when trying to
report the stack overflow.

However, we have the same potential issue on Windows and yet we try to
report the stack trace anyways. So this change modifies the behavior on
Unix to be the same.

I have also added a bunch of stack overflow reporting tests.
@janvorli janvorli added this to the 5.0 milestone Apr 30, 2020
@janvorli janvorli requested a review from jkotas April 30, 2020 15:52
@janvorli janvorli self-assigned this Apr 30, 2020
@@ -0,0 +1,149 @@
using System;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: License headers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thank you for noticing that, fixed.

@janvorli
Copy link
Member Author

FYI: @danmosemsft

@danmoseley
Copy link
Member

Thanks for doing this @janvorli . This is definitely valuable (just today I was looking at a SO issue reported)

@janvorli janvorli closed this May 4, 2020
@janvorli janvorli reopened this May 4, 2020
@janvorli janvorli merged commit 3b36f98 into dotnet:master May 4, 2020
@janvorli janvorli deleted the fix-stackoverflow-report-at-native branch May 4, 2020 13:02
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants