From robertc@squid-cache.org  Wed Oct 15 19:01:07 2003
Return-Path: <robertc@squid-cache.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E293516A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Oct 2003 19:01:07 -0700 (PDT)
Received: from squid-cache.org (squid-cache.org [206.168.0.9])
	by mx1.FreeBSD.org (Postfix) with SMTP id 0CA6D43F75
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Oct 2003 19:01:07 -0700 (PDT)
	(envelope-from robertc@squid-cache.org)
Received: (qmail 3330 invoked by uid 1012); 16 Oct 2003 02:01:05 -0000
Message-Id: <20031016020105.3329.qmail@squid-cache.org>
Date: 16 Oct 2003 02:01:05 -0000
From: Robert Collins <robertc@squid-cache.org>
Reply-To: Robert Collins <robertc@squid-cache.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: g++ -fhuge-objects on ix86 coredumps upon use of std::ostringstream
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58099
>Category:       gnu
>Synopsis:       g++ -fhuge-objects on ix86 coredumps upon use of std::ostringstream
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 15 19:10:15 PDT 2003
>Closed-Date:    Thu Oct 16 23:21:49 PDT 2003
>Last-Modified:  Thu Oct 16 23:21:49 PDT 2003
>Originator:     Robert Collins
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD squid-cache.org 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #1: Tue Sep 16 13:13:50 MDT 2003 wessels@squid-cache.org:/usr/obj/usr/src/sys/SQUID i386


>Description:
	Using g++ 2.95.4, the test case :
#include <sstream>
int main(int argc, char **argv)
{
std::ostringstream foo;
foo << "hello" << "hello" << std::endl;
std::cout << foo.str() ;
return 0;
}
Will coredump if the option -fhuge-objects is supplied to g++. My understanding is that their needs to be a separate libstdc++ for use when -fhuge-objects is supplied, IFF -fhuge-objects is not a no-op.
We encountered this in squid, where our configure tests for a working -fhuge-objects flag, to enable it on systems that need it. We didn't try to run the resulting program, as the c++ compiler should Do The Right Thing...
>How-To-Repeat:
	Compile the above program with g++ -fhuge-objects, then run the resulting program.
>Fix:
	Build a -fhuge-objects version of libstdc++ and alter the specs file to use it when appropriate. This affects previous versions of FreeBSD too... Alternatively, make -fhuge-objects on i386 a no-op, such that the std library is compatible.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Thu Oct 16 23:21:27 PDT 2003 
State-Changed-Why:  
Please take this up with the gcc developers: FreeBSD does not 
separately maintain gcc. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58099 
>Unformatted:
