Issue 53142
Summary 2 x Clang frontend crashes with Zstd 1.5.1
Labels
Assignees
Reporter ms178
    Compiling Zstd 1.5.1 with the mentioned flags result in two Clang frontend crashes, I've attached the dumps.

Compiler version: 

```
clang version 14.0.0 (/home/marcus/Downloads/llvm-git/llvm-project 36af07334246a87a0f3fb9bbc85dedfca04b00d1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.2.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.2.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
```


These following compiler flags were used:
```
export CFLAGS="-O3 -march=native -mtune=native -mllvm -polly -mllvm -polly-parallel -mllvm -polly-vectorizer=polly -mllvm -polly-omp-backend=LLVM -mllvm -polly-num-threads=36 -mllvm -polly-scheduling=dynamic -mllvm -polly-scheduling-chunksize=1 -mllvm -polly-ast-use-context -mllvm -polly-invariant-load-hoisting -mllvm -polly-loopfusion-greedy -mllvm -polly-run-inliner -mllvm -polly-run-dce -fno-math-errno -fno-trapping-math -falign-functions=32 -fno-semantic-interposition -fcf-protection=none -pipe -fexceptions -fveclib=libmvec -fgnuc-version=6.5.0"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-Wl,-O3,-Bsymbolic-functions,--as-needed,-z,lazy -fopenmp -fuse-ld=lld"
export ASFLAGS="-D__AVX__=1 -D__AVX2__=1 -D__FMA__=1"
export FCFLAGS="$CFLAGS"
export FFLAGS="$CFLAGS"
```

