[omniORB] Re: serious stability problems with omniORB4 snapshots on Solaris 8

Rosimildo daSilva rdasilva@connecttel.com
Thu, 31 Jan 2002 10:06:23 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_00A1_01C1AA3E.F00E5550
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
=20
"Pure virtual method called" error is a *very common* bug in C++ =
programs.  It means that
you had a pointer to a base class, let's say A, and the point is =
actually to a sub-class B,
but the instance has been deleted and the method called.
=20
class A
{
   virtual void foo() =3D 0;
};
=20
class B: public A
{
   virtual void foo() {}
};


A *a =3D new B;
=20
 a->foo();
=20
...
=20
delete a;
=20
a->foo()   <------ THIS IN SOME CAES, YOU GET THE "pure virtual method =
called" error. Sometimes, you get
a segmentation fault.
=20

Bottom line: some pointer is being used after the instance that it =
points to, has been deleted.
=20
Rosimildo.

    -----Original Message-----
    From: Bastiaan Bakker <Bastiaan.Bakker@lifeline.nl>
    To: omniorb-list@uk.research.att.com =
<omniorb-list@uk.research.att.com>
    Date: Thursday, January 31, 2002 9:58 AM
    Subject: [omniORB] Re: serious stability problems with omniORB4 =
snapshots on Solaris 8
   =20
   =20
    Hi,=20
    =20
    A quick update. The same test also produced the following 'pure =
virtual method called', without omniORB first complaining about an =
'unrecoverable error' on the endpoint.=20
   =20
    Hints on how to debug these problems will be very appreciated ....
    =20
    Cheers,
    =20
    Bastiaan Bakker
    LifeLine Networks bv
    =20
    =20
    Upcall Hello!
    Upcall Hello!
    pure virtual method called
   =20
    Program received signal SIGABRT, Aborted.
    [Switching to LWP 3]
    0xfee09b1c in __sigprocmask () from /usr/lib/libthread.so.1
    (gdb) bt
    #0  0xfee09b1c in __sigprocmask () from /usr/lib/libthread.so.1
    #1  0xfedfe554 in _resetsig () from /usr/lib/libthread.so.1
    #2  0xfedfdc44 in _sigon () from /usr/lib/libthread.so.1
    #3  0xfee00db8 in _thrp_kill () from /usr/lib/libthread.so.1
    #4  0xfeeca030 in raise () from /usr/lib/libc.so.1
    #5  0xfeeb559c in abort () from /usr/lib/libc.so.1
    #6  0xfefc22d4 in __default_terminate ()
       from /usr/local/lib/libstdc++.so.2.10.0
    #7  0xfefc2304 in __terminate () from =
/usr/local/lib/libstdc++.so.2.10.0
    #8  0xff2854d8 in __pure_virtual ()
       from =
/opt/devel/debug/attresearch/omniORB4/src/examples/echo/../../../lib/sun4=
_sosV_5.7/libomniORB4.so.0
    #9  0xff240a84 in omni::giopServer::notifyWkDone (this=3D0x2a9f0, =
w=3D0x38208,=20
        exit_on_error=3Dfalse) at giopServer.cc:895
    #10 0xff241ee4 in omni::giopWorker::execute (this=3D0x38208) at =
giopWorker.cc:173
    #11 0xff298d58 in omniAsyncWorker::run (this=3D0x38150) at =
invoker.cc:146
    #12 0xff3741fc in omni_thread_wrapper (ptr=3D0x38150) at =
posix.cc:423


------=_NextPart_000_00A1_01C1AA3E.F00E5550
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 =
Transitional//EN">
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>Hi,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&quot;Pure virtual method =
called&quot; error is=20
a *very common* bug in C++ programs.&nbsp; It means that</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT size=3D2>you had a =
pointer to a base=20
class, let's say A, and the point is actually to a sub-class =
B,</FONT></DIV>
<DIV><FONT size=3D2>but the instance has been deleted and the method=20
called.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>class A</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>{</FONT></DIV>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; virtual void foo() =3D=20
0;</FONT></DIV></DIV>
<DIV><FONT color=3D#000000 size=3D2>};</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>class B: public A</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT size=3D2>{</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; =
virtual void=20
foo() {}</FONT></DIV>
<DIV><FONT size=3D2>};</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>A *a =3D new B;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;a-&gt;foo();</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>...</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>delete a;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>a-&gt;foo()&nbsp;&nbsp; &lt;------ THIS IN SOME =
CAES, YOU GET=20
THE &quot;pure virtual method called&quot; error. Sometimes, you=20
get</FONT></DIV>
<DIV><FONT size=3D2>a segmentation fault.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Bottom line: some pointer is being =
used after=20
the instance that it points to, has been deleted.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Rosimildo.</FONT></DIV>
<DIV>&nbsp;</DIV></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV><FONT face=3DArial size=3D2><B>-----Original =
Message-----</B><BR><B>From:=20
    </B>Bastiaan Bakker &lt;<A=20
    =
