gnu/126488: Compiling with gcc -pg produces immediately crashing executables

Ronald F.Guilmette rfg at tristatelogic.com
Wed Aug 13 01:30:03 UTC 2008


>Number:         126488
>Category:       gnu
>Synopsis:       Compiling with gcc -pg produces immediately crashing executables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 13 01:30:02 UTC 2008
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


More information about the freebsd-bugs mailing list