From rfg@tristatelogic.com  Wed Aug 13 01:22:17 2008
Return-Path: <rfg@tristatelogic.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 584351065673
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Aug 2008 01:22:17 +0000 (UTC)
	(envelope-from rfg@tristatelogic.com)
Received: from segfault-outgoing-helo.tristatelogic.com (112.171-60-66-fuji-dsl.static.surewest.net [66.60.171.112])
	by mx1.freebsd.org (Postfix) with ESMTP id 240CD8FC30
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Aug 2008 01:22:16 +0000 (UTC)
	(envelope-from rfg@tristatelogic.com)
Received: by segfault.tristatelogic.com (Postfix, from userid 1237)
	id 48619BDC35; Tue, 12 Aug 2008 18:22:16 -0700 (PDT)
Message-Id: <20080813012216.48619BDC35@segfault.tristatelogic.com>
Date: Tue, 12 Aug 2008 18:22:16 -0700 (PDT)
From: Ronald F.Guilmette <rfg@tristatelogic.com>
Reply-To: Ronald F.Guilmette <rfg@tristatelogic.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Compiling with gcc -pg produces immediately crashing executables
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         126488
>Category:       gnu
>Synopsis:       Compiling with gcc -pg produces immediately crashing executables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 13 01:30:02 UTC 2008
>Closed-Date:    Thu Aug 14 04:32:22 UTC 2008
>Last-Modified:  Thu Aug 14 04:32:22 UTC 2008
>Originator:     Ronald F. Guilmette
>Release:        FreeBSD 7.0-RELEASE i386
>Organization:
Infinite Monkeys & Co. LLC
>Environment:
System: FreeBSD 7.0-RELEASE
Athlon64 processor (It's an AMD LE-1640B to be precise... single core but 64.)

>Description:
	Compiling & linking just about any program with "gcc -pg" produces
	either an executable that crashes instantly, just inside of main()
	or else an executable where the argc and argv values are hopelessly
	hosed (which can be almost as bad).

>How-To-Repeat:
	Save the following trivial source file as "test.c" and then compile
	and execute it thusly:

		gcc -pg -o test test.c
		./test

	#include <stdlib.h>
	
	int
	main (register int const argc, register char **const argv)
	{
	  if (!argv) {
	    abort ();
	    return 1;
	  } else
	    return 0;
	}

	...then stand back and watch as the program core dumps.

>Fix:
	Beats me.  I haven't been working on the compiler in some time now.
	I'll help to sort this out, but only if you can't find anybody else
	who's been grunging around in the GCC code more recently than me.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Wed Aug 13 01:43:17 UTC 2008 
State-Changed-Why:  
Does this patch help? 
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/profile.h 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126488 

From: Edwin Groothuis <edwin@mavetju.org>
To: "Ronald F. Guilmette" <rfg@tristatelogic.com>
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>
Subject: Re: gnu/126488: Compiling with gcc -pg produces immediately crashing executables
Date: Thu, 14 Aug 2008 10:52:42 +1000

 On Wed, Aug 13, 2008 at 05:10:27PM -0700, Ronald F. Guilmette wrote:
 > In message <200808130143.m7D1hXIl090476@freefall.freebsd.org>, you wrote:
 > 
 > >Synopsis: Compiling with gcc -pg produces immediately crashing executables
 > >
 > >State-Changed-From-To: open->feedback
 > >State-Changed-By: edwin
 > >State-Changed-When: Wed Aug 13 01:43:17 UTC 2008
 > >State-Changed-Why: 
 > >Does this patch help?
 > >http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/profile.h
 > >
 > >http://www.freebsd.org/cgi/query-pr.cgi?pr=126488
 >
 > Probably.  Do you need me to check for sure?
 > 
 > Do I need to rebuild & reinstall the kernel in order to do that?
 
 I think you need a full rebuild (at least kernel) for this.
 
 Edwin
 
 -- 
 Edwin Groothuis      |            Personal website: http://www.mavetju.org
 edwin@mavetju.org    |              Weblog: http://www.mavetju.org/weblog/
State-Changed-From-To: feedback->closed 
State-Changed-By: edwin 
State-Changed-When: Thu Aug 14 04:32:00 UTC 2008 
State-Changed-Why:  
Closed on submitters request in favour of bin/119709. 

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