[LLVMbugs] [Bug 9334] New: Not overriding TargetMachine virtual methods causes clang to crash without indication why

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 26 02:09:39 PST 2011


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

           Summary: Not overriding TargetMachine virtual methods causes
                    clang to crash without indication why
           Product: libraries
           Version: trunk
          Platform: Macintosh
               URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-Februa
                    ry/038174.html
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Target Description Classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: andreas.faerber at web.de
                CC: llvmbugs at cs.uiuc.edu


Apparently, not overriding llvm::LLVMTargetMachine methods like getFrameInfo()
and getSelectionDAGInfo() caused clang to crash with an error message like
this:

$ Debug+Asserts/bin/clang -ccc-host-triple stm8-unknown-elf ../hello.c -S -o
../hello.s
0  clang             0x0168c4f0 llvm::SearchForAddressOfSpecialSymbol(char
const*) + 448
1  clang             0x0168cc8c llvm::sys::RunInterruptHandlers() + 456
2  libSystem.B.dylib 0x9422d9fc _sigtramp + 68
3  clang             0x0159692c std::_Rb_tree<void const*, std::pair<void
const* const, llvm::Pass*>, std::_Select1st<std::pair<void const* const,
llvm::Pass*> >, std::less<void const*>, std::allocator<std::pair<void const*
const, llvm::Pass*> > >::_M_insert(std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::pair<void const* const, llvm::Pass*> const&) +
132
4  clang             0x0f1c1cc0 std::_Rb_tree<void const*, std::pair<void
const* const, llvm::Pass*>, std::_Select1st<std::pair<void const* const,
llvm::Pass*> >, std::less<void const*>, std::allocator<std::pair<void const*
const, llvm::Pass*> > >::_M_insert(std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::pair<void const* const, llvm::Pass*> const&) +
230863896
Stack dump:
0.    Program arguments:
/Users/andreas/STM8S-Discovery/llvm-stm8/Debug+Asserts/bin/clang -cc1 -triple
stm8-unknown-elf -S -disable-free -main-file-name hello.c -mrelocation-model
static -mdisable-fp-elim -mconstructor-aliases -target-linker-version 85.2.1
-momit-leaf-frame-pointer -resource-dir
/Users/andreas/STM8S-Discovery/llvm-stm8/Debug+Asserts/bin/../lib/clang/2.9
-ferror-limit 19 -fmessage-length 274 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o ../hello.s -x c ../hello.c
1.    <eof> parser at end of file
clang: error: unable to execute command: Bus error
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

Expected behavior:

This should either not compile at all or trigger an assert() indicating what
needs to be implemented.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list