[LLVMbugs] [Bug 18652] New: Crash with va_list using -mcmodel=medium and -fPIC

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 28 23:23:47 PST 2014


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

            Bug ID: 18652
           Summary: Crash with va_list using -mcmodel=medium and -fPIC
           Product: new-bugs
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: zev at bewilderbeest.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Attempting to compile the following code using -mcmodel=medium and -fPIC on
clang 3.4 (built from release tarball with gcc 4.8.2) yields a crash:

[zev at host: tmp]% cat foo.i
extern char c;
void f(char, __builtin_va_list);
void g(void)
{
 __builtin_va_list v;
 f(c, v);
}
[zev at host: tmp]% /var/tmp/unsup-test/llvm-3.4/bin/clang -c -mcmodel=medium
-fPIC -o foo.o foo.i
Unimplemented
UNREACHABLE executed at
/var/tmp/unsup-test/llvm-3.4/src/llvm-3.4/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp:107!
0  clang           0x000000000232e462 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang           0x000000000232e084
2  libpthread.so.0 0x000000354fa0f710
3  libc.so.6       0x000000354ee32925 gsignal + 53
4  libc.so.6       0x000000354ee34105 abort + 373
5  clang           0x000000000231b08c
6  clang           0x0000000002160ccc
7  clang           0x000000000217c938
8  clang           0x0000000002195b7a
llvm::MCAssembler::handleFixup(llvm::MCAsmLayout const&, llvm::MCFragment&,
llvm::MCFixup const&) + 106
9  clang           0x0000000002198d63 llvm::MCAssembler::Finish() + 707
10 clang           0x0000000001c65fc3
llvm::AsmPrinter::doFinalization(llvm::Module&) + 1299
11 clang           0x00000000022b9549
llvm::FPPassManager::doFinalization(llvm::Module&) + 153
12 clang           0x00000000022c06e3
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 963
13 clang           0x00000000009a9cfb
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 2283
14 clang           0x00000000009a779c
15 clang           0x0000000000b2186b clang::ParseAST(clang::Sema&, bool, bool)
+ 507
16 clang           0x00000000009a5d4c clang::CodeGenAction::ExecuteAction() +
60
17 clang           0x000000000082de29 clang::FrontendAction::Execute() + 249
18 clang           0x000000000080ce60
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352
19 clang           0x00000000007f5b61
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1857
20 clang           0x00000000007f0bf8 cc1_main(char const**, char const**, char
const*, void*) + 1208
21 clang           0x00000000007d0180 main + 688
22 libc.so.6       0x000000354ee1ed1d __libc_start_main + 253
23 clang           0x00000000007efa3d
Stack dump:
0.      Program arguments: /var/tmp/unsup-test/llvm-3.4/amd64_rhel6/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name foo.i -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -mcode-model
medium -target-cpu x86-64 -target-linker-version 2.20.51.0.2 -coverage-file
/tmp/foo.o -resource-dir
/var/tmp/unsup-test/llvm-3.4/amd64_rhel6/bin/../lib/clang/3.4
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 106
-mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o foo.o -x cpp-output foo.i 
1.      <eof> parser at end of file
2.      Code generation
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix


In addition to the va_list and flags, it also appears dependent on the
extern-ness of the declaration of 'c' -- removing that avoids the crash.

-- 
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/20140129/2bf72fc0/attachment.html>


More information about the llvm-bugs mailing list