[LLVMbugs] [Bug 9743] New: segfault in exception unwinding

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 18 07:45:11 PDT 2011


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

           Summary: segfault in exception unwinding
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ps at kr.tuwien.ac.at
                CC: llvmbugs at cs.uiuc.edu


Between 129483 and 129545 some bug was introduced into the exception unwinding
of clang. It now segfaults for some testcases I have (unfortunately only in big
system testcases).

The clang "make check" also failed during that night, but this failure was
fixed and on the next day with revision 129619 "make check" of clang worked
again but I still get the segfaults.

Basic situation: I have nightly builds of clang trunk, boost trunk, and the
software I co-maintain, dlvhex. http://sourceforge.net/projects/dlvhex/

Starting on April 15th (between nightly builds of the two revisions above) I
started getting segfaults for runs of software compiled with clang, and only
for cases where exceptions are thrown (they are no unexpected exceptions, so
when compiling with gcc they are caught and processed and there is no
segfault).

So far I was not able to produce a minimal testcase.

Here are some gdb backtraces of the segfaults, perhaps this will help:

buildbot at gluck:/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/examples$
../src/dlvhex/gdbdlvhex -s --plugindir=../testsuite/ 
../examples/tests//../builtin_safety1c.hex
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/.libs/lt-dlvhex...done.
Starting program:
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/.libs/lt-dlvhex
-s --plugindir=../testsuite/ ../examples/tests//../builtin_safety1c.hex
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
linear_search_fdes (ob=0x7fffffffd5a0, this_fde=0x7ffff7d2e68c,
pc=0x7ffff78e890c)
    at ../../../src/libgcc/../gcc/unwind-dw2-fde.c:774
774     ../../../src/libgcc/../gcc/unwind-dw2-fde.c: No such file or directory.
        in ../../../src/libgcc/../gcc/unwind-dw2-fde.c
(gdb) bt
#0  linear_search_fdes (ob=0x7fffffffd5a0, this_fde=0x7ffff7d2e68c,
pc=0x7ffff78e890c)
    at ../../../src/libgcc/../gcc/unwind-dw2-fde.c:774
#1  0x00007ffff68d0ee4 in _Unwind_IteratePhdrCallback (info=<value optimized
out>, size=<value optimized out>,
    ptr=0x7fffffffd6d0) at
../../../src/libgcc/../gcc/unwind-dw2-fde-glibc.c:395
#2  0x00007ffff66619a6 in __dl_iterate_phdr (callback=0x7ffff68d0cd0
<_Unwind_IteratePhdrCallback>,
    data=0x7fffffffd6d0) at dl-iteratephdr.c:75
#3  0x00007ffff68d1657 in _Unwind_Find_FDE (pc=0x7ffff78e890c,
bases=0x7fffffffd9c8)
    at ../../../src/libgcc/../gcc/unwind-dw2-fde-glibc.c:426
#4  0x00007ffff68ceb88 in uw_frame_state_for (context=0x7fffffffd920,
fs=0x7fffffffd7a0)
    at ../../../src/libgcc/../gcc/unwind-dw2.c:1128
#5  0x00007ffff68cf6be in _Unwind_RaiseException (exc=0x654700) at
../../../src/libgcc/../gcc/unwind.inc:100
#6  0x00007ffff6e12a31 in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0x00007ffff78e890d in operator() (this=<value optimized out>) at
SafetyChecker.cpp:370
#8  0x00007ffff78f5067 in safetyCheck (this=<value optimized out>, ctx=<value
optimized out>) at State.cpp:504
#9  0x000000000041a3df in main (argc=<value optimized out>, argv=<value
optimized out>) at dlvhex.cpp:387
(gdb)





buildbot at gluck:/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/examples$
../src/dlvhex/gdbdlvhex -s --plugindir=../testsuite/ 
../examples/tests//../rec_agg_bug1.hex
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/.libs/lt-dlvhex...done.
Starting program:
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/.libs/lt-dlvhex
-s --plugindir=../testsuite/ ../examples/tests//../rec_agg_bug1.hex
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
linear_search_fdes (ob=0x7fffffffc560, this_fde=0x7ffff7998bb4,
pc=0x7ffff755ea1f)
    at ../../../src/libgcc/../gcc/unwind-dw2-fde.c:774
774     ../../../src/libgcc/../gcc/unwind-dw2-fde.c: No such file or directory.
        in ../../../src/libgcc/../gcc/unwind-dw2-fde.c
(gdb) bt
#0  linear_search_fdes (ob=0x7fffffffc560, this_fde=0x7ffff7998bb4,
pc=0x7ffff755ea1f)
    at ../../../src/libgcc/../gcc/unwind-dw2-fde.c:774
#1  0x00007ffff68d0ee4 in _Unwind_IteratePhdrCallback (info=<value optimized
out>, size=<value optimized out>,
    ptr=0x7fffffffc690) at
../../../src/libgcc/../gcc/unwind-dw2-fde-glibc.c:395
#2  0x00007ffff66619a6 in __dl_iterate_phdr (callback=0x7ffff68d0cd0
<_Unwind_IteratePhdrCallback>,
    data=0x7fffffffc690) at dl-iteratephdr.c:75
#3  0x00007ffff68d1657 in _Unwind_Find_FDE (pc=0x7ffff755ea1f,
bases=0x7fffffffc988)
    at ../../../src/libgcc/../gcc/unwind-dw2-fde-glibc.c:426
#4  0x00007ffff68ceb88 in uw_frame_state_for (context=0x7fffffffc8e0,
fs=0x7fffffffc760)
    at ../../../src/libgcc/../gcc/unwind-dw2.c:1128
#5  0x00007ffff68cf6be in _Unwind_RaiseException (exc=0x6539a0) at
../../../src/libgcc/../gcc/unwind.inc:100
#6  0x00007ffff6e12a31 in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0x00007ffff755ea20 in boost::throw_exception (e=<value optimized out>)
    at
/var/lib/buildbot/instdirs/boost-release/include/boost-1_46/boost/throw_exception.hpp:61
#8  0x00007ffff755e8f5 in operator() (this=<value optimized out>,
component=<value optimized out>)
    at
/var/lib/buildbot/instdirs/boost-release/include/boost-1_46/boost/spirit/home/qi/detail/expect_function.hpp:84
#9  0x00007ffff755e812 in linear_any (this=Unhandled dwarf expression opcode
0x0
)
    at
/var/lib/buildbot/instdirs/boost-release/include/boost-1_46/boost/fusion/algorithm/query/detail/any.hpp:37
#10 linear_any (this=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:39
#11 any (this=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:51
#12 any (this=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:30
#13 any_if (this=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:211
#14 parse_impl (this=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:85
#15 0x00007ffff755e6ec in parse (function_obj_ptr=<value optimized out>,
a0=<value optimized out>,
    a1=<value optimized out>, a2=<value optimized out>, a3=<value optimized
out>)
    at
/var/lib/buildbot/instdirs/boost-release/include/boost-1_46/boost/spirit/home/qi/operator/sequence_base.hpp:117
#16 call (function_obj_ptr=<value optimized out>, a0=<value optimized out>,
a1=<value optimized out>,
    a2=<value optimized out>, a3=<value optimized out>) at
DLVresultParserDriver.cpp:43
#17 operator() (function_obj_ptr=<value optimized out>, a0=<value optimized
out>, a1=<value optimized out>,
    a2=<value optimized out>, a3=<value optimized out>) at
DLVresultParserDriver.cpp:53
#18 invoke (function_obj_ptr=<value optimized out>, a0=<value optimized out>,
a1=<value optimized out>,
    a2=<value optimized out>, a3=<value optimized out>) at
DLVresultParserDriver.cpp:132
#19 0x00007ffff755c94c in operator() (this=Unhandled dwarf expression opcode
0x0
)
    at
/var/lib/buildbot/instdirs/boost-release/include/boost-1_46/boost/function/function_template.hpp:1012
#20 0x00007ffff755c8b1 in parse (first=<value optimized out>, expr=<value
optimized out>, skipper=Unhandled dwarf expression opcode 0x0
)
    at
/var/lib/buildbot/instdirs/boost-release/include/boost-1_46/boost/spirit/home/qi/nonterminal/rule.hpp:280
#21 parse (first=<value optimized out>, expr=<value optimized out>,
skipper=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:41
#22 call(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char> > &,
dlvhex::DLVResultGrammar<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char> > > &,
boost::proto::exprns_::expr<boost::proto::tag::terminal,
boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space,
boost::spirit::char_encoding::ascii> >, 0> &, enum
boost::spirit::qi::skip_flag::enum_type, __gnu_cxx::__normal_iterator<char
const*, std::basic_string<char> >) (first=<value optimized out>, expr=<value
optimized out>, skipper=Unhandled dwarf expression opcode 0x0
) at DLVresultParserDriver.cpp:84
#23 0x00007ffff755bd96 in parse (this=<value optimized out>, is=<value
optimized out>, adder=<value optimized out>)
    at DLVresultParserDriver.cpp:365
#24 0x00007ffff75512e6 in getResults (this=0x656560) at ASPSolver.cpp:316
#25 0x00007ffff7555624 in solve (this=Unhandled dwarf expression opcode 0x0
) at ASPSolverManager.cpp:77
#26 0x00007ffff7893f8e in generateNextModel (this=<value optimized out>) at
WellfoundedModelGenerator.cpp:206
---Type <return> to continue, or q <return> to quit---
#27 0x00000000004339ff in createNextModel (this=0x6548d0)
    at
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/../../include/dlvhex/OnlineModelBuilder.hpp:733
#28 0x0000000000432fb6 in advanceOModelForIModel (this=0x6548d0)
    at
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/../../include/dlvhex/OnlineModelBuilder.hpp:890
#29 0x0000000000420254 in getNextOModel (this=0x6539c0)
    at
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/../../include/dlvhex/OnlineModelBuilder.hpp:955
#30 0x00000000004254c6 in getNextIModel (this=0x6548d0)
    at
/var/lib/buildbot/dlvhex-slave/dlvhex-refactoringbranch-boost-release-clang-trunk/build/src/dlvhex/../../include/dlvhex/OnlineModelBuilder.hpp:632
#31 0x00007ffff78f7e85 in evaluate (this=<value optimized out>, ctx=<value
optimized out>) at State.cpp:756
#32 0x000000000041a46a in main (argc=<value optimized out>, argv=<value
optimized out>) at dlvhex.cpp:422
(gdb)

-- 
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