Skip to content

Add dxc exception handler#3604

Merged
pow2clk merged 4 commits intomicrosoft:masterfrom
pow2clk:except_handler
Mar 19, 2021
Merged

Add dxc exception handler#3604
pow2clk merged 4 commits intomicrosoft:masterfrom
pow2clk:except_handler

Conversation

@pow2clk
Copy link
Copy Markdown
Collaborator

@pow2clk pow2clk commented Mar 18, 2021

The most common cause of internal compiler errors are access violations
or stack overflows. This registers an exception handler in dxc.exe for
these cases that are otherwise unhandled. It prints a simple message
for these errors and passes the exception along.

In case this is unwanted for some reason, a hidden disabling flag is
added as well.

The most common cause of internal compiler errors are access violations
or stack overflows. This registers an exception handler in dxc.exe for
these cases that are otherwise unhandled. It prints a simple message
for these errors and passes the exception along.

In case this is unwanted for some reason, a hidden disabling flag is
added as well.
@pow2clk pow2clk changed the title Add dxc access violation handler Add dxc exception handler Mar 18, 2021
Comment thread tools/clang/tools/dxclib/dxc.cpp Outdated
@AppVeyorBot
Copy link
Copy Markdown

Comment thread tools/clang/tools/dxclib/dxc.cpp Outdated
Greg Roth added 2 commits March 18, 2021 17:04
Adds LLVM builtin exceptions for assert, fatal, and unreachable. Adds a
default message for exceptions not explicitly addressed.

Alters behavior of llvm_unreachable so it always raises an exception
regardless of compiler support for unreachable hints.

Reports errors using fputs instead of std::cerr to ensure that no
allocation is necessary. Custom output is performed in a static array
that is output with fputs.
Comment thread include/dxc/Support/HLSLOptions.td Outdated
Copy link
Copy Markdown
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with one suggestion.

This is only applicable to dxc. So it needn't be core (yet)
@AppVeyorBot
Copy link
Copy Markdown

@pow2clk pow2clk merged commit 9b475a7 into microsoft:master Mar 19, 2021
@pow2clk pow2clk deleted the except_handler branch March 19, 2021 03:37
tex3d pushed a commit to tex3d/DirectXShaderCompiler that referenced this pull request Mar 22, 2021
The most common cause of internal compiler errors are access violations
or stack overflows. This registers an exception handler in dxc.exe for
these cases that are otherwise unhandled. It prints a simple message
for these errors and passes the exception along.

In case this is unwanted for some reason, a hidden disabling flag is
added as well.

Adds LLVM builtin exceptions for assert, fatal, and unreachable. Adds a
default message for exceptions not explicitly addressed.

Alters behavior of llvm_unreachable so it always raises an exception
regardless of compiler support for unreachable hints.

Reports errors using fputs instead of std::cerr to ensure that no
allocation is necessary. Custom output is performed in a static array
that is output with fputs.

(cherry picked from commit 9b475a7)
tex3d added a commit that referenced this pull request Mar 23, 2021
Cherry-pick changes to release branch:
cd3ef21 Roll back llvm::ArrayRef dependency in ExecutionTest (#3613)
2791c51 Generate descriptions for resources with no names (#3598)
22fa209 Fix LifetimeIntrinsicTest issues (#3609)
2039610 Fix Dxil validator compat and test issues (#3610)
220e884 Rename payload qualifier field to not match type (#3607)
0e89206 Correct exception handler sprintf for 32-bit (#3608)
9b475a7 Add dxc exception handler (#3604)
e8372b9 Fixed arg pairs not correct for old source in module pdbs (#3599)
2bda44f Add constant evaluation for clamp() (#3581)
640c9af Added way for caller to replace args in PDB utils (#3595)
de00b01 Fix const error check for object subscript operator (#3580)
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

Successfully merging this pull request may close these issues.

4 participants