Using Pdb for Python causes a segmentation fault in readline

Bug #1426716 reported by Rob van der Most
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I am debugging a Python unit test using pdb. In my code I use the following:

import pdb
...

    pdb.set_trace()

This drops me into a Pdb prompt (handled by readline).

When entering 'n' a few time to step I encounter a segmentation fault. Details and backtrace are in attached log file.

I tried using apport to report this, but apport keeps crashing while analysing the issue :-(

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: python 2.7.8-1
ProcVersionSignature: Ubuntu 3.16.0-31.41-generic 3.16.7-ckt5
Uname: Linux 3.16.0-31-generic x86_64
ApportVersion: 2.14.7-0ubuntu8.2
Architecture: amd64
CurrentDesktop: KDE
Date: Sat Feb 28 16:26:43 2015
InstallationDate: Installed on 2013-10-19 (497 days ago)
InstallationMedia: Xubuntu 12.04.3 LTS "Precise Pangolin" - Release amd64 (20130822)
SourcePackage: python-defaults
UpgradeStatus: Upgraded to utopic on 2014-10-25 (126 days ago)

Revision history for this message
Rob van der Most (rzb) wrote :
affects: python-defaults (Ubuntu) → python2.7 (Ubuntu)
Revision history for this message
Brian Murray (brian-murray) wrote :

It might help if you were to also provide the code that you were trying to debug.

Revision history for this message
Rob van der Most (rzb) wrote :

I tried creating a minimal test case, but did not succeed yet. I can reproduce with the following:

- Get Pyglet development branch: hg clone ssh://<email address hidden>/pyglet/pyglet
- In pyglet/media/__init__.py add before "class StaticMemorySource" (line 635):
-- "import pdb"
- In pyglet/media/__init__.py add in def seek() (line 649):
-- "pdb.set_trace()"

Then run the unit tests:
- python -m unittest tests.unit.test_media

Each time pdb is activated enter "n" a few times (max 5). If it does not crash enter "c" to skip to the next test case and repeat.

Usually it segfaults in the 2nd or 3rd test case. It seems to happen easier if you do it slowly.

I will still try to get a minimal test case for it.

Revision history for this message
Rob van der Most (rzb) wrote :

I attached a modified version of pyglet/media/__init__.py with the changes mentioned in my previous comment. Just replace it after cloning the repo.

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.