microsoft / microsoft/DirectXShaderCompiler

Crash in syntax check when using 'matrix' keyword in an operation

Open
#5,674 0 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

Description
While working on a project that supports both GLSL and HLSL, i inadvertently wrote a meaningless code
and instead of getting a syntax error the compiler simply crashed

Steps to Reproduce

try to compile something like this:

float2x2 matrix;
RWBuffer<float> Output; 

main()
{ 
  Output[0] = float2(1,2) * matrix;
}

$ ./bin/x64/dxc.exe -T cs_6_0 hello.hlsl
Internal compiler error: access violation. Attempted to read from address 0x0000000000000038
Segmentation fault

Actual Behavior

Internal compiler error: access violation. Attempted to read from address 0x0000000000000038
Segmentation fault

Environment

  • DXC version dxcompiler.dll: 1.7 - 1.7.2308.7 (69e54e290); dxil.dll: 1.7(101.7.2308.12))
  • Host Operating System Windows 11

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 provided HLSL reproducer with the documented dxc command and observe the access violation. Trace the compiler path reached by the matrix operation; done means the same input reports a syntax error instead of crashing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.