Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 1882 invoked from network); 7 Sep 2003 18:45:45 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 Sep 2003 18:45:45 -0000 Received: (qmail 65700 invoked by uid 500); 7 Sep 2003 18:45:33 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 65656 invoked by uid 500); 7 Sep 2003 18:45:32 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 65638 invoked from network); 7 Sep 2003 18:45:32 -0000 Message-ID: <3F5B7406.2040808@attglobal.net> Date: Sun, 07 Sep 2003 14:08:06 -0400 From: Jeff Trawick Reply-To: trawick@attglobal.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: achowe@snert.com CC: dev@apr.apache.org Subject: Re: apr_global_mutex_child_init & mod_watch References: <3F5B53C8.3010500@snert.com> <3F5B58B3.7040901@attglobal.net> <3F5B5E03.4010604@snert.com> In-Reply-To: <3F5B5E03.4010604@snert.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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