This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 1008 segfaults in genattr


> > So, since removing HAVE_ATEXIT replaces the system's exit() with 
> > it's own (huh!?!?!)  we circumvent the abort in the native exit 
> > becuase  we're circumventing the native exit.
> 
> Ah, I get it.  The exit() in libgcc2 is #ifndef ON_EXIT.  Since you claim
> to have neither atexit nor on_exit, you get the libgcc2 exit.
> 
> Seems clear to me that #undefing HAVE_ATEXIT is a lose.

So, we (think we) know that in C it's undefined to call exit() from 
an atexit() function.  In C++, is it similarly undefined that you can't
call exit() from a destructor?     I haven't any idea.

The presence or absence of HAVE_ATEXIT in the ELF part of sco5.h seems
to matter for only this case.    What's your recommendation?  I can think
of a few from here:

1) Remove HAVE_ATEXIT.  Make all binaries 14K larger becuase we suck in
	more of libgcc2.

2) Put it back, and just let the static dtor calling exit thing get a 
	big fat coredump.

3) Put it back and try to instrument around this unpleasantry.

4) Make the test case call _exit() instead of exit(), but just 
	let code in the field learn this the hard way.

5) Put it back and let it fail. Make the test xfail for offending 
	targets.  (This all works on OpenServer COFF WITHOUT 
	HAVE_ATEXIT.)

IMO, it's your call.   Numbers 2, 4, &5 are all one-line changes.

RJL


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]