microsoft / microsoft/DirectXShaderCompiler
ClangHLSLTests crashed on apple silicon
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
Steps to Reproduce
The command to build:
export RepoRoot=/Users/zieng/code/DirectXShaderCompiler
export OUT=${RepoRoot}/out
cd ${RepoRoot}
cmake ${RepoRoot} \
-B ${OUT} \
-C ${RepoRoot}/cmake/caches/PredefinedParams.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-G "Unix Makefiles"
cd ${OUT}
make
The command to run the test
cd ${OUT}
./tools/clang/unittests/HLSL/ClangHLSLTests
Actual Behavior
The test crashed:
...
END TEST(S): </Users/zieng/code/DirectXShaderCompiler/tools/clang/test/HLSL/../HLSLFileCheck/shader_targets/mesh/multipleInPayload.hlsl<HASH>>
BEGIN TEST(S): </Users/zieng/code/DirectXShaderCompiler/tools/clang/test/HLSL/../HLSLFileCheck/shader_targets/mesh/semantic_on_parameter.hlsl<HASH>>
0 ClangHLSLTests 0x00000001031760ac llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1 ClangHLSLTests 0x00000001031771bc PrintStackTraceSignalHandler(void*) + 24
2 ClangHLSLTests 0x0000000103177590 SignalHandler(int) + 492
3 libsystem_platform.dylib 0x00000001990fade4 _sigtramp + 56
4 libdxil.dylib 0x0000000105f43748 (anonymous namespace)::llvm_assert_trap(char const*, char const*, unsigned int, char const*) + 124
5 libdxil.dylib 0x0000000105f436c0 llvm_assert + 48
6 libdxil.dylib 0x0000000105d925c0 DxilProgramSignatureWriter::write(std::__1::vector<hlsl::DxilProgramSignatureElement, std::__1::allocator<hlsl::DxilProgramSignatureElement>>&, hlsl::DxilSignatureElement const*) + 168
7 libdxil.dylib 0x0000000105d8d5d8 DxilProgramSignatureWriter::write(hlsl::AbstractMemoryStream*) + 420
8 libdxil.dylib 0x0000000105e0d7f4 hlsl::VerifyBlobPartMatches(hlsl::ValidationContext&, char const*, hlsl::DxilPartWriter*, void const*, unsigned int) + 624
9 libdxil.dylib 0x0000000105e09fcc hlsl::VerifySignatureMatches(hlsl::ValidationContext&, hlsl::DXIL::SignatureKind, void const*, unsigned int) + 280
10 libdxil.dylib 0x0000000105e0adb0 hlsl::ValidateDxilContainerParts(llvm::Module*, llvm::Module*, hlsl::DxilContainerHeader const*, unsigned int) + 1516
11 libdxil.dylib 0x0000000105e0d444 hlsl::ValidateDxilContainer(void const*, unsigned int, llvm::Module*, llvm::raw_ostream&) + 604
12 libdxil.dylib 0x000000010607eca4 runValidation(IDxcBlob*, unsigned int, llvm::Module*, hlsl::AbstractMemoryStream*) + 112
13 libdxil.dylib 0x000000010607deb0 hlsl::validateWithOptDebugModule(IDxcBlob*, unsigned int, llvm::Module*, IDxcOperationResult**) + 496
14 libdxil.dylib 0x000000010607db40 hlsl::validateWithDebug(IDxcBlob*, unsigned int, DxcBuffer*, IDxcOperationResult**) + 880
15 libdxil.dylib 0x0000000105c31a74 DxcValidator::ValidateWithDebug(IDxcBlob*, unsigned int, DxcBuffer*, IDxcOperationResult**) + 52
16 libdxcompiler.dylib 0x0000000107e55ed0 dxcutil::ValidateAndAssembleToContainer(dxcutil::AssembleInputs&) + 708
17 libdxcompiler.dylib 0x0000000107e44e20 DxcCompiler::Compile(DxcBuffer const*, wchar_t const**, unsigned int, IDxcIncludeHandler*, _GUID const&, void**) + 10628
18 libdxcompiler.dylib 0x0000000107e400b4 hlsl::DxcCompilerAdapter::WrapCompile(bool, IDxcBlob*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const**, unsigned int, DxcDefine const*, unsigned int, IDxcIncludeHandler*, IDxcOperationResult**, wchar_t**, IDxcBlob**) + 1216
19 libdxcompiler.dylib 0x0000000107e40fb8 hlsl::DxcCompilerAdapter::CompileWithDebug(IDxcBlob*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const**, unsigned int, DxcDefine const*, unsigned int, IDxcIncludeHandler*, IDxcOperationResult**, wchar_t**, IDxcBlob**) + 156
20 ClangHLSLTests 0x000000010353c290 CompileForHash(hlsl::options::DxcOpts&, wchar_t const*, dxc::DxcDllSupport&, std::__1::vector<wchar_t const*, std::__1::allocator<wchar_t const*>>&, IDxcBlob**, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&) + 1292
21 ClangHLSLTests 0x0000000103532d20 FileRunCommandPart::RunDxcHashTest(dxc::DxcDllSupport&) + 756
22 ClangHLSLTests 0x0000000103532a10 FileRunCommandPart::RunHashTests(dxc::DxcDllSupport&) + 88
23 ClangHLSLTests 0x0000000103540bcc FileRunTestResultImpl::RunHashTestFromCommands(char const*, wchar_t const*) + 168
24 ClangHLSLTests 0x000000010353d9a8 FileRunTestResultImpl::RunHashTestFromFileCommands(wchar_t const*) + 68
25 ClangHLSLTests 0x000000010353d8c0 FileRunTestResult::RunHashTestFromFileCommands(wchar_t const*) + 212
26 ClangHLSLTests 0x0000000102f245b0 CompilerTest::CodeGenTestHashFullPath(wchar_t const*) + 32
27 ClangHLSLTests 0x0000000102f24570 CompilerTest::CodeGenTestHash(wchar_t const*, bool) + 196
28 ClangHLSLTests 0x0000000102ef86f0 CompilerTest::CodeGenTestCheckBatchHash(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t>>, bool) + 1312
29 ClangHLSLTests 0x0000000102ef8e24 CompilerTest_CodeGenHashStabilityShaderTargets_Test::TestBody() + 64
30 ClangHLSLTests 0x00000001035064a4 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) + 148
31 ClangHLSLTests 0x00000001034dc05c void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) + 96
32 ClangHLSLTests 0x00000001034dbfac testing::Test::Run() + 180
33 ClangHLSLTests 0x00000001034dcfd4 testing::TestInfo::Run() + 224
34 ClangHLSLTests 0x00000001034ddcd0 testing::TestCase::Run() + 244
35 ClangHLSLTests 0x00000001034e5214 testing::internal::UnitTestImpl::RunAllTests() + 800
36 ClangHLSLTests 0x000000010350b914 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) + 148
37 ClangHLSLTests 0x00000001034e4ce0 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) + 96
38 ClangHLSLTests 0x00000001034e4bcc testing::UnitTest::Run() + 216
39 ClangHLSLTests 0x000000010306ab38 RUN_ALL_TESTS() + 16
40 ClangHLSLTests 0x000000010306aa90 main + 1600
41 dyld 0x0000000198d44274 start + 2840
zsh: trace trap ./tools/clang/unittests/HLSL/ClangHLSLTests
Environment
- DXC version: self built at
7c8005a2546755e14ddc03b0a3a630ab8ebcaf91 - Host Operating System:
Apple M2 Pro @ macOS 15.3.1 (24D70)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash with the provided CMake and ClangHLSLTests commands on Apple silicon, focusing on the CodeGenHashStabilityShader test and semantic_on_parameter.hlsl. Trace the reported path through CompileForHash and DxilProgramSignatureWriter::write; done means the test completes without the assertion crash and the HLSL test suite remains passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos
- Domain
- compilers, operating-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100