ldc
ldc copied to clipboard
LDC 1.27.0-beta2 fails to build on Linux due to dip1021 and fails to print info because of missing llvm-symbolizer
This is the error that I get:
Performing "debug" build using /home/aminya/dlang/ldc-1.27.0-beta2/bin/ldc2 for x86_64.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/home/aminya/dlang/ldc-1.27.0-beta2/bin/ldc2(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x23)[0x36d9203]
Segmentation fault
/home/aminya/dlang/ldc-1.27.0-beta2/bin/ldc2 failed with exit code 139.
Installing llvm symbolized changes the error to:
#0 0x00000000036d9203 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/hostedtoolcache/dc/ldc2-1.27.0-beta2/x64/ldc2-1.27.0-beta2-linux-x86_64/bin/ldc2+0x36d9203)
Segmentation fault (core dumped)
It works with ldc 1.26 or on other operating systems with 1.27
Reproducible here: https://github.com/aminya/minijson
Looks like the issue is not whether you have llvm-symbolizer installed or not, that's just a hint to get a better stack trace. Can you try to minimize the example and provide more detailed reproduction steps? (LDC seems to be crashing on your code)
I found the llvm-symbolizer requirement counterproductive at some point a while back; unfortunately, I remember almost nothing about it. I think it crashed in the tentative backtrace too (on Linux), obscuring the actual problem - IIRC, because of an llvm-symbolizer not matching the LLVM version LDC was linked against.
Can you try to minimize the example and provide more detailed reproduction steps? (LDC seems to be crashing on your code)
On the master branch, the code is very minimal. See ./src/native folder.
https://github.com/aminya/minijson/tree/master/src/native
I found the reason. This is caused by using dip1021!
dflags "-preview=dip1021" platform="posix-ldc"
I removed it, and now it works!
I think it crashed in the tentative backtrace too (on Linux), obscuring the actual problem
It might have been a stack overflow error on Windows that was obscured by the tentative backtrace...
I have same problem (can't share code, it proprietary and huge)
I tried to avoid this ICE by remove some new modules and ldc gets me some errors, fixing those resolves ICE on original code (resolved by adding @trusted for function called in @safe code)
ldc 1.27.1 from github
is dustmite is only way in this case? maybe exists other options? may be need use compiler with debug information?
is dustmite is only way in this case? maybe exists other options? may be need use compiler with debug information?
A compiler with debug info may give a better stack trace, but it is still much better to work with a testcase that triggers the bug. (testcase = dustmiting session)