node-segfault-handler icon indicating copy to clipboard operation
node-segfault-handler copied to clipboard

Pass debug messages on to someone else to handle - Windows specific

Open sparkpunkd opened this issue 3 years ago • 0 comments

Some Windows libraries use OutputDebugString() to log a message to a debugger. This works by throwing an exception and then a debugger being a registered exception handler. For example, th Google family of chromium-based APIs do this, including libwebrtc that is part of node-webrtc.

Unfortunately, node-segfault-handler intercepts these exceptions and reports them as SIGSEGV, printing a stack trace and marks them as handled by returning EXCEPTION_EXECUTE_HANDLER. In this case and implemented by this PR, it would be better to not handle the exception and pass it onto any other interested party with EXCEPTION_CONTINUE_SEARCH.

Also, as part of the debugging process, the code can try to set the thread name via exception. This PR also passes this exception onwards and upwards.

sparkpunkd avatar Apr 06 '21 13:04 sparkpunkd