You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Rohan Nandode <rn...@yahoo.com> on 2003/04/11 18:35:23 UTC
httpd process hangs
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
RE: httpd process hangs
Posted by Sander Striker <st...@apache.org>.
> From: Jeff Trawick [mailto:trawick@attglobal.net]
> Sent: Saturday, April 12, 2003 3:25 PM
> Rohan Nandode wrote:
> > Hi Jeff,
> >
> > Thanks for the response.
> > If possible, could you elaborate, why the problem is occuring?
> > This is happening while destroying the APR's 'global_pool' in apr_terminate().
And therefor it can be a lot of things.
> I have absolutely no clue why it is occuring.
>
> I just wanted to point out that lots of changes (presumably
> improvements) have been made since then and it is worthwhile to try the
> latest code because it may just be fixed by now
AFAIK, I've seen this once and fixed it. The problem was a lifetime issue
with mutexes IIRC. Could be something else though.
> and few developers are going to want to debug a potentially hairy problem
> in such old code anyway.
*nod* *nod*
Please try to reproduce with 2.0.45, if it is still present, post a backtrace
(and possibly a reproduction recipe). I'll happily look into it then.
Sander
Re: httpd process hangs
Posted by Jeff Trawick <tr...@attglobal.net>.
Rohan Nandode wrote:
> Hi Jeff,
>
> Thanks for the response.
> If possible, could you elaborate, why the problem is
> occuring?
> This is happening while destroying the APR's
> 'global_pool' in apr_terminate().
I have absolutely no clue why it is occuring.
I just wanted to point out that lots of changes (presumably
improvements) have been made since then and it is worthwhile to try the
latest code because it may just be fixed by now and few developers are
going to want to debug a potentially hairy problem in such old code anyway.
Re: httpd process hangs
Posted by Rohan Nandode <rn...@yahoo.com>.
Hi Jeff,
Thanks for the response.
If possible, could you elaborate, why the problem is
occuring?
This is happening while destroying the APR's
'global_pool' in apr_terminate().
Thanks
Rohan
--- Jeff Trawick <tr...@attglobal.net> wrote:
> Rohan Nandode wrote:
>
> > The Apache version is 2.0.35 and OS is Solaris 8
>
> please try to reproduce this with Apache 2.0.45...
>
> The differences between 2.0.35 and 2.0.45 in just
> the one file where the
> problem occurred between are shown below:
>
>
http://cvs.apache.org/viewcvs.cgi/apr/memory/unix/apr_pools.c.diff?r1=text&tr1=1.165&r2=text&tr2=1.195&diff_format=u
>
> Meanwhile there are lots of changes everywhere else
> in Apache that would
> affect how the pools are used.
>
> Thanks,
>
> Jeff
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
Re: httpd process hangs
Posted by Jeff Trawick <tr...@attglobal.net>.
Rohan Nandode wrote:
> The Apache version is 2.0.35 and OS is Solaris 8
please try to reproduce this with Apache 2.0.45...
The differences between 2.0.35 and 2.0.45 in just the one file where the
problem occurred between are shown below:
http://cvs.apache.org/viewcvs.cgi/apr/memory/unix/apr_pools.c.diff?r1=text&tr1=1.165&r2=text&tr2=1.195&diff_format=u
Meanwhile there are lots of changes everywhere else in Apache that would
affect how the pools are used.
Thanks,
Jeff
Re: httpd process hangs
Posted by Jeff Trawick <tr...@attglobal.net>.
Rohan Nandode wrote:
> The Apache version is 2.0.35 and OS is Solaris 8
please try to reproduce this with Apache 2.0.45...
The differences between 2.0.35 and 2.0.45 in just the one file where the
problem occurred between are shown below:
http://cvs.apache.org/viewcvs.cgi/apr/memory/unix/apr_pools.c.diff?r1=text&tr1=1.165&r2=text&tr2=1.195&diff_format=u
Meanwhile there are lots of changes everywhere else in Apache that would
affect how the pools are used.
Thanks,
Jeff