Zev Toledano | 5 Apr 2011 17:54

Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

Greetings,

I need to report a possible serious bug but can't find any way to do 
this except via this mailing list. Apologies if I am doing this wrong:

I have developed my own Windows FastCGI app that uses its own FastCGI 
protocol implementation, and it depends on 
Apache2+mod_fastcgi-2.4.6-AP22.dll to run it.

I recently noticed that httpd.exe sometimes stops responding and takes 
100% cpu until it is killed.

After MUCH debugging, I found the cause:

Sending an FCGIEndRequest(3) packet header in pieces. Specifically, If I 
send the first two bytes of the packet separately, and then the rest, it 
causes the 100% cpu issue. This happens because I send the complete 
response in batches of 4096 and sometimes the packet headers become split.

Can anyone confirm this or tell me where to report bugs and what to do next?
Zev Toledano | 12 Apr 2011 10:47

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

OK I did my part. I guess this project isn't as alive as I thought....

On 05/04/2011 18:54, Zev Toledano wrote:

> Greetings,
>
> I need to report a possible serious bug but can't find any way to do 
> this except via this mailing list. Apologies if I am doing this wrong:
>
> I have developed my own Windows FastCGI app that uses its own FastCGI 
> protocol implementation, and it depends on 
> Apache2+mod_fastcgi-2.4.6-AP22.dll to run it.
>
> I recently noticed that httpd.exe sometimes stops responding and takes 
> 100% cpu until it is killed.
>
> After MUCH debugging, I found the cause:
>
> Sending an FCGIEndRequest(3) packet header in pieces. Specifically, If 
> I send the first two bytes of the packet separately, and then the 
> rest, it causes the 100% cpu issue. This happens because I send the 
> complete response in batches of 4096 and sometimes the packet headers 
> become split.
>
> Can anyone confirm this or tell me where to report bugs and what to do 
> next?
>
Mrjk | 12 Apr 2011 11:33
Picon
Gravatar

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

Hi, I think you should report this bug on the official Apache mailing list ...

Best regards,
--
MrJK

2011/4/12 Zev Toledano <fcgi@...>:
> OK I did my part. I guess this project isn't as alive as I thought....
>
>
>
> On 05/04/2011 18:54, Zev Toledano wrote:
>
>> Greetings,
>>
>> I need to report a possible serious bug but can't find any way to do this
>> except via this mailing list. Apologies if I am doing this wrong:
>>
>> I have developed my own Windows FastCGI app that uses its own FastCGI
>> protocol implementation, and it depends on
>> Apache2+mod_fastcgi-2.4.6-AP22.dll to run it.
>>
>> I recently noticed that httpd.exe sometimes stops responding and takes
>> 100% cpu until it is killed.
>>
>> After MUCH debugging, I found the cause:
>>
>> Sending an FCGIEndRequest(3) packet header in pieces. Specifically, If I
>> send the first two bytes of the packet separately, and then the rest, it
>> causes the 100% cpu issue. This happens because I send the complete response
(Continue reading)

Zev Toledano | 12 Apr 2011 12:03

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

As far as I understand, mod_fastcgi has nothing to do with Apache?

On 12/04/2011 12:33, Mrjk wrote:

> Hi, I think you should report this bug on the official Apache mailing list ...
>
> Best regards,
> --
> MrJK
>
>
>
> 2011/4/12 Zev Toledano<fcgi@...>:
>> OK I did my part. I guess this project isn't as alive as I thought....
Darren Garvey | 12 Apr 2011 11:49
Picon

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

Hi Zev,

On 12 April 2011 09:47, Zev Toledano <fcgi-guzWcuRpM7DB93p7Qn8acw@public.gmane.org> wrote:
OK I did my part. I guess this project isn't as alive as I thought....

AFAICT, mod_fastcgi hasn't had anyone maintaining it for quite some time. However, mod_fcgid is now part of Apache so you may consider "upgrading" to that module if you prefer to use maintained code. 

Be aware though that mod_fcgid doesn't support external servers and possibly a couple of other features of mod_fastcgi.

Regards,
Darren
_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Richard Mansfield | 12 Apr 2011 11:59
Picon

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

