pip crashes when reinstalling native wheels

Bug #1821483 reported by Dan Kegel
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
pip
Fix Released
Unknown
python-pip (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

On Ubuntu 18.04 (and ,
Running 'pip install simplejson' or 'pip install PyOpenSSL' twice
crashes on exit because their shared libraries are overwritten while in use.

To reproduce:

$ sudo apt install python-pip
$ pip install simplejson
$ pip install simplejson
Segmentation fault (core dumped)

Running (on some machines, at least) under gdb is illuminating:
$ sudo apt install python-dbg
$ gdb python
(gdb) set args -m pip install simplejson
(gdb) run
Starting program: /usr/bin/python -m pip install simplejson
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Collecting simplejson
Installing collected packages: simplejson
Successfully installed simplejson-3.16.0

Program received signal SIGSEGV, Segmentation fault.
0x000055555562ae84 in visit_decref () at ../Modules/gcmodule.c:360
360 ../Modules/gcmodule.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x000055555562ae84 in visit_decref ()
    at ../Modules/gcmodule.c:360
#1 0x000055555562b004 in dict_traverse.lto_priv ()
    at ../Objects/dictobject.c:2198
#2 0x0000555555629da5 in subtract_refs ()
    at ../Modules/gcmodule.c:385
#3 collect.lto_priv () at ../Modules/gcmodule.c:925
#4 0x0000555555686721 in PyGC_Collect ()
    at ../Modules/gcmodule.c:1440
#5 0x0000555555685923 in Py_Finalize () at ../Python/pythonrun.c:455
#6 0x00005555556a9bc8 in Py_Exit (sts=sts@entry=0)
    at ../Python/pythonrun.c:1792

That backtrace that looks similar to
https://github.com/pypa/pip/issues/5366

Happily, the fix that was committed for the bug seems simple and plausible, and cherrypicking it seems to prevent the crash.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: python-pip 9.0.1-2.3~ubuntu1
ProcVersionSignature: User Name 4.15.0-46.49-generic 4.15.18
Uname: Linux 4.15.0-46-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.6
Architecture: amd64
Date: Sat Mar 23 21:46:31 2019
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: python-pip
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dan Kegel (dank) wrote :
Revision history for this message
Dan Kegel (dank) wrote :

https://launchpad.net/~dank/+archive/ubuntu/python-fixes contains an updated pip with the cherrypicked fix.
(Also, http://kegel.com/linux/howto-ppa/ happens to document how it was prepared.)

Revision history for this message
Dan Kegel (dank) wrote :

The first line of the bug report should have said "and ubuntu 16.04".

https://launchpad.net/~dank/+archive/ubuntu/python-fixes/+packages now includes
updated pip with the cherrypicked fix for both ubuntu 16.04 and ubuntu 18.04.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-pip (Ubuntu):
status: New → Confirmed
Revision history for this message
Kai Kasurinen (kai-kasurinen) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the current version of Ubuntu.

Changed in python-pip (Ubuntu):
status: Confirmed → Fix Released
Changed in pip:
status: Unknown → 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.