Can you point out to me where in the Apache 2.4 code base it calls atexit() to 
register anything on process shutdown?

Neither Apache nor the underlying APR/APU libraries that it uses rely on 
atexit() to have anything triggered on process shutdown that I know of and I 
cannot find anything in the code I have handy for those which uses atexit() in 
such a generic way.

Normally Apache relies on cleanup actions attached to deletion of memory pools 
and not atexit(). Thus it requires orderly Apache process shutdown and for 
memory pools to be destroyed for actions to be performed on process shutdown. 
The destruction of memory pools is not triggered via atexit().

Do you also have a more extensive stack trace that that one line so I can see 
in what actual code the crash occurs? That may give me more clues.

Graham

On 13/05/2014, at 8:58 AM, Alex Wu <[email protected]> wrote:

> we do not specifically add hook to atexit. It is called/triggered by apache 
> frame work when a module is written within the apache 2.4 frame work. Also, 
> mod_pagespeed used scoped point on their server context, it triggers auto 
> clean once exit is called and library is unloaded. 
> 
> Alex
> 
> 
> 
> On Monday, May 12, 2014 3:40:26 PM UTC-7, Graham Dumpleton wrote:
> If your own Apache modules are using atexit() to perform cleanup on process 
> exit, rather than Apache's own mechanisms for performing cleanup actions when 
> the pool the module uses is cleaned up, then the atexit() callback will have 
> to take into consideration that under mod_wsgi when using daemon mode, that 
> the Apache module child init handler will not be called in the daemon process 
> for your Apache module. Thus the callback should check whether global data 
> pointers are in fact non NULL before trying to do things with them.
> 
> Can you confirm you are using atexit() callbacks in C code with your Apache 
> modules and explain at what point you are registering the callback with 
> atexit()?
> 
> Is there a specific reason you are using atexit() callbacks rather than doing 
> the normal thing of in the Apache module child init handler registering a 
> cleanup callback on the memory pool given to the Apache module on child init 
> and relying on that being triggered by Apache when shutting things down?
> 
> Graham
> 
> On 13/05/2014, at 8:23 AM, Alex Wu <[email protected]> wrote:
> 
>> some are our own, one is mod_pagespeed. We use python 2.7.3 with apache 
>> 2.4.7 in MPM mode. The segmentation fault is cleanup routine of each modules 
>> other than mod_wsgi after exit call.
>> 
>> Alex
>> 
>> 
>> On Monday, May 12, 2014 1:50:35 PM UTC-7, Graham Dumpleton wrote:
>> On 13/05/2014, at 4:40 AM, Alex Wu <[email protected]> wrote: 
>> 
>> > We have observed various segmentation fault caused by exit call from 
>> > mod_wsgi 3.5: 
>> > 
>> > #20 0x00007f9490a94d96 in wsgi_start_process (p=<optimized out>, 
>> > daemon=<optimized out>) at mod_wsgi.c:11969 
>> > 
>> > The exit call triggers cleanup from other modules, that cleanup caused 
>> > segmentation fault, 
>> 
>> What version of Apache and Python are you using? 
>> 
>> What other non standard Apache modules are you using? For example, is PHP 
>> being used in the same Apache instance? 
>> 
>> Graham 
>> 
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/modwsgi.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to