Package: clang-3.7
Version: 1:3.7.1-1+b1
Severity: serious
Justification: segfault
Hi,
packaging a new upstream version of afl we've discovered that there's a problem
with current
clang-3.7 on s390x (2.08b-3 build against clang-3.7/llvm-3.7-dev today) [1].
Probe case (provided by Michael Zalewski) tested on s390x porterbox:
$ echo 'int main() { printf("%p\n", __builtin_return_address(0)); return 0; }'
> test.c
$ clang-3.7 -g -O2 -fPIE -fPIC test.c
test.c:1:14: warning: implicitly declaring library function 'printf' with type
'int (const char *, ...)'
int main() { printf("%p\n", __builtin_return_address(0)); return 0; }
^
test.c:1:14: note: include the header or explicitly provide a
declaration for 'printf'
0 libLLVM-3.7.so.1 0x03fffbf1007e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 38
1 libLLVM-3.7.so.1 0x03fffbf0f2be
2 libLLVM-3.7.so.1 0x03976dcc
3 libLLVM-3.7.so.1 0x03fffc6b2e3a
llvm::SystemZTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&)
const + 74
4 libLLVM-3.7.so.1 0x03fffbd2c13e
5 libLLVM-3.7.so.1 0x03fffbd2ecea llvm::SelectionDAG::Legalize() + 418
6 libLLVM-3.7.so.1 0x03fffbe3af70
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 616
7 libLLVM-3.7.so.1 0x03fffbe3f26e
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 1126
8 libLLVM-3.7.so.1 0x03fffbe40cfe
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1078
9 libLLVM-3.7.so.1 0x03fffb500710
llvm::FPPassManager::runOnFunction(llvm::Function&) + 584
10 libLLVM-3.7.so.1 0x03fffb500a0e
llvm::FPPassManager::runOnModule(llvm::Module&) + 54
11 libLLVM-3.7.so.1 0x03fffb5002be
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 990
12 clang0x804f274c
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*)
+ 2700
13 clang0x804da5c8
14 clang0x806fdcac clang::ParseAST(clang::Sema&, bool,
bool) + 868
15 clang0x802ff7f6 clang::FrontendAction::Execute() + 622
16 clang0x802d1fd6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 398
17 clang0x802b58aa
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2346
18 clang0x802af932 cc1_main(llvm::ArrayRef,
char const*, void*) + 2754
19 clang0x802abc4c main + 1380
20 libc.so.60x03fffa8be4c0 __libc_start_main + 272
21 clang0x802ae6d6
Stack dump:
0. Program arguments: /usr/lib/llvm-3.7/bin/clang -cc1 -triple
s390x-ibm-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-main-file-name test.c -mrelocation-model pic -pic-level 2
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -fuse-
init-array -target-cpu z10 -target-linker-version 2.26
-momit-leaf-frame-pointer -g -dwarf-column-info -resource-dir
/usr/lib/llvm-3.7/bin/../lib/clang/3.7.1 -internal-isystem /usr/local/include
-internal-isystem /usr/lib/llvm-3.7/bin/../lib/clang/3.7.1/include
-internal-externc-isystem /usr/include/s390x-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdebug-compilation-dir /home/stender -ferror-limit 19 -fmessage-length
105 -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/test-ea55f5.o -x c test.c
1. parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'test.c'.
4. Running pass 'SystemZ DAG->DAG Pattern Instruction Selection' on
function '@main'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Debian clang version 3.7.1-2 (tags/RELEASE_371/final) (based on LLVM 3.7.1)
Target: s390x-ibm-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://bugs.debian.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/test-e9248d.c
clang: note: diagnostic msg: /tmp/test-e9248d.sh
clang: note: diagnostic msg:
BTW, this is a regression from clang-3.6 (2.08b-1 and -2 have been build
against clang-3.6/llvm-3.6-dev yesterday with same result) [2], so please
reassign or clone that bug report if found suitable.
Thanks,
DS
[1] https://bugs.debian.org/818288 (afl: FTBFS on s390x)
[2] https://buildd.debian.org/status/logs.php?pkg=afl&arch=s390x
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500