microsoft / microsoft/DirectXShaderCompiler

Crash when function named in patchconstantfun does not exist

Open
#8,046 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug crash incorrect-code
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Compiling the attached shader with latest released DXC compiler causes crash.

Steps to Reproduce:

godbolt repro: https://godbolt.org/z/c9MKcP5ae

Please download attached shader file and compile with following command line:

dxc.exe -Wno-misplaced-attributes -flegacy-resource-reservation -Zi -Qembed_debug -D NX_IS_DXC_COMPILER /D "NX_GPU_TARGET_SHADER_MODEL=NX_SHADER_MODEL6" -T lib_6_6 /O3 /D NX_GPU_TARGET shaders_r2_dx12.txt

Actual Behavior:
"Internal compiler error: access violation. Attempted to read from address 0x0000000000000028"

shaders_r2_dx12.txt

Environment

  • DXC version : dxcompiler.dll: 1.9 - 1.8.2505.32 (b106a961d); dxil.dll: 1.9(1.8.2505.32)
  • Host Operating System : Windows 10 Pro, 22H2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the attached shaders_r2_dx12.txt with the command line in the issue, or reproduce it through the linked Godbolt example. Then trace DXC's handling of a missing function named in patchconstantfun. Done means the shader no longer causes an access-violation crash and the reported behavior is verified against the provided reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.