From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Lipe To: Jason Merrill Cc: egcs@cygnus.com Subject: Re: 1008 segfaults in genattr Date: Thu, 20 Nov 1997 22:03:00 -0000 Message-id: <19971120235757.57358@dgii.com> References: <14025.879923259.cygnus.egcs@hurl.cygnus.com> <19971120001623.46688@dgii.com> <19971120010603.06910@dgii.com> <19971120020607.39419@dgii.com> <19971120230937.47324@dgii.com> X-SW-Source: 1997-11/msg00689.html > > 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