The lack of support for external servers, in practice, seems to be a
huge hole in the feature set. A large benefit of FCGI is in being able
to easily connect custom non-web applications to a webserver for eg.
providing data for existing web applications.

Zev, have you been able to trace through the server code and figure
out what is happening? I looked through fcgi_protocol_dequeue at
http://www.fastcgi.com/cvs/mod_fastcgi/fcgi_protocol.c and it looks
correct to me. Perhaps with more information a fix could still be
applied?

On Tue, Apr 12, 2011 at 5:49 AM, Darren Garvey
<lists.drrngrvy@...> wrote:
> Hi Zev,
>
> On 12 April 2011 09:47, Zev Toledano <fcgi@...> wrote:
>>
>> OK I did my part. I guess this project isn't as alive as I thought....
>
> AFAICT, mod_fastcgi hasn't had anyone maintaining it for quite some time.
> However, mod_fcgid is now part of Apache so you may consider "upgrading" to
> that module if you prefer to use maintained code.
> Be aware though that mod_fcgid doesn't support external servers and possibly
> a couple of other features of mod_fastcgi.
> Regards,
> Darren
> _______________________________________________
> FastCGI-developers mailing list
> FastCGI-developers@...
> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
>
>

--

-- 
Thanks,
Rick
Zev Toledano | 12 Apr 2011 12:20

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll


On 12/04/2011 12:59, Richard Mansfield wrote:

> The lack of support for external servers, in practice, seems to be a
> huge hole in the feature set. A large benefit of FCGI is in being able
> to easily connect custom non-web applications to a webserver for eg.
> providing data for existing web applications.
Exactly, which is what I am doing. I converted my client-server app into 
a web app using fastcgi and it required that I make my own fastcgi 
protocol implementation but at least I don't have to rewrite everything 
else.

This means that support for external servers/TCPIP is pretty important 
like you say.

> Zev, have you been able to trace through the server code and figure
> out what is happening? I looked through fcgi_protocol_dequeue at
> http://www.fastcgi.com/cvs/mod_fastcgi/fcgi_protocol.c and it looks
> correct to me. Perhaps with more information a fix could still be
> applied?

Frankly, it took me 3-4 days of painful debugging just to find the cause 
and then 10 minutes to program a workaround and I didn't feel like 
starting to debug mod_fastcgi code after that. As i said, my workaround 
was to ensure that end packets were never split - everything else worked 
fine. WIthout it, I get an unequivocal 100% cpu freeze on httpd.exe 
every single time.
David Birnbaum | 12 Apr 2011 14:36

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

Greetings,

It's not so much that mod_fastcgi isn't supported, just that it's been 
pretty stable.  There are a few people paying attention who will try to 
roll up a patch now and then.  The original supporters of the code, 
alas, haven't been writing web apps for a number of years, so we don't 
have a good way to test changes.

My suggestion is to post your diff and encourage some people who might 
be affected to try it out, and we'll make sure it's listed for the next 
"official" patch, which has basically been about once a year or so just 
to roll up user contributions that go by.

Also, if anyone out there feels sufficiently up to the task to support 
the mod_fastcgi code base, by all means, get in touch.

Cheers,

David.

-----

On 4/12/11 5:59 AM, Richard Mansfield wrote:
> The lack of support for external servers, in practice, seems to be a
> huge hole in the feature set. A large benefit of FCGI is in being able
> to easily connect custom non-web applications to a webserver for eg.
> providing data for existing web applications.
>
> Zev, have you been able to trace through the server code and figure
> out what is happening? I looked through fcgi_protocol_dequeue at
> http://www.fastcgi.com/cvs/mod_fastcgi/fcgi_protocol.c  and it looks
> correct to me. Perhaps with more information a fix could still be
> applied?
>
> On Tue, Apr 12, 2011 at 5:49 AM, Darren
Garvey<lists.drrngrvy@...>  wrote:
>> Hi Zev,
>>
>> On 12 April 2011 09:47, Zev Toledano<fcgi@...>  wrote:
>>> OK I did my part. I guess this project isn't as alive as I thought....
>> AFAICT, mod_fastcgi hasn't had anyone maintaining it for quite some time.
>> However, mod_fcgid is now part of Apache so you may consider "upgrading" to
>> that module if you prefer to use maintained code.
>> Be aware though that mod_fcgid doesn't support external servers and possibly
>> a couple of other features of mod_fastcgi.
>> Regards,
>> Darren
>> _______________________________________________
>> FastCGI-developers mailing list
>> FastCGI-developers@...
>> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
>>
>>
>
Tom Bowden | 12 Apr 2011 23:42
Picon

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

