apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohan Nandode <rnand...@yahoo.com>
Subject httpd process hangs
Date Fri, 11 Apr 2003 16:35:23 GMT
Hi,

  The Apache version is 2.0.35 and OS is Solaris 8
with prefrok MPM variation. It works fine but gives a
problem only at shutdown. All the child process die
gracefully, but the parent process does not. It hangs
in ' apr_allocator_destroy' for the 'global_pool'
(defined in apr_pools.c) and takes too much of CPU.

The stack trace is :
#0  apr_allocator_destroy (allocator=0x1f5e38) at
apr_pools.c:136
#1  0xff3196a0 in apr_pool_terminate () at
apr_pools.c:519
#2  0x9f038 in destroy_and_exit_process
(process=0x1fa748, 
    process_exit_value=0) at main.c:253
#3  0x9fcd8 in main (argc=2764944, argv=0x1e4fec) at
main.c:657

The source for apr_allocator_destroy() is ( I have
added some fprintfs)
131     fprintf(stderr, " In apr_allocator_destroy
....\n");
132         for (index = 0; index < MAX_INDEX;
index++) {
133             ref = &allocator->free[index];
134             while ((node = *ref) != NULL) {
135                 *ref = node->next;
(gdb) 
136     fprintf(stderr, "Node is %p  index=
%d\n",node, index);
137                 free(node);
138                 node = NULL;
139     fprintf(stderr, "After free Node is %p
\n",node);
140             }
141         }
--------------------------------------------------
GDB shows following information-
(gdb) p *allocator
$7 = {max_index = 2, mutex = 0x0, owner = 0x1f5eb0,
free = {0x0, 0x2653b8, 
    0x2a3ba8, 0x0 <repeats 17 times>}}
(gdb) p node
$8 = (apr_memnode_t *) 0x2653b8
(gdb) p *node
$9 = {next = 0x2633b0, index = 1, first_avail =
0x265960 "", endp = 0x2673b8 ""}
(gdb)p index
$10 = 1

------------------------------------------------
My observation is: 
allocator->free[1] and node->next form a cycle in link
list. And hence the while loop does not break, causing
the hang. 
I tried to set 'node' to NULL after free, but didn't
help. 


Could someone give any clues the problem?

Thanks in advance
Rohan 

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

Mime
View raw message