Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] Embedding debug info from shader source with non Latin letters causes exception #6948

Open
LawG4 opened this issue Oct 5, 2024 · 2 comments
Labels
bug Bug, regression, crash spirv Work related to SPIR-V
Milestone

Comments

@LawG4
Copy link

LawG4 commented Oct 5, 2024

Description
Attempting to generate spirv byte code with debug information inside the binary crashes when the input file path contains non-latin text. Resulting in an internal compiler error to be reported. Except when specifying vulkan-with-source

Steps to Reproduce

# Crash
dxc.exe hlsl_頂点.hlsl -spirv -T vs_6_0 -Qembed_debug -Zi

# No Crash, no spirv flag set
dxc.exe hlsl_頂点.hlsl -T vs_6_0 -Qembed_debug -Zi

# Crash 
dxc.exe hlsl_頂点.hlsl -spirv -T vs_6_0 -fspv-debug=file
dxc.exe hlsl_頂点.hlsl -spirv -T vs_6_0 -fspv-debug=line
dxc.exe hlsl_頂点.hlsl -spirv -T vs_6_0 -fspv-debug=source

# Interestingly,  this results in *no* crash 
dxc.exe hlsl_頂点.hlsl -spirv -T vs_6_0 -fspv-debug=vulkan-with-source

Source code inside the hlsl file is a simple text shader which just passes information to next stage

struct VS_OUTPUT {
    float4 pos : POSITION;
};

struct VS_INPUT {
    float4 pos : POSITION;
};

VS_OUTPUT main(const VS_INPUT vs_input) {
    VS_OUTPUT vs_out;
    vs_out.pos = vs_input.pos;
    return vs_out;
}

Actual Behavior
The compiler only outputs this text on the runs which crash

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

Environment

  • DXC version: dxcompiler.dll: 1.8 - 1.8.2407.7 (416fab6); dxil.dll: 1.8(101.8.2407.12)
  • Host Operating System: Windows 10
@LawG4 LawG4 added bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V labels Oct 5, 2024
@damyanp damyanp moved this to For Google in HLSL Triage Oct 8, 2024
@s-perron
Copy link
Collaborator

I do not think this is spirv specific. When I run with a debug build, I see the same assert when targeting DXIL and SPIRV. I'll ask someone at Microsoft to double check.

DirectXShaderCompiler/issues/6948 » dxc hlsl_頂点.hlsl -spirv -T vs_6_0 -Qembed_debug -Zi
otherwise contents changedError: assert(false && "otherwise contents changed")
File:
DirectXShaderCompiler/lib/DxcSupport/Unicode.cpp(192)
Func:	UTF8ToWideString
[1]    513981 illegal hardware instruction  dxc hlsl_頂点.hlsl -spirv -T vs_6_0 -Qembed_debug -Zi
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DirectXShaderCompiler/issues/6948 » dxc hlsl_頂点.hlsl -T vs_6_0 -Qembed_debug -Zi
otherwise contents changedError: assert(false && "otherwise contents changed")
File:
DirectXShaderCompiler/lib/DxcSupport/Unicode.cpp(192)
Func:	UTF8ToWideString
[1]    514042 illegal hardware instruction  dxc hlsl_頂点.hlsl -T vs_6_0 -Qembed_debug -Zi
-------------------------------------------------------------------------------------------------------

@s-perron s-perron moved this from For Google to For MSFT in HLSL Triage Oct 28, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Oct 29, 2024
@damyanp damyanp moved this from For MSFT to Triaged in HLSL Triage Oct 29, 2024
@damyanp damyanp added this to the Dormant milestone Oct 29, 2024
@damyanp
Copy link
Member

damyanp commented Oct 29, 2024

Thanks - unfortunately, due to our current set of priorities we're going to be unable to look into this issue. We'd happily look at any submitted PRs addressing it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash spirv Work related to SPIR-V
Projects
Status: Triaged
Development

No branches or pull requests

3 participants