Skip to content

Unhandled Win32 exception - no AeDebug postmortem or UnhandledExceptionFilter callback #27099

Description

  • 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?

Activity

  1. bzoz commented on Apr 11, 2019

    @bzoz
    Contributor

    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.

  2. ghost closed this as completedon Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions