This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/17405] New: Throwing exception crashes, when instrumented with purify


I run a gcc 3.2.2 compiled application on Sparc Sun Solaris 2.9 - this one is 
a multi-threaded application. When not instrumented with Purify, application 
runs fine and exception handling works without any glitch.
But when instrumented with purify, any attempt to throw an exception results 
in a crash.

I've appended here the backtrace from the core: 

#0  0xfbff5c48 in get_adjusted_ptr(std::type_info const*, std::type_info 
const*, void**) (
    catch_type=0x3bbc, throw_type=0xa61b0, thrown_ptr_p=0xf76fef4c)
    at ../../../../gcc-3.2.2/libstdc++-v3/libsupc++/eh_personality.cc:118
#1  0xfbff628c in __gxx_personality_v0 (version=-84071231, actions=1,
    exception_class=5138137972254386944, ue_header=0x1e5658, 
context=0xf76ff368)
    at ../../../../gcc-3.2.2/libstdc++-v3/libsupc++/eh_personality.cc:342
#2  0xfcba7688 in _Unwind_RaiseException (exc=0x1e5688) at ../../gcc-
3.2.2/gcc/unwind.inc:107
#3  0xfbff682c in __cxa_throw (obj=0x1e5688, tinfo=0xa61b0,
    dest=0x898bc <APIException::~APIException()>)
    at ../../../../gcc-3.2.2/libstdc++-v3/libsupc++/eh_throw.cc:72
...
...
...

Purify reports a Zero Page Read error on the memory address 0x3bbc - which as 
per the backtrace is catch_type argument of get_adjusted_ptr call in frame 0.

In gdb, trying to print catch_type results in 
(gdb) p *catch_type
Cannot access memory at address 0x3bbc

and I get the following warning when I try to print throw_type(
(gdb) p *throw_type
warning: can't find class named `__cxxabiv1::__si_class_type_info', as given 
by C++ RTTI
$4 = {_vptr.type_info = 0xfc014ca0, __name = 0xfae53fc0 "12APIException"}

APIException is a custom exception class that derives from a base exception 
class called IException. IException holds a std::exception (by containment). 
The implementation of both APIException & IException is clean & fairly simple.

Not sure, what's going wrong where.. 

I noticed a similar bug was reported in "http://gcc.gnu.org/ml/gcc-bugs/1999-
01/msg00240.html" - However, that has been decided to be a purify bug.

Pls. let me know if this is any known limitation of using g++ with purify. Is 
there any remedy, if I wish to continue using both g++ and purify together? Is 
there any gcc patch that can solve this problem ?

Appreciate any help in this regard.

Thanks,
Arun.

-- 
           Summary: Throwing exception crashes, when instrumented with
                    purify
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: arunprasad at in dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17405


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]