1008 segfaults in genattr
Jeffrey A Law
law@cygnus.com
Fri Nov 21 21:50:00 GMT 1997
In message < m0xYd7u-0004ecC@ocean.lucon.org >you write:
> __do_global_dtors_aux is called via the .fini section. Unless
> _fini (), the .fini section, is called twice, __do_global_dtors_aux
> should not be called twice.
Accoding to the comments before do_global_dtors_aux it can be called
more than once:
On some systems, this routine is run more than once from the .fini,
when exit is called recursively, so we arrange to remember where in
the list we left off processing, and we resume at that point,
should we be re-invoked. */
So apparently the code is supposed to handle this. I think we need to
debug _why_ the code is failing when it gets called the second time.
It sppears to me that __deregister_frame might abort if it runs twice
(frees some memory it might look at later), or if he objects array gets
wiped clean, then it could call abort.
This may not explain all the problems, but it gives us at least one to
look at.
Could someone try replacing __do_global_dtors_aux with this implementation
and try things?
static void
__do_global_dtors_aux ()
{
static func_ptr *p = __DTOR_LIST__ + 1;
static int completed = 0;
if (completed)
return
while (*p)
{
p++;
(*(p-1)) ();
}
#ifdef EH_FRAME_SECTION_ASM_OP
__deregister_frame (__EH_FRAME_BEGIN__);
#endif
completed = 1;
}
jeff
More information about the Gcc
mailing list