[LLVMdev] : SIGSEGV in compiled programs during stack unwinding

Chaos A.D. chaos.a.d88 at gmail.com
Fri Nov 19 08:23:22 PST 2010


It seemed I found possible llvm-g++ bug.
Programs compiled with llvm-g++ 4.5 crashed with SIGSEGV during stack
unwinding in such testcase:

chaos at chaos-desktop ~ % g++ --version
g++ (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1

chaos at chaos-desktop ~ % echo "struct X{ ~X(){} }; int main() { X x; throw 1;
}" > test.cpp && g++ test.cpp && ./a.out
terminate called after throwing an instance of 'int'
zsh: abort      ./a.out



chaos at chaos-desktop ~ % echo "struct X{ ~X(){} }; int main() { X x; throw 1;
}" > test.cpp && llvm-g++ test.cpp && ./a.out
zsh: segmentation fault  ./a.out

chaos at chaos-desktop ~ % llvm-g++ --version
g++-4.5 (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1

chaos at chaos-desktop ~ % valgrind ./a.out

==19523== Memcheck, a memory error detector
==19523== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==19523== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
copyright info
==19523== Command: ./a.out
==19523==
vex x86->IR: unhandled instruction bytes: 0x36 0xE1 0xBE 0x0
==19523==
==19523== Process terminating with default action of signal 11 (SIGSEGV)
==19523==  Bad permissions for mapped region at address 0x42CAFF4
==19523==    at 0x42D1068: ???
==19523==    by 0x4187CE6: (below main) (libc-start.c:226)
==19523==
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101119/ddd30357/attachment.html>


More information about the llvm-dev mailing list