Operating System - HP-UX
1837509 Members
3741 Online
110117 Solutions
New Discussion

__PureVirtualCalled exception?

 
Pratheesh
Advisor

__PureVirtualCalled exception?

Hi,

I have created an executable using aCC on HP-UX machine, fit_evt_feeder.exe which processed records in a file. While executing and during the processing, Its core-dump with the following details:
------------------------
warning: section .data not found in /aplic/oracle/9.2.0/lib/libwtc9.sl
#0 0xc0000000002fb1d4 in kill+0x2c () from /usr/lib/pa20_64/libc.2
(gdb) ba
#0 0xc0000000002fb1d4 in kill+0x2c () from /usr/lib/pa20_64/libc.2
#1 0xc0000000002a960c in raise+0x2c () from /usr/lib/pa20_64/libc.2
#2 0xc0000000002def58 in abort_C+0x180 () from /usr/lib/pa20_64/libc.2
#3 0xc0000000002defbc in abort+0x1c () from /usr/lib/pa20_64/libc.2
#4 0xc0000000009e674c in __PureVirtualCalled+0x14 () from /usr/lib/pa20_64/libCsup_v2.2
#5 0x40000000001ddce8 in EventSendStrategy::sendEvent (this=0x8000000100102d98,
event=0x8000000100469e88) at eventsendstrategy.cxx:280
#6 0x40000000001ddb14 in EventSendStrategy::sendRecord (this=0x8000000100102d98,
event=0x8000000100469e88) at eventsendstrategy.cxx:230
#7 0x40000000001528bc in FeedManager::processSource (this=0x800000010010fe68,
currSource=0x8000000100840320) at feedmanager.cxx:344
#8 0x4000000000151be0 in FeedManager::startFeed (this=0x800000010010fe68) at feedmanager.cxx:149
#9 0x4000000000151754 in FeedManager::run (this=0x800000010010fe68) at feedmanager.cxx:89
#10 0x4000000000139d04 in main (argc=6, argv=0x800003ffbfff0978) at fit_feeder.cxx:133

---

Can anybody tell me the reason for this error?
This executable was working fine for sometime.

Thanks and Regards,
Pratheesh.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: __PureVirtualCalled exception?

Shalom Pratheesh,

It could be anything from bad code to a temporary resource shortage.

You could hang a tusc monitor on the process for more diagnostics.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: __PureVirtualCalled exception?

>Can anybody tell me the reason for this error?

It should be obvious. You are illegally calling a C++ pure virtual function. If you have a fairly new aC++ runtime lib patch, it should print the name of the class in question to stderr:
aCC runtime: pure virtual function called for class "%s".

This call should be on eventsendstrategy.cxx:280

While it is obvious this is a bad thing to do, it is hard to practice to get this error. There are only two ways besides memory corruption:
1) Inside a base class constructor or destructor, you call another member function and that calls a pure virtual function. The C++ Standard does NOT allow the the virtual function to resolve to the derived class that is in process of being constucted. (Where you may think the virtual function is no longer pure.)

In your stack trace, I don't see any constructor/destructors, so I don't think it is this case. Of course if they are inlined, they would also not be present.

2) If you have deleted or destroyed an object with inheritance and then later attempt to use the "freed" object, you'll get this error too. This occurs because the virtual tables in the derived object have been reset to the last base class during destruction, where the virtual functions are pure.

Since you probably don't have 1), you have this case.

You may want to use gdb's heap debugging options to try to find this heap error.

It appears you haven't assigned any points to any of your questions.
http://forums1.itrc.hp.com/service/forums/helptips.do?#28


>SEP: It could be anything from bad code ... You could hang a tusc monitor

You are right about bad code ;-) but tusc will tell you next to nothing about this programming error. The stack trace already tells you more than tusc.
Pratheesh
Advisor

Re: __PureVirtualCalled exception?

Anybody can correlate this issue with some OS patch/ firmware upgrade ? New Firmware is:
The server model: RP7420 and the firmware is 4.0 release.
Dennis Handly
Acclaimed Contributor

Re: __PureVirtualCalled exception?

>Anybody can correlate this issue with some OS patch/ firmware upgrade?

No, this is purely a coding error. OS patches and firmware aren't going to be fiddling with aC++ virtual tables. But random corruption is always possible.