Compability Issues with MatPlotLib?

Hi,

I was getting segfaults attempting to use matplotlib, and after a few hours of poking, I believe that I have isolated the likely source of the problem. It seems like there is a conflict with player/stage (the robot simulator) in the latest version. Specifically this code works as per the tutorial:

import matplotlib.pyplot

matplotlib.pyplot.plot([1,2,3])
matplotlib.pyplot.ylabel(‘some numbers’)
matplotlib.pyplot.show()

This code, however, does not:

import playerc
import matplotlib.pyplot

matplotlib.pyplot.plot([1,2,3])
matplotlib.pyplot.ylabel(‘some numbers’)
matplotlib.pyplot.show()

This results in a segmentation fault.

Running gdb on this yields the following:

GNU gdb 6.8-debian
Copyright © 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “x86_64-linux-gnu”…
(no debugging symbols found)
(gdb) set args test.py
(gdb) run
Starting program: /usr/bin/python test.py
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[New Thread 0x7f5495eb06f0 (LWP 25907)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f5495eb06f0 (LWP 25907)]
0x00007f54916b64af in __cxa_allocate_exception () from /usr/lib/libstdc++.so.6

So I am not sure what is going on, my guess is some kind of memory allocation collision? But this diagnosis could be incorrect as I am inexperienced with gdb.

Other related information:

OS: Linux ubuntu 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux
Matplotlib version: 0.98.6svn (Got the latest SVN checkout after I was having the same issue with the matplotlib installed under Synaptic which is 0.98.5.2)
Numpy: 1.4.0.dev7029 (Again, got latest SVN in a futile attempt to eliminate any possible issues)
Scipy: 0.8.0.dev5795 (same, although I don’t think this is even a dependency)
Player: 2.1.2
Stage: 3.0.1

I have not made any changes to the matplotlibrc file, or setup.py, and the verbose-debug option to python yields the following output.

$HOME=/home/anu
CONFIGDIR=/home/anu/.matplotlib
matplotlib data path /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data
loaded rc file /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 0.98.6svn
verbose.level debug
interactive is False
units is False
platform is linux2

Lastly, my gcc version is gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

I did have matplotlib and player/stage playing nicely in a previous
incarnation, using older versions of both from about 8 months ago. Unfortunately going back is not an option for me, and since this seems like it may be a third party conflict, I may need to refactor my code to avoid loading both in the same script. But any help would be appreciated!

Thanks for your attention!

Anu

···

Windows Live™: Keep your life in sync. Check it out.

We've seen this before -- where importing matplotlib/pylab and some
other application trigger some strange interference. Unfortunately,
we've never figured it out. I've always suspected that there may be
two libraries compiled against different versions of numpy/numeric
that may be causing trouble, but this is just a hunch. Did you
compile numpy, mpl and player/stage from src, or was one or more of
them provided by an installer. I suggest trying clean src builds of
all, and then posting back. Also, do some ldd's on the python
extension code modules, and post some of the results here. Perhaps
something will jump out at me (not holding breath).

JDH

···

On Tue, Jun 2, 2009 at 10:09 AM, Anu Pakanati <apakanati@...32...> wrote:

Lastly, my gcc version is gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

I did have matplotlib and player/stage playing nicely in a previous
incarnation, using older versions of both from about 8 months ago.
Unfortunately going back is not an option for me, and since this seems like
it may be a third party conflict, I may need to refactor my code to avoid
loading both in the same script. But any help would be appreciated!

Thanks for your attention!