It's my bread and butter at the moment -- with some credit card apps  
that interface with truckstops, casinos, and credit-companies -   so  
I could step up to help with maintenance.

Tom

On Apr 12, 2011, at 7:36 AM, David Birnbaum wrote:

> Greetings,
>
> It's not so much that mod_fastcgi isn't supported, just that it's  
> been pretty stable.  There are a few people paying attention who  
> will try to roll up a patch now and then.  The original supporters  
> of the code, alas, haven't been writing web apps for a number of  
> years, so we don't have a good way to test changes.
>
> My suggestion is to post your diff and encourage some people who  
> might be affected to try it out, and we'll make sure it's listed  
> for the next "official" patch, which has basically been about once  
> a year or so just to roll up user contributions that go by.
>
> Also, if anyone out there feels sufficiently up to the task to  
> support the mod_fastcgi code base, by all means, get in touch.
>
> Cheers,
>
> David.
>
> -----
>
> On 4/12/11 5:59 AM, Richard Mansfield wrote:
>> The lack of support for external servers, in practice, seems to be a
>> huge hole in the feature set. A large benefit of FCGI is in being  
>> able
>> to easily connect custom non-web applications to a webserver for eg.
>> providing data for existing web applications.
>>
>> Zev, have you been able to trace through the server code and figure
>> out what is happening? I looked through fcgi_protocol_dequeue at
>> http://www.fastcgi.com/cvs/mod_fastcgi/fcgi_protocol.c  and it looks
>> correct to me. Perhaps with more information a fix could still be
>> applied?
>>
>> On Tue, Apr 12, 2011 at 5:49 AM, Darren  
>> Garvey<lists.drrngrvy@...>  wrote:
>>> Hi Zev,
>>>
>>> On 12 April 2011 09:47, Zev Toledano<fcgi@...>  wrote:
>>>> OK I did my part. I guess this project isn't as alive as I  
>>>> thought....
>>> AFAICT, mod_fastcgi hasn't had anyone maintaining it for quite  
>>> some time.
>>> However, mod_fcgid is now part of Apache so you may consider  
>>> "upgrading" to
>>> that module if you prefer to use maintained code.
>>> Be aware though that mod_fcgid doesn't support external servers  
>>> and possibly
>>> a couple of other features of mod_fastcgi.
>>> Regards,
>>> Darren
>>> _______________________________________________
>>> FastCGI-developers mailing list
>>> FastCGI-developers@...
>>> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
>>>
>>>
>>
> _______________________________________________
> FastCGI-developers mailing list
> FastCGI-developers@...
> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Zev Toledano | 12 Apr 2011 12:12

Re: Possible serious bug in mod_fastcgi-2.4.6-AP22.dll

I already made my code work for mod_fcgid as well as IIS. But I found mod_fastcgi to be faster than mod_fcgid when it comes to concurrency and request queueing. Of course my tests were not very scientific, but this is my current impression. Add to this also the lack of support for TCP/IP.


I also found it more difficult to work directly with mod_fcgid - it has odd and very impatient behaviour concerning named pipes with queued requests. I made it work in the end, but overall and without going into more details, my impression was that mod_fcgid isn't as mature/well-written for developers like me writing their own implementation.


So it's a pity mod_fastcgi isn't being maintained.



On 12/04/2011 12:49, Darren Garvey wrote:

Hi Zev,

On 12 April 2011 09:47, Zev Toledano <fcgi-guzWcuRpM7DB93p7Qn8acw@public.gmane.org> wrote:
OK I did my part. I guess this project isn't as alive as I thought....

AFAICT, mod_fastcgi hasn't had anyone maintaining it for quite some time. However, mod_fcgid is now part of Apache so you may consider "upgrading" to that module if you prefer to use maintained code. 

Be aware though that mod_fcgid doesn't support external servers and possibly a couple of other features of mod_fastcgi.

Regards,
Darren
_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers

Gmane