[AIMIGRAPHX-1175] Add terminate handler for Windows#5084
Open
eddieliao wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Windows-only terminate handler to migraphx-driver so uncaught exceptions print a verbose message similar to what users see on Linux, improving diagnostics on Windows builds.
Changes:
- Introduces
verbose_terminate.{hpp,cpp}implementing a verbosestd::terminatehandler. - Installs the handler at
migraphx-driverstartup on Windows (_WIN32). - Adds the new source file to the driver build.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/driver/verbose_terminate.hpp | Declares the driver terminate-handler installation entry point. |
| src/driver/verbose_terminate.cpp | Implements the verbose terminate handler and installer. |
| src/driver/main.cpp | Installs the terminate handler on Windows at program start. |
| src/driver/CMakeLists.txt | Adds the new translation unit to the driver target. |
| inline namespace MIGRAPHX_INLINE_NS { | ||
|
|
||
| namespace { | ||
| // Print the active exception's type and what() message, then abort (mirrors libstdc++). |
pfultz2
reviewed
Jul 21, 2026
pfultz2
reviewed
Jul 21, 2026
Regressions detected 🔴 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
migraphx-driveron Windows currently lacks error reporting that Linux has. Example of expected output:Technical Details
MSVC does not install a verbose terminate handler by default which gcc/clang does. This PR installs a terminate handler for Windows only that mirrors the behavior seen on Linux builds.
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.