apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Wiebe <aar...@networksolutions.com>
Subject apr_initialize smashing stack
Date Tue, 27 May 2008 19:08:37 GMT
Greetings,

I'm using APR for a project here, and I found a rather problematic issue 
that perhaps someone could shed some light on.  I am using APR 1.2.12.

As soon as I call apr_initialize(), stack gets smashed, even with the 
simplest of apps.

Please CC me on response, since I'm not on this list.



Example app:

#define _LARGEFILE64_SOURCE
#include <apr_pools.h>

int main(int argc, char *argv[])
{
     if(argc == 2)
         apr_initialize();
     return 0;
}




Selections from the GDB output (keep your eye on the value of main's 
argc):

(gdb) set args asdf
(gdb) break main
...
#0  main (argc=2, argv=0xbf88e5b4) at blah.c:6
(gdb) s
7               apr_initialize();
(gdb) s
apr_initialize () at misc/unix/start.c:46
46          if (initialized++) {
(gdb) s
51          apr_proc_mutex_unix_setup_lock();
(gdb) s
apr_proc_mutex_unix_setup_lock () at locks/unix/proc_mutex.c:662
662     {
(gdb) bt
#0  apr_proc_mutex_unix_setup_lock () at locks/unix/proc_mutex.c:662
#1  0xb7f236a5 in apr_initialize () at misc/unix/start.c:51
#2  0x0804847f in main (argc=2, argv=0xbf88e5b4) at blah.c:7
(gdb) s
165         proc_mutex_op_on.sem_op = -1;
(gdb) bt
#0  apr_proc_mutex_unix_setup_lock () at locks/unix/proc_mutex.c:165
#1  0xb7f236a5 in apr_initialize () at misc/unix/start.c:51
#2  0x0804847f in main (argc=147780, argv=0xb7f378b8) at blah.c:7



This one is beyond me.  I'm open to suggestions...

Aaron Wiebe
Platform Engineer, Network Solutions
p.  416 645 4639 || m.  416 302 4308
e.  aaronw@networksolutions.com

Mime
View raw message