href=3D"mailto:Bastiaan.Bakker@lifeline.nl">Bastiaan.Bakker@lifeline.nl</=
A>&gt;<BR><B>To:=20
    </B><A=20
    =
href=3D"mailto:omniorb-list@uk.research.att.com">omniorb-list@uk.research=
.att.com</A>=20
    &lt;<A=20
    =
href=3D"mailto:omniorb-list@uk.research.att.com">omniorb-list@uk.research=
.att.com</A>&gt;<BR><B>Date:=20
    </B>Thursday, January 31, 2002 9:58 AM<BR><B>Subject: </B>[omniORB] =
Re:=20
    serious stability problems with omniORB4 snapshots on Solaris=20
    8<BR><BR></DIV></FONT>
    <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D143354615-31012002>Hi,=20
    </SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN=20
    class=3D143354615-31012002></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN class=3D143354615-31012002>A =
quick update.=20
    The same test also produced the following 'pure virtual method =
called',=20
    without omniORB first complaining&nbsp;about an =
'unrecoverable&nbsp;error'=20
    on the endpoint. </SPAN></FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D143354615-31012002>Hints on how to=20
    debug these problems will be very appreciated =
....</SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN=20
    class=3D143354615-31012002></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN=20
    class=3D143354615-31012002>Cheers,</SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN=20
    class=3D143354615-31012002></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D143354615-31012002>Bastiaan=20
    Bakker</SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN =
class=3D143354615-31012002>LifeLine=20
    Networks bv</SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN=20
    class=3D143354615-31012002>&nbsp;</SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2><SPAN=20
    class=3D143354615-31012002>&nbsp;</SPAN></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Upcall Hello!<BR>Upcall =
Hello!<BR>pure virtual=20
    method called</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Program received signal SIGABRT,=20
    Aborted.<BR>[Switching to LWP 3]<BR>0xfee09b1c in __sigprocmask () =
from=20
    /usr/lib/libthread.so.1<BR>(gdb) bt<BR>#0&nbsp; 0xfee09b1c in =
__sigprocmask=20
    () from /usr/lib/libthread.so.1<BR>#1&nbsp; 0xfedfe554 in _resetsig =
() from=20
    /usr/lib/libthread.so.1<BR>#2&nbsp; 0xfedfdc44 in _sigon () from=20
    /usr/lib/libthread.so.1<BR>#3&nbsp; 0xfee00db8 in _thrp_kill () from =

    /usr/lib/libthread.so.1<BR>#4&nbsp; 0xfeeca030 in raise () from=20
    /usr/lib/libc.so.1<BR>#5&nbsp; 0xfeeb559c in abort () from=20
    /usr/lib/libc.so.1<BR>#6&nbsp; 0xfefc22d4 in __default_terminate=20
    ()<BR>&nbsp;&nbsp; from =
/usr/local/lib/libstdc++.so.2.10.0<BR>#7&nbsp;=20
    0xfefc2304 in __terminate () from=20
    /usr/local/lib/libstdc++.so.2.10.0<BR>#8&nbsp; 0xff2854d8 in =
__pure_virtual=20
    ()<BR>&nbsp;&nbsp; from=20
    =
/opt/devel/debug/attresearch/omniORB4/src/examples/echo/../../../lib/sun4=
_sosV_5.7/libomniORB4.so.0<BR>#9&nbsp;=20
    0xff240a84 in omni::giopServer::notifyWkDone (this=3D0x2a9f0, =
w=3D0x38208,=20
    <BR>&nbsp;&nbsp;&nbsp; exit_on_error=3Dfalse) at =
giopServer.cc:895<BR>#10=20
    0xff241ee4 in omni::giopWorker::execute (this=3D0x38208) at=20
    giopWorker.cc:173<BR>#11 0xff298d58 in omniAsyncWorker::run =
(this=3D0x38150)=20
    at invoker.cc:146<BR>#12 0xff3741fc in omni_thread_wrapper =
(ptr=3D0x38150) at=20
    posix.cc:423<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00A1_01C1AA3E.F00E5550--