llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.07k stars 11.99k forks source link

Clang crashed when building with -fstack-protector-all -fcatch-undefined-behavior #21128

Closed llvmbot closed 1 year ago

llvmbot commented 10 years ago
Bugzilla Link 20754
Version 3.4
OS Linux
Attachments Preprocessed source and run script, Preprocessed source and run script form clang3.5
Reporter LLVM Bugzilla Contributor

Extended Description

libtool: compile: clang -DHAVE_CONFIG_H -I. -I./include -I./celt -I./silk -I./silk/float -I./silk/fixed -O1 -g -fstack-protector-all -fcatch-undefined-behavior -fvisibility=hidden -W -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -MT silk/fixed/solve_LS_FIX.lo -MD -MP -MF silk/fixed/.deps/solve_LS_FIX.Tpo -c silk/fixed/solve_LS_FIX.c -fPIC -DPIC -o silk/fixed/.libs/solve_LS_FIX.o clang: warning: argument '-fcatch-undefined-behavior' is deprecated, use '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error' instead libtool: compile: clang -DHAVE_CONFIG_H -I. -I./include -I./celt -I./silk -I./silk/float -I./silk/fixed -O1 -g -fstack-protector-all -fcatch-undefined-behavior -fvisibility=hidden -W -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -MT silk/fixed/warped_autocorrelation_FIX_neon.lo -MD -MP -MF silk/fixed/.deps/warped_autocorrelation_FIX_neon.Tpo -c silk/fixed/warped_autocorrelation_FIX_neon.c -fPIC -DPIC -o silk/fixed/.libs/warped_autocorrelation_FIX_neon.o clang: warning: argument '-fcatch-undefined-behavior' is deprecated, use '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error' instead Stack dump:

  1. Program arguments: /usr/bin/clang -cc1 -triple armv7-unknown-linux-gnueabihf -S -disable-free -disable-llvm-verifier -main-file-name warped_autocorrelation_FIX_neon.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -fmath-errno -mconstructor-aliases -fuse-init-array -target-cpu cortex-a8 -target-abi aapcs-linux -mfloat-abi hard -target-linker-version 2.24 -g -coverage-file /tmp/warped_autocorrelation_FIX_neon-f6a71e.s -resource-dir /usr/bin/../lib/clang/3.4.2 -dependency-file silk/fixed/.deps/warped_autocorrelation_FIX_neon.Tpo -sys-header-deps -MP -MT silk/fixed/warped_autocorrelation_FIX_neon.lo -D HAVE_CONFIG_H -D PIC -I . -I ./include -I ./celt -I ./silk -I ./silk/float -I ./silk/fixed -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.4.2/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O1 -W -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -fno-dwarf-directory-asm -fdebug-compilation-dir /home/lorca/src/opus -ferror-limit 19 -fmessage-length 150 -fvisibility hidden -fsanitize=alignment,array-bounds,bool,enum,float-cast-overflow,float-divide-by-zero,integer-divide-by-zero,null,object-size,return,shift,signed-integer-overflow,unreachable,vla-bound -fsanitize-undefined-trap-on-error -stack-protector 2 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/warped_autocorrelation_FIX_neon-f6a71e.s -x c silk/fixed/warped_autocorrelation_FIX_neon.c
  2. parser at end of file
  3. silk/fixed/warped_autocorrelation_FIX_neon.c:52:6 : LLVM IR generation of declaration 'silk_warped_autocorrelation_FIX'
  4. silk/fixed/warped_autocorrelation_FIX_neon.c:52:6 : Generating code for declaration 'silk_warped_autocorrelation_FIX'
  5. silk/fixed/warped_autocorrelation_FIX_neon.c:70:35: LLVM IR generation of compound statement ('{}')
  6. silk/fixed/warped_autocorrelation_FIX_neon.c:84:9 : LLVM IR generation of compound statement ('{}')
  7. silk/fixed/warped_autocorrelation_FIX_neon.c:84:9 : LLVM IR generation of compound statement ('{}')
  8. silk/fixed/warped_autocorrelation_FIX_neon.c:84:9 : LLVM IR generation of compound statement ('{}') clang: error: unable to execute command: Segmentation fault clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.4.2 (tags/RELEASE_34/dot2-final) Target: armv7l-unknown-linux-gnueabihf libtool: compile: clang -DHAVE_CONFIG_H -I. -I./include -I./celt -I./silk -I./silk/float -I./silk/fixed -O1 -g -fstack-protector-all -fcatch-undefined-behavior -fvisibility=hidden -W -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -MT silk/fixed/solve_LS_FIX.lo -MD -MP -MF silk/fixed/.deps/solve_LS_FIX.Tpo -c silk/fixed/solve_LS_FIX.c -o silk/fixed/solve_LS_FIX.o >/dev/null 2>&1 Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg:
Endilll commented 1 year ago

Appears to be fixed in Clang 3.7: https://godbolt.org/z/cTzfza3c9 Reduced by C-Reduce:

typedef __attribute__((neon_vector_type(2))) long long int64x2_t;
int64x2_t vmull_s32_corr_QC_neon_4, vmull_s32___s1;
void vmull_s32() {
  __builtin_neon_vsraq_n_v(vmull_s32_corr_QC_neon_4, vmull_s32___s1, 1 - 0, 35);
}
llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-codegen