apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject segfault in apr_atomic_cas
Date Wed, 24 Sep 2003 22:09:12 GMT
When using apr built with --enable-pool-debug=all I get this segfault on the 
httpd server startup:

#0  0x4026cbe4 in apr_atomic_cas ()
    from /home/stas/httpd/prefork/lib/libapr-0.so.0
(gdb) where
#0  0x4026cbe4 in apr_atomic_cas ()
    from /home/stas/httpd/prefork/lib/libapr-0.so.0
#1  0x40268b2d in apr_thread_mutex_lock ()
    from /home/stas/httpd/prefork/lib/libapr-0.so.0
#2  0x4026b77e in apr_pool_create_ex_debug ()
    from /home/stas/httpd/prefork/lib/libapr-0.so.0
#3  0x40267685 in apr_initialize ()
    from /home/stas/httpd/prefork/lib/libapr-0.so.0
#4  0x40267618 in apr_app_initialize ()
    from /home/stas/httpd/prefork/lib/libapr-0.so.0
#5  0x080c6fb8 in main (argc=2, argv=0xbffff4e4) at main.c:426
#6  0x40352c57 in __libc_start_main () from /lib/i686/libc.so.6

This happens because hash_mutex[] is not initialized when apr_pool_create is 
called.

The apr_atomic_init that initializes that variable is running too late:

     if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {
         return APR_ENOPOOL;
     }

     apr_pool_tag(pool, "apr_initialize");

     if ((status = apr_atomic_init(pool)) != APR_SUCCESS) {
         return status;
     }




__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message