public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9433: [3.2/3.3/3.4 regression] SegFault in dynamic_cast
@ 2003-01-28 15:28 nathan
0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2003-01-28 15:28 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nathan, yanliu
Synopsis: [3.2/3.3/3.4 regression] SegFault in dynamic_cast
State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Tue Jan 28 15:28:51 2003
State-Changed-Why:
2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9433
* libsupc++/tinfo.cc (__vmi_class_type_info::__do_dyncast): Cope
with bases which are very ambiguous.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9433
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/9433: [3.2/3.3/3.4 regression] SegFault in dynamic_cast
@ 2003-01-27 21:58 nathan
0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2003-01-27 21:58 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nathan, nobody, yanliu
Synopsis: [3.2/3.3/3.4 regression] SegFault in dynamic_cast
Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-By: nathan
Responsible-Changed-When: Mon Jan 27 21:58:24 2003
Responsible-Changed-Why:
mine
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9433
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/9433: [3.2/3.3/3.4 regression] SegFault in dynamic_cast
@ 2003-01-24 15:22 bangerth
0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-01-24 15:22 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, yanliu
Old Synopsis: memory fault
New Synopsis: [3.2/3.3/3.4 regression] SegFault in dynamic_cast
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Jan 24 15:22:42 2003
State-Changed-Why:
Confirmed (one x86 linux). It used to work with 2.95, but is broken in
3.2, 3.3, and 3.4 branches/CVS. The following slightly
simplified testcase shows the same behavior (the class
hierarchy is an exercise in applied graph theory :-)
-------------------------------
struct A { virtual ~A() {}; };
struct B {};
struct C : A, B {};
struct D : C {};
struct E : C {};
struct F : protected D, E {};
struct H : virtual F {};
struct I : H {};
struct J : H {};
struct K : I, J {};
struct M : K {};
struct N : M {};
struct O : M {};
struct P : N, O {};
int main() {
P obj;
A* a1 = (D*)&obj;
dynamic_cast<H*>(a1);
}
-------------------------------
The Segfault happens in the runtime support libs (with 3.4):
(gdb) bt
#0 0x4006c7a2 in __cxxabiv1::__vmi_class_type_info::__do_find_public_src(int, void const*, __cxxabiv1::__class_type_info const*, void const*) const (
this=0x804a4a0, src2dst=-1, obj_ptr=0x0, src_type=0x804a488,
src_ptr=0xbffff184)
at ../../../../gcc-3.4-CVS/libstdc++-v3/libsupc++/tinfo.cc:122
#1 0x4006cd0d in __cxxabiv1::__vmi_class_type_info::__do_dyncast(int, __cxxabiv1::__class_type_info::__sub_kind, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info::__dyncast_result&) const (this=0x804ab60, src2dst=-1,
access_path=__contained_public, dst_type=0x804a4a0, obj_ptr=0xbffff174,
src_type=0x804a488, src_ptr=0xbffff184, result=@0xbffff120)
at ../../../../gcc-3.4-CVS/libstdc++-v3/libsupc++/tinfo.cc:264
#2 0x4006d0c3 in __dynamic_cast (src_ptr=0xbffff184, src_type=0x804a488,
dst_type=0x804a4a0, src2dst=-1)
at ../../../../gcc-3.4-CVS/libstdc++-v3/libsupc++/tinfo.cc:712
#3 0x08048703 in main () at x.cc:19
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9433
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-01-28 15:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-28 15:28 c++/9433: [3.2/3.3/3.4 regression] SegFault in dynamic_cast nathan
-- strict thread matches above, loose matches on Subject: below --
2003-01-27 21:58 nathan
2003-01-24 15:22 bangerth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).