You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Sam Carleton <sc...@miltonstreet.com> on 2010/05/03 04:37:29 UTC

found/fixed a bug in the mod_axis2 function: apache2_stream_read

I was load testing my apache code today by starting 50 clients which all
start in a slide show mode, pooling the server at least every 5 seconds.  I
have a manager program that starts the clients and does does an abort of the
processes when I want to close them.  That is the secret, the abort...

I was watching memory usage while it ran, and all was fine, Apache held
steady at around 55 megs.  Once I killed the 50 processes, all at the EXACT
same time, well milliseconds apart, the memory usage sky rocketed.  When I
broke the code, I was in the mod_axis2::apache2_stream_read function.

It turns out that ap_get_client_block(...) was returning 0xFFFFFFFF to the
read variable:

read = ap_get_client_block(stream_impl->request, (char *) buffer + len,
                           count - len);
if (read > 0)

It turns out that read is unsigned, so the 0xFFFFFFFF is NOT negative, so I
changed the code to read:

if (read > 0 && read != 0xFFFFFFFF)

All is well after the minor addition!

Sam

Re: found/fixed a bug in the mod_axis2 function: apache2_stream_read

Posted by Sam Carleton <sc...@gmail.com>.
On Mon, May 3, 2010 at 1:52 AM, Nandika Jayawardana <ja...@gmail.com>wrote:

> Thanks for the bug fix. Can you create a jira for this issue and attach the
> patch.
>

It was my honor!  It is in Jira.

Sam

Re: found/fixed a bug in the mod_axis2 function: apache2_stream_read

Posted by Nandika Jayawardana <ja...@gmail.com>.
Thanks for the bug fix. Can you create a jira for this issue and attach the
patch.

Regards
Nandika


On Mon, May 3, 2010 at 8:07 AM, Sam Carleton <sc...@miltonstreet.com>wrote:

> I was load testing my apache code today by starting 50 clients which all
> start in a slide show mode, pooling the server at least every 5 seconds.  I
> have a manager program that starts the clients and does does an abort of the
> processes when I want to close them.  That is the secret, the abort...
>
> I was watching memory usage while it ran, and all was fine, Apache held
> steady at around 55 megs.  Once I killed the 50 processes, all at the EXACT
> same time, well milliseconds apart, the memory usage sky rocketed.  When I
> broke the code, I was in the mod_axis2::apache2_stream_read function.
>
> It turns out that ap_get_client_block(...) was returning 0xFFFFFFFF to the
> read variable:
>
> read = ap_get_client_block(stream_impl->request, (char *) buffer + len,
>                            count - len);
> if (read > 0)
>
> It turns out that read is unsigned, so the 0xFFFFFFFF is NOT negative, so I
> changed the code to read:
>
> if (read > 0 && read != 0xFFFFFFFF)
>
> All is well after the minor addition!
>
> Sam
>
>


-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com