FS#77394 - [directx-shader-compiler] Compiling simple shaders causes assertion failure

Attached to Project: Arch Linux
Opened by Krzysztof Bogacki (Saancreed) - Sunday, 05 February 2023, 02:08 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Laurent Carlier (lordheavy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Attempting to compile simple HLSL shaders to DXIL with dxc from Arch repo causes an assertion failure and results in a core dump. Binaries provided by Microsoft successfully compile the same shaders.

Additional info:
* package version(s): directx-shader-compiler=1.7.2212-1
* config and/or log files: see below

Steps to reproduce:

$ curl -Lso ./shaders.hlsl 'https://raw.githubusercontent.com/microsoft/DirectX-Graphics-Samples/master/Samples/Desktop/D3D12HelloWorld/src/HelloTriangle/shaders.hlsl'
$ dxc -E VSMain -T vs_6_0 -Fo ./vs.dxil ./shaders.hlsl; echo $?; file ./vs.dxil

Result:

dxc: /build/directx-shader-compiler/src/directx-shader-compiler-1.7.2212/lib/IR/User.cpp:44: void llvm::User::allocHungoffUses(unsigned int, bool): Assertion `HasHungOffUses && "alloc must have hung off uses"' failed.
Aborted (core dumped)
134
./vs.dxil: cannot open './vs.dxil' (No such file or directory)

Expected result (including reproduction steps):

$ curl -Ls 'https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2212/linux_dxc_2022_12_16.tar.gz' | bsdtar xf -
$ chmod +x ./bin/x64/dxc
$ LD_LIBRARY_PATH=~+/lib/x64 ./bin/x64/dxc -E VSMain -T vs_6_0 -Fo ./vs.dxil ./shaders.hlsl; echo $?; file ./vs.dxil
warning: DXIL.dll not found. Resulting DXIL will not be signed for use in release environments.


0
./vs.dxil: data
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:18 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/directx-shader-compile r/issues/1
Comment by Toolybird (Toolybird) - Sunday, 05 February 2023, 07:05 GMT
> results in a core dump

Does a backtrace produce anything useful [1]?

[1] https://wiki.archlinux.org/title/Debugging/Getting_traces#Debuginfod
Comment by Krzysztof Bogacki (Saancreed) - Sunday, 05 February 2023, 12:54 GMT
> Does a backtrace produce anything useful?

Unfortunately no, `debuginfod-find debuginfo /usr/lib/libdxcompiler.so` gives me `Server query failed: No such file or directory` and there is no `directx-shader-compiler-debug` package in `extra-debug` repository, so all I can see for the `libdxcompiler.so` part of the stack trace is `??` and `No symbol table info available.`. Attached is the full output of gdb's `bt full`.
   bt.txt (4.2 KiB)

Loading...