-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unhandled exception handler. #109806
Unhandled exception handler. #109806
Conversation
Note regarding the
|
1 similar comment
Note regarding the
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
Tagging subscribers to this area: @mangod9 |
|
I think this is ready for review. |
That is because I am far less familiar with where the relevant pieces are in Mono, so I'd like to get CoreCLR/NativeAOT and tests settled. |
src/tests/baseservices/exceptions/unhandledHandler/HandlerRefuses.cs
Outdated
Show resolved
Hide resolved
src/tests/baseservices/exceptions/unhandledHandler/HandlerThrows.cs
Outdated
Show resolved
Hide resolved
...sts/baseservices/exceptions/unhandledHandler/ForeignThreadRevPInvokeUnhandled/CMakeLists.txt
Outdated
Show resolved
Hide resolved
#include <pthread.h> | ||
#endif // _WIN32 | ||
|
||
// Work around typedef redefinition: platformdefines.h defines error_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the platformdefines.h
should be fixed instead to not to define the error_t
and include the errno.h
instead.
public class PInvokeRevPInvokeUnhandled | ||
{ | ||
[DllImport("ForeignThreadRevPInvokeUnhandled")] | ||
public static extern void InvokeCallback(MyCallback callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot see this being used in this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied the file between two tests. One uses InvokeCallback
another uses InvokeCallbackOnNewThread
. I can remove redundant ones.
src/tests/baseservices/exceptions/UnhandledExceptionHandler/UnhandledTrivial.cs
Outdated
Show resolved
Hide resolved
…handledTrivial.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
The failure in x86 tests is #110127 |
/ba-g #110127 |
|
||
namespace System.Runtime.ExceptionServices | ||
{ | ||
public delegate bool UnhandledExceptionHandler(System.Exception exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VSadov the approved API shape used Func<Exception, bool>
instead of a custom delegate.
The managed part of #101560
It implements the
public static void SetUnhandledExceptionHandler(UnhandledExceptionHandler handler);
APIThis covers CoreCLR and NativeAOT.
(Mono will need to be addressed separately)