**Bug Nr. 1:**
```
Stack dump:
0.      Program arguments: clang -I../../lib -I../../lib/common -I../../programs -I. -DNDEBUG -O3 -march=native -mtune=native -mllvm -polly -mllvm -polly-parallel -mllvm -polly-vectorizer=polly -mllvm -polly-omp-backend=LLVM -mllvm -polly-num-threads=36 -mllvm -polly-scheduling=dynamic -mllvm -polly-scheduling-chunksize=1 -mllvm -polly-ast-use-context -mllvm -polly-invariant-load-hoisting -mllvm -polly-loopfusion-greedy -mllvm -polly-run-inliner -mllvm -polly-run-dce -fno-math-errno -fno-trapping-math -falign-functions=32 -fno-semantic-interposition -fcf-protection=none -pipe -fexceptions -fveclib=libmvec -fgnuc-version=6.5.0 -Wno-deprecated-declarations -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -Wpointer-arith -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wc++-compat -DXXH_NAMESPACE=ZSTD_ -DDEBUGLEVEL=0 -DZSTD_LEGACY_SUPPORT=5 -c -MT obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v06.o -MMD -MP -MF obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v06.d -o obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v06.o .//legacy/zstd_v06.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007f35dcb22603 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/bin/../lib/libLLVM-14.so+0x1c85603)
 #1 0x00007f35dcb21450 llvm::sys::RunSignalHandlers() (/usr/bin/../lib/libLLVM-14.so+0x1c84450)
 #2 0x00007f35dca204f9 (/usr/bin/../lib/libLLVM-14.so+0x1b834f9)
 #3 0x00007f35daaccda0 __restore_rt sigaction.c:0:0
 #4 0x00007f35ddbd01d2 (/usr/bin/../lib/libLLVM-14.so+0x2d331d2)
 #5 0x00007f35ddbcd413 (/usr/bin/../lib/libLLVM-14.so+0x2d30413)
 #6 0x00007f35ddbcb561 llvm::ADCEPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/bin/../lib/libLLVM-14.so+0x2d2e561)
 #7 0x00007f35df2c3aad (/usr/bin/../lib/libLLVM-14.so+0x4426aad)
 #8 0x00007f35dcd60abe llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/bin/../lib/libLLVM-14.so+0x1ec3abe)
 #9 0x00007f35dec7110d (/usr/bin/../lib/libLLVM-14.so+0x3dd410d)
#10 0x00007f35dcd657c8 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-14.so+0x1ec87c8)
#11 0x00007f35dec7436d (/usr/bin/../lib/libLLVM-14.so+0x3dd736d)
#12 0x00007f35dcd5df3d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-14.so+0x1ec0f3d)
#13 0x00007f35e1d783be (/usr/bin/../lib/libclang-cpp.so.14+0x22a33be)
#14 0x00007f35e1d6c2bd clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/bin/../lib/libclang-cpp.so.14+0x22972bd)
#15 0x00007f35e20cdcda (/usr/bin/../lib/libclang-cpp.so.14+0x25f8cda)
#16 0x00007f35e0c184b4 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/../lib/libclang-cpp.so.14+0x11434b4)
#17 0x00007f35e275d2f7 clang::FrontendAction::Execute() (/usr/bin/../lib/libclang-cpp.so.14+0x2c882f7)
#18 0x00007f35e26c86b2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/../lib/libclang-cpp.so.14+0x2bf36b2)
#19 0x00007f35e27d8e1d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/../lib/libclang-cpp.so.14+0x2d03e1d)
#20 0x00000000002133c8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-14+0x2133c8)
#21 0x0000000000210b8d (/usr/bin/clang-14+0x210b8d)
#22 0x00007f35e2350672 (/usr/bin/../lib/libclang-cpp.so.14+0x287b672)
#23 0x00007f35dca209f2 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/bin/../lib/libLLVM-14.so+0x1b839f2)
#24 0x00007f35e23505e5 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/usr/bin/../lib/libclang-cpp.so.14+0x287b5e5)
#25 0x00007f35e23138e3 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/usr/bin/../lib/libclang-cpp.so.14+0x283e8e3)
#26 0x00007f35e2313d57 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/usr/bin/../lib/libclang-cpp.so.14+0x283ed57)
#27 0x00007f35e234d348 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/usr/bin/../lib/libclang-cpp.so.14+0x2878348)
#28 0x000000000021035c main (/usr/bin/clang-14+0x21035c)
#29 0x00007f35daab7b25 __libc_start_main (/usr/bin/../lib/libc.so.6+0x27b25)
#30 0x000000000020d88e _start (/usr/bin/clang-14+0x20d88e)
clang-14: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 14.0.0 (/home/marcus/Downloads/llvm-git/llvm-project 36af07334246a87a0f3fb9bbc85dedfca04b00d1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-14: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-14: note: diagnostic msg: /tmp/zstd_v06-ac72da.c
clang-14: note: diagnostic msg: /tmp/zstd_v06-ac72da.sh
```

