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


Jason Merrill wrote:
> >>>>> Robert Lipe <robertl@dgii.com> writes:
> > The problem is that "config/svr4.h" #defines HAVE_ATEXIT and nothing
> > in config/i386/sysv4.h #undefs it.  This is why we see the potentially 
> > goofy double exit thing on systems that are SVR4-ish on x86, which 
> > would certainly include Unixware.
> 
> I don't understand.  HAVE_ATEXIT has no effect whatsoever on the running of
> dtors on ELF systems.  What's the problem?

But it does have at least one side effect.

Since on ELF systems the .fini stuff is generally implemented under
the hood as a call to atexit(_fini) (see i386/sol2-c1.asm, others)
the presence of HAVE_ATEXIT() means we are also adding things to be
called via atexit() and if the system doesn't cleanly handle the case
of exit recursing, you can see problems like originally described with
__do_global_dtors() being called twice if you call exit() from a global
destructor.

H.J. and I have asked for diassemblies, stack backtraces, and other
hints from the original poster to better qualify this [ possibly
unrelated ] problem.




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