🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Fatal signal for sparc

#1486
From: "Douglas C. Schmidt"
Date: Sun, 09 Oct 1988 02:42
60 lines
1836 bytes
Hi,

   G++ 1.27 gets a fatal signal for the following short program.  This
occurs on a Sun 4:

----------------------------------------
static const int Max_Buf = 100000;
 
class Binary_Search_Tree {
private:

   struct Tree_Node {

      static Tree_Node *Base;

      void * operator new ( long ) {
         return ( Base++ );
      }

      void operator delete ( void * Ptr ) {
      }

      Tree_Node () {}

   };

public:

   Binary_Search_Tree ( void );

   ~Binary_Search_Tree ( void );

};

Binary_Search_Tree::Binary_Search_Tree ( void ) {
   Tree_Node::Base = new Tree_Node [ Max_Buf ];
}   

Binary_Search_Tree::~Binary_Search_Tree ( void ) {
   delete (Tree_Node *) Tree_Node::Base;
}
----------------------------------------

Here is the diagnostic:

----------------------------------------

g++ version 1.27.0
 echo use .cc filename extension!
use .cc filename extension!
 /usr/public/lib/g++/gcc-cpp+ -v -I/cd/ua/schmidt/include/ -undef
-D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix -D__OPTIMIZE__ bug.C
/tmp/cca13219.cpp GNU CPP version 1.27.0
 /usr/public/lib/g++/gcc-c++ /tmp/cca13219.cpp -quiet -dumpbase bug.C
-fchar-charconst -opt -version -o /tmp/cca13219.s

In function void Binary_Search_Tree::~Binary_Search_Tree ():
bug.C:34: Segmentation violation
/usr/public/g++: Program c++ got fatal signal 11.
Technical Details
Message-ID: <8810081942.aa17954@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu
From: schmidt%blanche.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: Fatal signal for sparc
Message-ID: <8810081942.aa17954@PARIS.ICS.UCI.EDU>
Date: 9 Oct 88 02:42:37 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 59