microsoft / microsoft/DirectXShaderCompiler

Use interface, DXC crashed

Open
#6,117 3 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
use interface simply, dxc will crash,but d3dcompile is ok

interface IQueueReadProxy
{
    void GetReadPos(out uint readPos);
};

struct TtQueueReadProxyTest : IQueueReadProxy
{
    void GetReadPos(out uint readPos)
    {
        readPos = 0;
    }
    uint Dequeue1()
    {
        uint readPos = 0;
        GetReadPos(readPos);
        return (uint)readPos;
    }
};

[numthreads(1, 1, 1)]
void CS_ClusterCullingMain(uint DispatchThreadId : SV_DispatchThreadID)
{
    TtQueueReadProxyTest q;
    uint a = q.Dequeue1();
}

Steps to Reproduce

save code in test.hlsl
dxc -E CS_ClusterCullingMain -T cs_6_6 -Fo myshader.bin -Zi -Fd myshader.pdb -D MYDEFINE=1 test.hlsl

Actual Behavior

Internal compiler error: access violation. Attempted to read from address 0x00000000000000A8

Environment

  • DXC version dxcompiler.dll: 1.8 - 1.7.0.4386 (a743e97f8)
  • Host Operating System <!--- Host operating system and version ---> win10

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

Reproduce the crash with test.hlsl using the provided dxc command and confirm the access violation on the stated DXC version. Trace the compiler path handling the interface call and out parameter, then add a regression test that compiles the sample without an internal compiler error and verify the existing test suite passes.

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
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.