[gnu.g++.bug] Segmentation violation in destructor if operator delete present

ben@duttnph.tudelft.nl (Ben Verwer) (12/05/89)

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

schmidt@zola.ics.uci.edu (Doug Schmidt) (12/06/89)

In article <1021@dutrun.UUCP>, ben@duttnph (Ben Verwer) writes:
>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.

This is fixed in 1.36.2-.

Doug
--
Any man's death diminishes me,              | schmidt@ics.uci.edu (ARPA)
Because I am involved in Mankind;           | office: (714) 856-4043
And therefore never send to know for whom the bell tolls;
It tolls for thee        -- John Donne