-
Notifications
You must be signed in to change notification settings - Fork 657
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
[DXIL] Null pointer exception due to double
floating-point literals in fmod
intrinsic
#6410
Closed
Labels
bug
Bug, regression, crash
crash
DXC crashing or hitting an assert
rca
Candidate for a root cause analysis discussion
sm6.8
Shader Model 6.8
validation
Related to validation or signing
Milestone
Comments
Possibly introduced in #6302 |
damyanp
added
crash
DXC crashing or hitting an assert
sm6.8
Shader Model 6.8
validation
Related to validation or signing
rca
Candidate for a root cause analysis discussion
and removed
needs-triage
Awaiting triage
labels
Mar 14, 2024
@damyanp this definitely looks like it introduced the null pointer exception, since all those assertions were removed and the null pointer isn't handled. The fix @tex3d linked to this issue works for us, although it's not a long term fix as he mentioned it can still crash with explicit |
This was referenced Mar 19, 2024
python3kgae
added a commit
that referenced
this issue
Apr 26, 2024
This change removes the IsOverloadLegal check in OP::GetOpFunc. It will permit the generation of illegal DXIL operations. Subsequently, the validation should catch these illegal DXIL operations if they are not optimized later in SimplifyDxilCall. Fixes #6410
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Bug, regression, crash
crash
DXC crashing or hitting an assert
rca
Candidate for a root cause analysis discussion
sm6.8
Shader Model 6.8
validation
Related to validation or signing
Description
There is a null pointer exception during the translation of FMod (
TranslateFMod
) when the arguments are floating-point literals, because the latest DXC version does not reduce them tofloat
during compilation. The null pointer occurs insideTrivialDxilUnaryOperation(OP::OpCode::Frc, absDiv, hlslOP, Builder)
becauseFrc
won't find the respective function for double-precision floats. Previous versions had this assertion in OP::GetOpFunc:But the latest version only returns a null pointer that is not handled correctly:
Steps to Reproduce
This issue can be reproduced with the latest version of the main branch and compiling with
dxc -E PSMain -T ps_6_0
(or by following https://godbolt.org/z/beK7oPsx6):Making the floating-point literals explicitly single-precision with the
f
suffix compiles fine:This does not reproduce with other intrinsics such as
sin
.The text was updated successfully, but these errors were encountered: