🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #678

Segmentation violation in destructor if operator delete present

#678
From: Ben Verwer
Date: Tue, 05 Dec 1989 10:56
31 lines
1736 bytes
In converting from 1.35 to 1.36 I ran into the following bug 
(on both sun3-os4 and sun4-os4):

ben31> more tmp.c
class t {
	int a;
public:
	void* operator new (long size) { return new char [size]; }
	void operator delete(void* p) {}
	t() {}
	~t() {}
};

ben32> g++ -v tmp.c
gcc version 1.36.0 (based on GCC 1.36)
 /home/duttnph/ph/local/lib/sun4/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ tmp.c /usr/tmp/cca08422.cpp
GNU CPP version 1.36
 /home/duttnph/ph/local/lib/sun4/gcc-cc1plus /usr/tmp/cca08422.cpp -quiet -dumpbase tmp.c -version -o /usr/tmp/cca08422.s
GNU C++ version 1.36.0 (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue
tmp.c: In method t::~t ():
tmp.c:7: Segmentation violation
g++: Program cc1plus got fatal signal 11.

My fault?

-----------------------------------------------------------------------------
Ben Verwer                                                       Lorentzweg 1
Pattern Recognition Group                                      2628 CJ  Delft
Faculty of Applied Physics                                    The Netherlands
Delft University of Technology                                  +31(15)783247
Technical Details
Message-ID: <1021@dutrun.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!mcsun!hp4nl!dutrun!ben

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!mcsun!hp4nl!dutrun!ben
From: ben@duttnph.tudelft.nl (Ben Verwer)
Newsgroups: gnu.g++.bug
Subject: Segmentation violation in destructor if operator delete present
Message-ID: <1021@dutrun.UUCP>
Date: 5 Dec 89 10:56:59 GMT
Sender: tnphnws@dutrun.UUCP
Reply-To: ben@duttnph.tudelft.nl (Ben Verwer)
Organization: Delft University of Technology, The Netherlands
Lines: 31