🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6387

Bug in GCC; 2.7.0/2.7.2; fatal sig 11 in cc1 compiling `socks'

#6387
From: Ronald F. Guilmette
Date: Sat, 09 Dec 1995 00:00
54 lines
2032 bytes
(This appears to be a GCC front-end bug.  Thus, it will probably manifest
itself on all platforms where GCC runs.)

The following code, when compiled with no special options, causes cc1
to crash with a fatal signal 11 when using GCC 2.7.0 or 2.7.2 on the
sparc-sun-solaris2.4 platform... and probaby also many other platforms.

I do not have a fix (yet).

Note that this example was derived (and greatly simplified) from a much
larger translation unit, namely:

	socks.cstc.4.2.2/rtelnet/telnet/commands.c

The workaround is to simply delete the block-local external declaration of
htons within the `tn' function in socks.cstc.4.2.2/rtelnet/telnet/commands.c.

(Note that the definition of htons is provided by <sys/byteorder.h>.)

----------------------------------------------------------------------------
static __inline__ int
htons (int __arg)
{
  return __arg;
}

int us;

void
tn ()
{
    int htons ();

    htons(us);
}
----------------------------------------------------------------------------

Workaround patch:

*** commands.c	Sat Dec  9 15:36:26 1995
--- commands.c	Sat Dec  9 18:08:24 1995
***************
*** 2307,2311 ****
  	} else {
  #if	!defined(htons)
- 	    u_short htons();
  #endif	/* !defined(htons) */
  	    sin.sin_port = htons(sin.sin_port);
--- 2307,2310 ----
-- 

-- Ron Guilmette, Roseville, CA -------- Infinite Monkeys & Co. ------------
---- E-mail: rfg@monkeys.com ----------- Purveyors of Compiler Test Suites -
------ Copyright (c) 1995 by Ronald F. Guilmette; All rights reserved. -----
Technical Details
Message-ID: <4adgcd$kln@segfault.monkeys.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,1a901d6074c31252,start
X-Google-Attributes: gid113d02,public
From: rfg@monkeys.com (Ronald F. Guilmette)
Subject: Bug in GCC; 2.7.0/2.7.2; fatal sig 11 in cc1 compiling `socks'
Date: 1995/12/09
Message-ID: <4adgcd$kln@segfault.monkeys.com>
X-Deja-AN: 121483974
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: Infinite Monkeys & Co.
newsgroups: gnu.gcc.bug