matplotlib crashes after recent tcl/tk update

Bug #1266605 reported by Tim Lunn
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
matplotlib (Ubuntu)
Fix Released
Undecided
Julian Taylor

Bug Description

matplotlib now segfaults after last weeks tcl/tk update.

See attach script to reproduce crash

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1482, in __call__
    return self.func(*args)
  File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 276, in resize
    self.show()
  File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 349, in draw
    tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
  File "/usr/lib/pymodules/python2.7/matplotlib/backends/tkagg.py", line 20, in blit
    tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox_array))
TclError

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-matplotlib 1.3.1-1ubuntu2
ProcVersionSignature: Ubuntu 3.12.0-7.15-generic 3.12.4
Uname: Linux 3.12.0-7-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.12.7-0ubuntu3
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Jan 7 11:02:40 2014
InstallationDate: Installed on 2012-09-23 (470 days ago)
InstallationMedia: Ubuntu GNOME Remix 12.10 "Quantal Quetzal" - Alpha amd64(20120922)
SourcePackage: matplotlib
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tim Lunn (darkxst) wrote :
Revision history for this message
Tim Lunn (darkxst) wrote :
Revision history for this message
Tim Lunn (darkxst) wrote :
Revision history for this message
Tim Lunn (darkxst) wrote :

I tried to do a local build in pbuilder and currently the tkagg backend is not being built.

Revision history for this message
Tim Lunn (darkxst) wrote :
Revision history for this message
Julian Taylor (jtaylor) wrote :

thanks seems to work
matplotlib really needs a autopkgtest, this breaks regularly ...

Changed in matplotlib (Ubuntu):
assignee: nobody → Julian Taylor (jtaylor)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package matplotlib - 1.3.1-1ubuntu3

---------------
matplotlib (1.3.1-1ubuntu3) trusty; urgency=medium

  [ Tim Lunn ]
  * debian/control: Build depend against tcl/tk 8.6 since this is the default
    for python2.7 now (LP: #1266605)

  [ Julian Taylor ]
  * add python{,3}-tk-dbg build dependency for debug tkagg backend
  * add autopkgtest doing basic testing of a few backends
 -- Tim Lunn <email address hidden> Tue, 07 Jan 2014 11:08:52 +1100

Changed in matplotlib (Ubuntu):
status: New → Fix Released
Revision history for this message
David Murphy (dnamurphy) wrote :

I still see this crash (with identical traceback) even after upgrading my 14.04 Xubuntu 64-bit system to tcl/tk 8.6:

python-matplotlib/trusty,now 1.3.1-1ubuntu5 amd64
tcl8.6-dev/trusty,now 8.6.1-4ubuntu1 amd64
tk8.6-dev/trusty,now 8.6.1-3ubuntu2 amd64

Suggestions?

Revision history for this message
Julian Taylor (jtaylor) wrote :

are you sure you are using the packaged matplotlib and not a local installation?
run

python -c "import matplotlib; print matplotlib"

to see what you are using

Revision history for this message
David Murphy (dnamurphy) wrote :

It's the packaged one:

<module 'matplotlib' from '/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.pyc'>

Revision history for this message
Sandro Tosi (morph-debian) wrote :

David, it is not :) no package will ever install something in /usr/local so it's a custom installation

Revision history for this message
David Murphy (dnamurphy) wrote :

Hi Sandro,

Are you sure? After an initial apt-get purge, I checked, and indeed /usr/local/lib/python2.7/dist-packages/matplotlib/ remained in place as you imply. I then moved matplotlib* in the above directory out of the way, and sure enough python then fails to import. When I re-install however, it is placed in exactly this directory:

david@spengler:~$ python -c "import matplotlib; print matplotlib"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named matplotlib

david@spengler:~$ sudo apt-get install python-matplotlib
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libdb5.1-java-jni
Use 'apt-get autoremove' to remove it.
Suggested packages:
  python-excelerator python-matplotlib-doc python-nose python-tornado
  python-traits ttf-staypuft
The following NEW packages will be installed:
  python-matplotlib
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/1,421 kB of archives.
After this operation, 7,837 kB of additional disk space will be used.
Selecting previously unselected package python-matplotlib.
(Reading database ... 509799 files and directories currently installed.)
Preparing to unpack .../python-matplotlib_1.3.1-1ubuntu5_amd64.deb ...
Unpacking python-matplotlib (1.3.1-1ubuntu5) ...
Setting up python-matplotlib (1.3.1-1ubuntu5) ...
Processing triggers for python-support (1.0.15) ...

david@spengler:~$ python -c "import matplotlib; print matplotlib"
<module 'matplotlib' from '/usr/lib/pymodules/python2.7/matplotlib/__init__.pyc'>

david@spengler:~$ sudo apt-get purge python-matplotlib
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libdb5.1-java-jni
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
  python-matplotlib*
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 7,837 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 510097 files and directories currently installed.)
Removing python-matplotlib (1.3.1-1ubuntu5) ...
Processing triggers for python-support (1.0.15) ...

david@spengler:~$ python -c "import matplotlib; print matplotlib"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named matplotlib

Revision history for this message
Sandro Tosi (morph-debian) wrote :

david@spengler:~$ python -c "import matplotlib; print matplotlib"
<module 'matplotlib' from '/usr/lib/pymodules/python2.7/matplotlib/__init__.pyc'>

/usr/lib is not /usr/local ;)

Revision history for this message
David Murphy (dnamurphy) wrote :

Ha - good spot :-)

For some reason, it's a mess, and I have no idea why: I've never installed any python modules except from APT. A purge and re-install does not work either (nothing is installed in /usr/lib/).

I've found that I have to apt-purge the relevant packages, remove all mention of them from /usr/local/lib/python2.7/dist-packages/ and then re-install them.

Perhaps it's a remnant from my recent upgrade, but absolutely no idea how/why!

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.