Bug#818380: clang-3.7: segfaults on s390x

Daniel Stender stender at debian.org
Wed Mar 16 16:05:08 UTC 2016


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:

<cut>
$ 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 <stdio.h> or explicitly provide a declaration for 'printf'
0  libLLVM-3.7.so.1 0x000003fffbf1007e llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 38
1  libLLVM-3.7.so.1 0x000003fffbf0f2be
2  libLLVM-3.7.so.1 0x000003ffff976dcc
3  libLLVM-3.7.so.1 0x000003fffc6b2e3a llvm::SystemZTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const + 74
4  libLLVM-3.7.so.1 0x000003fffbd2c13e
5  libLLVM-3.7.so.1 0x000003fffbd2ecea llvm::SelectionDAG::Legalize() + 418
6  libLLVM-3.7.so.1 0x000003fffbe3af70 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 616
7  libLLVM-3.7.so.1 0x000003fffbe3f26e llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 1126
8  libLLVM-3.7.so.1 0x000003fffbe40cfe llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1078
9  libLLVM-3.7.so.1 0x000003fffb500710 llvm::FPPassManager::runOnFunction(llvm::Function&) + 584
10 libLLVM-3.7.so.1 0x000003fffb500a0e llvm::FPPassManager::runOnModule(llvm::Module&) + 54
11 libLLVM-3.7.so.1 0x000003fffb5002be llvm::legacy::PassManagerImpl::run(llvm::Module&) + 990
12 clang            0x00000000804f274c 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 clang            0x00000000804da5c8
14 clang            0x00000000806fdcac clang::ParseAST(clang::Sema&, bool, bool) + 868
15 clang            0x00000000802ff7f6 clang::FrontendAction::Execute() + 622
16 clang            0x00000000802d1fd6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 398
17 clang            0x00000000802b58aa clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2346
18 clang            0x00000000802af932 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2754
19 clang            0x00000000802abc4c main + 1380
20 libc.so.6        0x000003fffa8be4c0 __libc_start_main + 272
21 clang            0x00000000802ae6d6
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.	<eof> 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:
</cut>

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, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages clang-3.7 depends on:
ii  binutils                 2.26-5
ii  libc6                    2.21-9
ii  libc6-dev                2.21-9
ii  libclang-common-3.7-dev  1:3.7.1-1+b1
ii  libclang1-3.7            1:3.7.1-1+b1
ii  libedit2                 3.1-20150325-1+b1
ii  libffi6                  3.2.1-4
ii  libgcc-5-dev             5.3.1-10
ii  libgcc1                  1:5.3.1-10
ii  libllvm3.7               1:3.7.1-1+b1
ii  libobjc-5-dev            5.3.1-10
ii  libstdc++-5-dev          5.3.1-10
ii  libstdc++6               5.3.1-10
ii  libtinfo5                6.0+20160213-1
ii  zlib1g                   1:1.2.8.dfsg-2+b1

Versions of packages clang-3.7 recommends:
ii  llvm-3.7-dev  1:3.7.1-1+b1
ii  python        2.7.11-1

Versions of packages clang-3.7 suggests:
pn  clang-3.7-doc  <none>
pn  gnustep        <none>
pn  gnustep-devel  <none>

-- no debconf information



More information about the Pkg-llvm-team mailing list