microsoft / microsoft/DirectXShaderCompiler

Crash in TranslatePtrIfUsedByLoweredFn

Open
#3,259 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Repro:

Compile the following, (I used as_6_5, /Zi -enable-16bit-types /Qembed_debug )

Texture2D<float4> g_texture;

struct smallPayload
{
	Texture2D<float4> texture;
};


[numthreads(1, 1, 1)]
void main()
{
    smallPayload p;
    p.texture = g_texture;
    DispatchMesh(1, 1, 1, p);
}

The compilation should fail because of passing an object to DispatchMesh, but instead, there's an assertion failure and then crash in TranslatePtrIfUsedByLoweredFn

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 as_6_5, /Zi, -enable-16bit-types, and /Qembed_debug, then inspect TranslatePtrIfUsedByLoweredFn where the assertion and crash occur. Done means the invalid object passed to DispatchMesh produces a compilation error rather than an assertion failure or crash.

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
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.