setproctitle causes apache mod_wsgi to crash

Bug #1538736 reported by Jared Biel
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-setproctitle (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
Medium
Unassigned
Trusty
Fix Released
Medium
Unassigned

Bug Description

== Impact ==

If setproctitle is installed, celery will call it, making any WSGI application that imports celery at risk.

There are a lot of those in the world.

== Test Case ==

The patch includes a build time unit test that can replicate the bug.

OR

Point apache at this wsgi app:

from wsgiref.simple_server import demo_app
import setproctitle
application = demo_app

e.g. with WSGIScriptAlias / /var/www/foo.wsgi

== Regression Potential ==

This patch hobbles setproctitle in embedded Pythons. Upstream later added embedded support in 1.1.4, but I don't see any bugs being closed as a result of that.

So, probably minimal.

== ORIGINAL REPORT ==

When python-setproctitle is installed alongside mod_wsgi and the wsgi application imports setproctitle it causes apache to segfault every time a request comes in to that wsgi vhost.

GDB output:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 fix_argv (argv=0x0, argc=0) at src/setproctitle.c:124
124 src/setproctitle.c: No such file or directory.
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers

This was fixed in version 1.1.1 (https://github.com/dvarrazzo/py-setproctitle/issues/9) I recommend that this fix be backported to the 14.04 version of setproctitle.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-setproctitle 1.0.1-1ubuntu1
ProcVersionSignature: Ubuntu 3.19.0-42.48~14.04.1-generic 3.19.8-ckt10
Uname: Linux 3.19.0-42-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: amd64
Date: Wed Jan 27 20:34:46 2016
Ec2AMI: ami-9c1f8ef4
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: us-east-1a
Ec2InstanceType: m4.large
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
SourcePackage: python-setproctitle
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jared Biel (jared-biel-3) wrote :
Revision history for this message
Stefano Rivera (stefanor) wrote :
Changed in python-setproctitle (Ubuntu):
status: New → Fix Released
Changed in python-setproctitle (Ubuntu Precise):
importance: Undecided → Medium
Changed in python-setproctitle (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
Stefano Rivera (stefanor) wrote :
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jared, or anyone else affected,

Accepted python-setproctitle into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-setproctitle/1.0.1-1ubuntu1.14.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-setproctitle (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Changed in python-setproctitle (Ubuntu Precise):
status: New → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Jared, or anyone else affected,

Accepted python-setproctitle into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-setproctitle/1.0.1-1ubuntu1.12.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Jared, or anyone else affected,

Accepted python-setproctitle into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-setproctitle/1.0.1-1ubuntu1.14.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Jared, or anyone else affected,

Accepted python-setproctitle into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-setproctitle/1.0.1-1ubuntu1.12.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Jared Biel (jared-biel) wrote :

Bug confirmed fixed with python-setproctitle_1.0.1-1ubuntu1.14.04.2_amd64.deb.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Stefano Rivera (stefanor) wrote :

Verified on precise and trusty, under Apache mod_wsgi.

Mathew Hodson (mhodson)
Changed in python-setproctitle (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-setproctitle - 1.0.1-1ubuntu1.12.04.2

---------------
python-setproctitle (1.0.1-1ubuntu1.12.04.2) precise; urgency=medium

  * Fix build failure, oops.

python-setproctitle (1.0.1-1ubuntu1.12.04.1) precise; urgency=medium

  * Fix segfault when the module is imported under mod_wsgi (LP: #1538736)

 -- Stefano Rivera <email address hidden> Thu, 07 Apr 2016 15:19:32 -0700

Changed in python-setproctitle (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for python-setproctitle has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-setproctitle - 1.0.1-1ubuntu1.14.04.2

---------------
python-setproctitle (1.0.1-1ubuntu1.14.04.2) trusty; urgency=medium

  * Fix build failure, oops.

python-setproctitle (1.0.1-1ubuntu1.14.04.1) trusty; urgency=medium

  * Fix segfault when the module is imported under mod_wsgi (LP: #1538736)

 -- Stefano Rivera <email address hidden> Thu, 07 Apr 2016 15:19:32 -0700

Changed in python-setproctitle (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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