[llvm-bugs] [Bug 27060] New: segfault with __builtin_return_address() on s390x

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 24 14:18:52 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27060

            Bug ID: 27060
           Summary: segfault with __builtin_return_address() on s390x
           Product: clang
           Version: 3.7
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: daniel at danielstender.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Hi,

we've discovered that there is a segfault with __builtin_return_address() on
s390x (e.g. IBM z196 enterprise mainframe):

test.c:
#include <stdio.h>
int main() { printf("%p\n", __builtin_return_address(0)); return 0; }

<log>
$ clang-3.7 -o test test.c 
0  libLLVM-3.7.so.1 0x000003fffbca207e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 38
1  libLLVM-3.7.so.1 0x000003fffbca12be
2  libLLVM-3.7.so.1 0x000003ffff80192c
3  libLLVM-3.7.so.1 0x000003fffc444e3a
llvm::SystemZTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&)
const + 74
4  libLLVM-3.7.so.1 0x000003fffbabe13e
5  libLLVM-3.7.so.1 0x000003fffbac0cea llvm::SelectionDAG::Legalize() + 418
6  libLLVM-3.7.so.1 0x000003fffbbccf70
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 616
7  libLLVM-3.7.so.1 0x000003fffbbd126e
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 1126
8  libLLVM-3.7.so.1 0x000003fffbbd2cfe
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1078
9  libLLVM-3.7.so.1 0x000003fffb292710
llvm::FPPassManager::runOnFunction(llvm::Function&) + 584
10 libLLVM-3.7.so.1 0x000003fffb292a0e
llvm::FPPassManager::runOnModule(llvm::Module&) + 54
11 libLLVM-3.7.so.1 0x000003fffb2922be
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        0x000003fffa6504c0 __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 -mrelax-all -disable-free -disable-llvm-verifier
-main-file-name test.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-fuse-init-array -target-cpu z10 -target-linker-version 2.26 -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 -fdebug-compilation-dir /home/stender
-ferror-limit 19 -fmessage-length 105 -mstackrealign -fno-signed-char
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/test-a4ff09.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
</log>

The clang is 3.7.1, but the same errors occurs throughout clang-3.6 to
clang-3.8 versions.

Thanks,
DS

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160324/b71f6804/attachment.html>


More information about the llvm-bugs mailing list