[zstd_v06-ac72da.zip](https://github.com/llvm/llvm-project/files/7849967/zstd_v06-ac72da.zip)


**Bug Nr. 2:**

```
********************
make[2]: *** [Makefile:210: obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v06.o] Fehler 139
make[2]: *** Es wird auf noch nicht beendete Prozesse gewartet....
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -I../../lib -I../../lib/common -I../../programs -I. -DNDEBUG -O3 -march=native -mtune=native -mllvm -polly -mllvm -polly-parallel -mllvm -polly-vectorizer=polly -mllvm -polly-omp-backend=LLVM -mllvm -polly-num-threads=36 -mllvm -polly-scheduling=dynamic -mllvm -polly-scheduling-chunksize=1 -mllvm -polly-ast-use-context -mllvm -polly-invariant-load-hoisting -mllvm -polly-loopfusion-greedy -mllvm -polly-run-inliner -mllvm -polly-run-dce -fno-math-errno -fno-trapping-math -falign-functions=32 -fno-semantic-interposition -fcf-protection=none -pipe -fexceptions -fveclib=libmvec -fgnuc-version=6.5.0 -Wno-deprecated-declarations -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -Wpointer-arith -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wc++-compat -DXXH_NAMESPACE=ZSTD_ -DDEBUGLEVEL=0 -DZSTD_LEGACY_SUPPORT=5 -c -MT obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v07.o -MMD -MP -MF obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v07.d -o obj/conf_fb0c8230f5a260dbdafa48796dfa6e66/static/zstd_v07.o .//legacy/zstd_v07.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007fbab5f96603 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/bin/../lib/libLLVM-14.so+0x1c85603)
 #1 0x00007fbab5f95450 llvm::sys::RunSignalHandlers() (/usr/bin/../lib/libLLVM-14.so+0x1c84450)
 #2 0x00007fbab5e944f9 (/usr/bin/../lib/libLLVM-14.so+0x1b834f9)
 #3 0x00007fbab3f40da0 __restore_rt sigaction.c:0:0
 #4 0x00007fbab70441d2 (/usr/bin/../lib/libLLVM-14.so+0x2d331d2)
 #5 0x00007fbab7041413 (/usr/bin/../lib/libLLVM-14.so+0x2d30413)
 #6 0x00007fbab703f561 llvm::ADCEPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/bin/../lib/libLLVM-14.so+0x2d2e561)
 #7 0x00007fbab8737aad (/usr/bin/../lib/libLLVM-14.so+0x4426aad)
 #8 0x00007fbab61d4abe llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/bin/../lib/libLLVM-14.so+0x1ec3abe)
 #9 0x00007fbab80e510d (/usr/bin/../lib/libLLVM-14.so+0x3dd410d)
#10 0x00007fbab61d97c8 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-14.so+0x1ec87c8)
#11 0x00007fbab80e836d (/usr/bin/../lib/libLLVM-14.so+0x3dd736d)
#12 0x00007fbab61d1f3d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/bin/../lib/libLLVM-14.so+0x1ec0f3d)
#13 0x00007fbabb1ec3be (/usr/bin/../lib/libclang-cpp.so.14+0x22a33be)
#14 0x00007fbabb1e02bd clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/bin/../lib/libclang-cpp.so.14+0x22972bd)
#15 0x00007fbabb541cda (/usr/bin/../lib/libclang-cpp.so.14+0x25f8cda)
#16 0x00007fbaba08c4b4 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/../lib/libclang-cpp.so.14+0x11434b4)
#17 0x00007fbabbbd12f7 clang::FrontendAction::Execute() (/usr/bin/../lib/libclang-cpp.so.14+0x2c882f7)
#18 0x00007fbabbb3c6b2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/../lib/libclang-cpp.so.14+0x2bf36b2)
#19 0x00007fbabbc4ce1d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/../lib/libclang-cpp.so.14+0x2d03e1d)
#20 0x00000000002133c8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-14+0x2133c8)
#21 0x0000000000210b8d (/usr/bin/clang-14+0x210b8d)
#22 0x00007fbabb7c4672 (/usr/bin/../lib/libclang-cpp.so.14+0x287b672)
#23 0x00007fbab5e949f2 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/bin/../lib/libLLVM-14.so+0x1b839f2)
#24 0x00007fbabb7c45e5 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/usr/bin/../lib/libclang-cpp.so.14+0x287b5e5)
#25 0x00007fbabb7878e3 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/usr/bin/../lib/libclang-cpp.so.14+0x283e8e3)
#26 0x00007fbabb787d57 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/usr/bin/../lib/libclang-cpp.so.14+0x283ed57)
#27 0x00007fbabb7c1348 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/usr/bin/../lib/libclang-cpp.so.14+0x2878348)
#28 0x000000000021035c main (/usr/bin/clang-14+0x21035c)
#29 0x00007fbab3f2bb25 __libc_start_main (/usr/bin/../lib/libc.so.6+0x27b25)
#30 0x000000000020d88e _start (/usr/bin/clang-14+0x20d88e)
clang-14: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 14.0.0 (/home/marcus/Downloads/llvm-git/llvm-project 36af07334246a87a0f3fb9bbc85dedfca04b00d1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-14: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-14: note: diagnostic msg: /tmp/zstd_v07-4f39b6.c
clang-14: note: diagnostic msg: /tmp/zstd_v07-4f39b6.sh
```
[zstd_v07-4f39b6.zip](https://github.com/llvm/llvm-project/files/7849960/zstd_v07-4f39b6.zip)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to