[LLVMbugs] [Bug 19330] New: __builtin_setjmp with jmp_buf in a struct causes `fatal error in backend' or segmentation fault

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 3 19:09:32 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19330

            Bug ID: 19330
           Summary: __builtin_setjmp with jmp_buf in a struct causes
                    `fatal error in backend' or segmentation fault
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nobu at ruby-lang.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12337
  --> http://llvm.org/bugs/attachment.cgi?id=12337&action=edit
minimal code to reproduce the error

Compiling the attached source with `-O', clang aborts with fatal error, linker
error, or segmentation fault.

On MacOS X:

$ clang -v
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

$ clang -arch x86_64 -O -c clang_bug.c 
clang_bug.c:11:29: warning: incompatible pointer types passing 'jmp_buf' (aka
'int [37]') to parameter of type 'void **' [-Wincompatible-pointer-types]
    (void)(__builtin_setjmp(tag.buf) ? 1 : 0);
                            ^~~~~~~
fatal error: error in backend: unsupported relocation of undefined symbol
'LBB0_-1'

$ clang -arch i386 -O -c clang_bug.c 
clang_bug.c:11:29: warning: incompatible pointer types passing 'jmp_buf' (aka
'int [18]') to parameter of type 'void **' [-Wincompatible-pointer-types]
    (void)(__builtin_setjmp(tag.buf) ? 1 : 0);
                            ^~~~~~~
Stack dump:
0.    Program arguments:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-cc1 -triple i386-apple-macosx10.9.0 -emit-obj -disable-free
-disable-llvm-verifier -main-file-name clang_bug.c -mrelocation-model pic
-pic-level 2 -mdisable-fp-elim -masm-verbose -target-cpu yonah
-target-linker-version 236.3 -coverage-file
/Users/nobu/src/ruby/trunk/src/clang_bug.o -resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1
-O2 -fdebug-compilation-dir /Users/nobu/src/ruby/trunk/src -ferror-limit 19
-fmessage-length 238 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-fragile-10.9.0 -fencode-extended-block-signature
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o clang_bug.o -x c clang_bug.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'clang_bug.c'.
4.    Running pass 'Machine Common Subexpression Elimination' on function
'@jump'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: i386-apple-darwin13.1.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://developer.apple.com/bugreporter/ 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:
/var/folders/k_/fqcsxh9x35j1f9q463bj01zw0000gn/T/clang_bug-59499f.c
clang: note: diagnostic msg:
/var/folders/k_/fqcsxh9x35j1f9q463bj01zw0000gn/T/clang_bug-59499f.sh
clang: note: diagnostic msg: 

********************

On x86_64-linux clang 34 and FreeBSD clang 3.3:
test.c:10:27: warning: incompatible pointer types passing 'jmp_buf' (aka
'struct __jmp_buf_tag [1]') to parameter of type 'void **'
[-Wincompatible-pointer-types]
(void)(__builtin_setjmp(tag.buf) ? 1 : 0);
^~~~~~~
1 warning generated.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
/tmp/test-11ca81.o: In function `jump':
test.c:(.text+0x26): undefined reference to `.LBB0_-1'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

-- 
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/20140404/6f5a2a99/attachment.html>


More information about the llvm-bugs mailing list