🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

2-line program that causes g++ to crash.

#1527
From: Tommy Joseph
Date: Tue, 08 Nov 1988 22:58
22 lines
1109 bytes
Here is a 2-line rather meaningless program that caused g++
to crash.  I use a SUN 3/60 running Mach.

main()
{
    int c;
    void& b = void(c);
}

I put this into a file called try.cc and ran g++ as below:

% g++ -v try.cc
g++ version 1.27.0
 /usr/local/lib/gcc-cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -DCMUCS -Dsun 
-Dunix try.cc /tmp/cc003075.cpp
GNU CPP version 1.27.0
 /usr/local/lib/gcc-c++ /tmp/cc003075.cpp -quiet -dumpbase try.cc -noreg -versio
n -o /tmp/cc003075.s
GNU C++ version 1.27.0 (68k, MIT syntax) compiled by GNU C version 1.27.

try.cc:4: Segmentation violation
g++: Program c++ got fatal signal 11.
Technical Details
Message-ID: <8811082258.AA02761@aosta.orc.olivetti.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!texbell!uhnix1!nuchat!uunet!tut.cis.ohio-state.edu!orc.olivetti.com!tommy

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!texbell!uhnix1!nuchat!uunet!tut.cis.ohio-state.edu!orc.olivetti.com!tommy
From: tommy@orc.olivetti.com (Tommy Joseph)
Newsgroups: gnu.g++.bug
Subject: 2-line program that causes g++ to crash.
Message-ID: <8811082258.AA02761@aosta.orc.olivetti.com>
Date: 8 Nov 88 22:58:24 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tommy@orc.olivetti.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 21