Python Segfault on os.exec

Bug #418848 reported by Pehr Söderman
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python
Invalid
Undecided
Unassigned
python2.6 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: python

Ubuntu Karmic, latest python from aptitude (2.6.2-0ubuntu1).

Using the exec command causes segfaults in python. For example:

Python 2.6.2+ (release26-maint, Jul 24 2009, 16:16:12)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.execlp('true')
Segmentation fault
~>

Expected behavior (from another Linux system):
Python 2.6 (r26:66714, Feb 3 2009, 20:49:49)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.execlp('true')
~>

This has been confirmed on 3 different computers running karmic.

Related branches

Revision history for this message
Pehr Söderman (pehrs) wrote :
Revision history for this message
Josh Kupershmidt (schmiddy) wrote :

I don't have a Karmic install handy to check the OP's reported behavior, but I can confirm that I *don't* get a segfault in Jaunty:

$ python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.execlp('true')
$

Revision history for this message
Marcin Wider (mwider) wrote :

I can reproduce this SegFault with Python 2.6.4 (r264:75706, Nov 2 2009, 14:38:03) - Karmic

Changed in python-defaults (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

this is wrong code (although python shouldn't crash). execlp requires at least two arguments.

Changed in python-defaults (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
Matthias Klose (doko) wrote :

fixed in python3

Changed in python:
status: Unknown → New
Matthias Klose (doko)
affects: python-defaults (Ubuntu) → python2.6 (Ubuntu)
Changed in python2.6 (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.6 - 2.6.5-1ubuntu1

---------------
python2.6 (2.6.5-1ubuntu1) lucid; urgency=low

  * Merge with Debian (2.6.5-1).

python2.6 (2.6.5-1) unstable; urgency=low

  * Python 2.6.5 final release.
  * Fix issue #4961: Inconsistent/wrong result of askyesno function in
    tkMessageBox with Tcl8.5. LP: #462950.
  * Issue #8154, fix segfault with os.execlp('true'). LP: #418848.
  * Apply proposed patch for issue #8032, gdb7 hooks for debugging.

python2.6 (2.6.5~rc2-2) unstable; urgency=low

  * Add copyright notices for the readline and _ssl extensions.
    Closes: #573866.
  * Backport issue #8140: Extend compileall to compile single files.
    Add -i option.
  * Backport issue #6949, build _bsddb extension with db-4.8.x.

python2.6 (2.6.5~rc2-1) unstable; urgency=low

  * Python 2.6.5 release candidate 2.
    - Replace the Monty Python audio test file. Closes: #568674.
  * Fix build failure on sparc64. Closes: #570845.
 -- Matthias Klose <email address hidden> Sat, 20 Mar 2010 03:57:17 +0100

Changed in python2.6 (Ubuntu):
status: In Progress → Fix Released
Changed in python:
status: New → Fix Released
Revision history for this message
R. David Murray (rdmurray) wrote :

This is not a bug in python. It is most likely a bug in /bin/true, crashing when called with argc set to 0. As noted in the upstream tracker, the fix applied to python is likely to break currently working python code.

Changed in python:
status: Fix Released → New
Changed in python:
status: New → Fix Committed
Revision history for this message
dino99 (9d9) wrote :

This version has expired

Changed in python:
importance: Unknown → Undecided
status: Fix Committed → New
status: New → Invalid
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.