apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: apr_global_mutex_child_init & mod_watch
Date Sun, 07 Sep 2003 18:08:06 GMT
Anthony Howe wrote:

> Well my module was working happily with .43 when the API was finally 
> locked down (supposedly).

Either APR or your app can be broken and in need of fix, independent of 
whether or not the API has been "supposedly" locked down.

  Never tested in .44 or .45, but had no bug
> reports. Only with .46 and .47 have I've had bug reports about failures. 
>  Since I didn't change my code in several months, something changed in 
> Apache or the APR.
> 
>>> Since Apache 2.0.46, mod_watch has no longer worked. The 
>>> apr_global_mutex_child_init() consistantly fails and now I'm finally 
>>> trying to get mod_watch/4 working again.
>>
>>
>>
>> Exactly what fails?  (which syscall fails with which errno)
> 
> 
> [Sun Sep 07 17:58:25 2003] [crit] (20014)Error string not specified yet: 

20014 is APR_EGENERAL :(

oops, from your code below I see you're hard-coding the error you pass 
to ap_log_rerror()...  can you fix that and see what error code APR is 
returning?  even if we can't get a syscall trace that would still be helpful

> apr_global_mutex_child_init(8111428, /var/lib/mod_watch/SharedHash.lock, 
> 81a5018) failed in shChildInit()
> 
> --- from mod_watch.c ---
> 
> #undef WHEN_APACHE_EXPLAINS_WHAT_TO_DO
> 
> static void
> watchChildInit(apr_pool_t *p, server_rec *s)
> {
> #if defined(WHEN_APACHE_EXPLAINS_WHAT_TO_DO) && defined(__unix__)
>     unixd_setup_child();
> #endif
>     shChildInit(shtable, p);
> }
> 
> --- from SharedHash.c ---
> 
> void
> shChildInit(struct shTable *tp, apr_pool_t *p)
> {
>     int rc;
> 
>     rc = apr_global_mutex_child_init(
>         (apr_global_mutex_t **) &tp->mutex, tp->lockfile, p
>     );
> 
>     if (rc != APR_SUCCESS) {
>         ap_log_error(
>             APLOG_MARK, APLOG_CRIT, APR_EGENERAL, watchMainServer,

you need to pass rc here instead of APR_EGENERAL

>             "apr_global_mutex_child_init(%lx, %s, %lx) failed in 
> shChildInit()",
>             &tp->mutex, tp->lockfile, p
>         );
>     }
> }
> 
> And how do I go about getting the syscall trace?  I'm not familar with 
> the tool to do this on FreeBSD (nor on Linux for that matter) having 
> never had need to do it before.

truss on FreeBSD, strace on Linux...   but FreeBSD truss can't follow 
child processes last I checked, so seeing what the child does early in 
startup could be problematic

> 
>> compare your mutex setup logic (parent and child) with what happens in 
>> standard Apache modules.
> 
> 
> And which module would you recommend I look at?   I've looked at
> mod_digest.c and I recall that being buggy and a bad example back at the 
> beginning of the year.  mod_rewrite.c is pretty simple and my child init 
> code is not much different.

mod_rewrite is reasonable



Mime
View raw message