Stack smashing while using a lot of connections

Bug #933417 reported by Anton Kortunov on 2012-02-16
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libfcgi (Debian)
Fix Released
Unknown
libfcgi (Ubuntu)
Medium
Clint Byrum

Bug Description

libfcgi uses select syscall, when some applications tryes to use more than 1024 connections from web-server it crashes. There is a solutions for this problem: use poll in os_unix.c instead of select. Patch with this change is attached to this bug. This patch was written in Yandex and successfully used for a several months.

LIBFCGI_OS_CLOSE_POLL_TIMEOUT and LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT environment variables are added to control poll timeouts in Os_Close and is_af_unix_keeper functions accordingly.

$ lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04

Package libfcgi0ldbl 2.4.0-7.1ubuntu1

Anton Kortunov (toshic-toshic) wrote :

The attachment "poll.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in libfcgi (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Clint Byrum (clint-fewbar)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libfcgi - 2.4.0-8.1ubuntu1

---------------
libfcgi (2.4.0-8.1ubuntu1) quantal; urgency=low

  * Applying patch to use poll instead of select which helps handle
    more than 1024 connections. (LP: #933417). Thanks Anton Kortunov!
 -- Clint Byrum <email address hidden> Sat, 14 Jul 2012 08:20:42 -0700

Changed in libfcgi (Ubuntu):
status: In Progress → Fix Released
Clint Byrum (clint-fewbar) wrote :

Hi Anton. Thanks for the patch. Its simple enough and has a large enough benefit that I've gone ahead and applied it in Ubuntu. I have tried as hard as I can to submit this to the fastcgi-developers mailing list but they seem to have been having problems since May of 2011 so I don't know if it will reach any of them.

Changed in libfcgi (Debian):
status: Unknown → New
Changed in libfcgi (Debian):
status: New → Fix Released
Aarti Dongargaonkar (adongarg) wrote :

I see that the patch has the fix to use poll instead of select in the 2 functions - OS_Close and is_af_unix_keeper. But I see that select is used in one more place in OS_DoIo in os_unix.c. Any reason why this select is not changed to poll? Is there a patch available to fix this? Thanks.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.