microsoft / microsoft/DirectXShaderCompiler

semantics: SIGSEGV when handling unbounded array with a semantic

Open
#7,582 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

https://godbolt.org/z/KGbfP9bGK

[shader("pixel")]
float main(float a[] : A) : SV_Target {
  return a[0];
}

Running in debug yields the following error instead.

Failed to allocate all input signature elements in available space.
UNREACHABLE executed at lib/HLSL/HLSignatureLower.cpp:523!
Aborted (core dumped)

Actual Behavior

Don't think this is legal HLSL, but DXC should not crash.

Environment

  • DXC version: f94396ddffa8562a00d64a1db58d3f73f33b655a
  • Host Operating System: Linux

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 with the HLSL reproducer in the issue and inspect the failure at lib/HLSL/HLSignatureLower.cpp:523. Trace how the unbounded input array and semantic are lowered after the allocation error. Done means this invalid shader produces a diagnostic or otherwise exits cleanly instead of reaching UNREACHABLE and 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.