Date: 16 Oct 2003 02:01:05 -0000 From: Robert Collins <robertc@squid-cache.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: gnu/58099: g++ -fhuge-objects on ix86 coredumps upon use of std::ostringstream Message-ID: <20031016020105.3329.qmail@squid-cache.org> Resent-Message-ID: <200310160210.h9G2AF3W050803@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Oct 15 19:10:15 PDT 2003
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031016020105.3329.qmail>
