In a header file a class is declared. One of the methods of the class, namely: public: void setTimeout(void){m_dtDateTime.setNow();} was mistakenly defined as: void setTimeout(void){m_dtDateTime.setNow;}. This resulted in a segfault. "setNow" is a: void setNow(void); and is a member of another class. "setTimeout" is on line 59 in the header file. Here's the command line and the error msgs: c++ -DHAVE_CONFIG_H -I. -I. -I.. -I /home/alexe/work/vm/vmshared -I /home/alexe/work/vm/vminternal -I /home/alexe/work/vm/vminternal/tcp -I /home/alexe/work/bm/bminternal/threads -I /home/alexe/work/bm/bminternal/packets -I /usr/local/ssl/include -g -g -O2 -Wall -Wno-unused -c VMScheduler.cpp VMScheduler.h: In method `BOOL VMScheduler::forceEvent (int, BMObject *, int)': VMScheduler.h:59: Internal error: Segmentation fault. After correcting the error the code compiled properly (no warnings, no errors) and there was no segfault anymore. I am sorry for being unable to submit the full source to you, but will gladly answer your questions if you have any. Here's the class declaration: class SMSTimerEvent : public VMObject { friend VMScheduler; ccDateTime m_dtDateTime; smsTimerCode_t m_iCode; BOOL m_bRecurring; public: SMSTimerEvent(){m_iCode = TE_INVALID; setParent(NULL); setEmplr(NULL);}; SMSTimerEvent(ccDateTime& t, smsTimerCode_t c, BOOL recr, VMObject* ptrObj, VMObject* ptrParent); BOOL isTimeout(void){return m_dtDateTime.isExpired();} void setTimeout(void){m_dtDateTime.setNow();} BOOL isRecurring(void){return m_bRecurring;} virtual ~SMSTimerEvent(){}; void dump(int=0); void process(void); }; Release: gcc --version = 2.96 Environment: RedHat 7.0, PII-400Mhz, 128MB, bash, non-root user
Fix: After correcting the error (i.e. put brackets after function call) the code compiled properly (no warnings, no errors) and there was no segfault anymore. Same code compiles and runs properly with gcc ver 2.91.
From: Craig Rodrigues <rodrigc@mediaone.net> To: gcc-gnats@gcc.gnu.org, batelcruiser@yahoo.com, nobody@gcc.gnu.org, rodrigc@mediaone.net Cc: Subject: Re: c++/1791 Date: Sat, 17 Feb 2001 17:02:04 -0500 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1791&database=gcc Does upgrading to the latest version of Redhat's gcc package at ftp://rawhide.redhat.com solve your problem? I cannot verify the problem, because you could not provide a reproducible test case. -- Craig Rodrigues http://www.gis.net/~craigr rodrigc@mediaone.net
State-Changed-From-To: open->closed State-Changed-Why: We cannot help you without source code.
From: neil@gcc.gnu.org To: batelcruiser@yahoo.com, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/1791 Date: 25 Feb 2001 12:48:48 -0000 Synopsis: wtf is synopsis? State-Changed-From-To: open->closed State-Changed-By: neil State-Changed-When: Sun Feb 25 04:48:48 2001 State-Changed-Why: We cannot help you without source code. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1791&database=gcc
Reopening to ...
Mark as invalid.