Skip to content
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 Win32 exception - no AeDebug postmortem or UnhandledExceptionFilter callback #27099

Closed
ghost opened this issue Apr 5, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2019

  • Version: v10.15.3
  • Platform: Microsoft Windows 10 Enterprise, 64-bit, version 10.0.16299
  • Subsystem: unknown

On Windows, node just exits in the event of an unhandled Win32 Exception in an addon, such as an access violation that occurs outside the scope of an SEH block. Postmortem debugging (AeDebug) is not triggered. Similarly, an UnhandledExceptionFilter callback previously registered by the addon is not called. Is there an option to enable AeDebug and/or UnhandledExceptionFilter?

@bzoz
Copy link
Contributor

bzoz commented Apr 11, 2019

You can try commenting out those lines and rebuilding Node:

node/deps/uv/src/win/core.c

Lines 177 to 194 in 655c90b

/* Tell Windows that we will handle critical errors. */
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |
SEM_NOOPENFILEERRORBOX);
/* Tell the CRT to not exit the application when an invalid parameter is
* passed. The main issue is that invalid FDs will trigger this behavior.
*/
#if !defined(__MINGW32__) || __MSVCRT_VERSION__ >= 0x800
_set_invalid_parameter_handler(uv__crt_invalid_parameter_handler);
#endif
/* We also need to setup our debug report handler because some CRT
* functions (eg _get_osfhandle) raise an assert when called with invalid
* FDs even though they return the proper error code in the release build.
*/
#if defined(_DEBUG) && (defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR))
_CrtSetReportHook(uv__crt_dbg_report_handler);
#endif

If you are testing your own modules you should have almost everything you need to build Node already available, maybe missing NASM. Check out our bootstraping guide: https://github.com/nodejs/node/tree/master/tools/bootstrap#windows . The build process itself is as simple as checking out the source code and running vcbuild.bat.

@ghost
Copy link
Author

ghost commented Apr 12, 2019

Thanks for pointing that out. It turns out that this issue was already raised and discussed.
libuv/libuv#1327

@ghost ghost closed this as completed Apr 12, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant