segfault with TkAgg and any GUI in 2.5

Having upgraded to 2.5, I get a segfault when running a very simple plot script (test.py) at the show() function. Prior to show() I can save to file and the result looks good. The GUI is crashing on show().

Any suggestions to fix welcome (I’m guessing many of you know the solution to this problem).

“Annoying” debug information below:

Thanks!

-Matt

hostname:~/.matplotlib>cat test.py
from pylab import *
plot([1,2,3])
show()

hostname:~/.matplotlib>python test.py --verbose-debug-annoying -dTkAgg
matplotlib data path …/python2.5/site-packages/matplotlib/mpl-data
$HOME=/home/username
loaded rc file /home/username/.matplotlib/matplotlibrc

matplotlib version 0.90.0
verbose.level debug-annoying
interactive is False
platform is linux2
loaded modules: [’_bisect’, ‘_sha512’, ‘pylab’, ‘datetime’, ‘matplotlib.tempfile
‘, ‘distutils.sysconfig’, ‘encodings.encodings’, ‘str
uct’, ‘tempfile’, ‘pytz.os’, ‘zipimport’, ‘string’, ‘matplotlib.future’, ‘pytz.tzinfo’, ’
pytz.datetime’, ‘distutils.re’, ‘bisect’
, ‘signal’, ‘random’, ‘matplotlib.pytz’, ‘locale’, ‘encodings’, ‘dateutil’, ’
matplotlib.warnings’, ‘pytz.pytz’, ‘matplotlib.sys’, ‘re
‘, ‘math’, ‘fcntl’, ‘UserDict’, ‘distutils.os’, ‘matplotlib’, ‘codecs’, ‘md5’, ‘_locale’, ’
matplotlib.os’, ‘thread’, ‘itertools’, ‘di
stutils.sys’, ‘os’, ‘future’, ‘_sre’, ‘builtin’, ‘matplotlib.re’, ‘operator’, ’
distutils.string’, ‘matplotlib.datetime’, ‘pos
ixpath’, ‘errno’, ‘binascii’, ‘sre_constants’, ‘_sha256’, ‘matplotlib.md5’, ‘types’, ‘pytz.sys’, ‘_codecs’, ‘pytz’, ‘copy’, ‘_struct’

, ‘_types’, ‘matplotlib.dateutil’, ‘hashlib’, ‘distutils’, ‘posix’, ‘encodings.aliases’, ‘exceptions’, ‘sre_parse’, ‘pytz.bisect’, 'd
istutils.distutils
‘, ‘copy_reg’, ‘sre_compile’, ‘_hashlib’, ‘_random’, ‘site’, ‘main’, ‘shutil’, ‘strop’, ‘encodings.codecs’, ‘ge
ttext’, ‘pytz.sets
‘, ‘stat’, ‘warnings’, ‘encodings.types’, ‘encodings.ascii’, ‘sys’, ‘os.path’, ‘pytz.gettext’, ‘matplotlib.distutil
s’, ‘distutils.errors’, ‘linecache’, ’
matplotlib.shutil’, ‘sets’]
numerix numarray 1.5.2
font search path [’…/python2.5/site-packages/matplotlib/mpl-data’]
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/cmtt10.ttf

trying fontname …/python2.5/site-packages/matplotlib/mpl-data/VeraMoIt.ttf
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/cmex10.ttf
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/VeraBI.ttf

trying fontname …/python2.5/site-packages/matplotlib/mpl-data/VeraBd.ttf
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/cmmi10.ttf
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/VeraSeBd.ttf

trying fontname …/python2.5/site-packages/matplotlib/mpl-data/cmr10.ttf
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/VeraMono.ttf
trying fontname …/python2.5/site-packages/matplotlib/mpl-data/cmsy10.ttf

trying fontname …/python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
CONFIGDIR=/home/username/.matplotlib
loaded ttfcache file /home/username/.matplotlib/ttffont.cache
backend TkAgg version 8.5
FigureCanvasAgg.draw

RendererAgg.init
RendererAgg.init width=650.0, height=490.0
RendererAgg.init _RendererAgg done
RendererAgg.init done
RendererAgg._get_agg_font
findfont found sans-serif, normal, normal 400, normal, 12.0
findfont returning …/python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels

RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font

RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font

RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font

RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels

RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font

RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
Segmentation fault (core dumped)

hostname:~/.matplotlib>

Matt Beal wrote:

Having upgraded to 2.5, I get a segfault when running a very simple plot script (test.py) at the show() function. Prior to show() I can save to file and the result looks good. The GUI is crashing on show().
Any suggestions to fix welcome (I'm guessing many of you know the solution to this problem).

I hope someone does, because I don't. But until someone comes up with the answer, here are possibly relevant questions: Did you build mpl from source? If so, did you delete the build directory before rebuilding with 2.5? My guess is that there is a version mismatch somewhere, and this is the sort of thing that can occur if a major change is made and a complete rebuild is not done. setup.py is not smart enough to always know what really needs to be rebuilt, I think.

Eric

···

"Annoying" debug information below:
Thanks!
-Matt
hostname:~/.matplotlib>cat test.py
from pylab import *
plot([1,2,3])
show()

hostname:~/.matplotlib>python test.py --verbose-debug-annoying -dTkAgg
matplotlib data path ..../python2.5/site-packages/matplotlib/mpl-data
$HOME=/home/username
loaded rc file /home/username/.matplotlib/matplotlibrc
matplotlib version 0.90.0
verbose.level debug-annoying
interactive is False
platform is linux2
loaded modules: ['_bisect', '_sha512', 'pylab', 'datetime', 'matplotlib.tempfile ', 'distutils.sysconfig', 'encodings.encodings', 'str
uct', 'tempfile', 'pytz.os', 'zipimport', 'string', 'matplotlib.__future__', 'pytz.tzinfo', ' pytz.datetime', 'distutils.re <http://distutils.re>', 'bisect'
, 'signal', 'random', 'matplotlib.pytz', 'locale', 'encodings', 'dateutil', ' matplotlib.warnings', 'pytz.pytz', 'matplotlib.sys', 're
', 'math', 'fcntl', 'UserDict', 'distutils.os', 'matplotlib', 'codecs', 'md5', '_locale', ' matplotlib.os', 'thread', 'itertools', 'di
stutils.sys', 'os', '__future__', '_sre', '__builtin__', 'matplotlib.re <http://matplotlib.re>', 'operator', ' distutils.string', 'matplotlib.datetime', 'pos
ixpath', 'errno', 'binascii', 'sre_constants', '_sha256', 'matplotlib.md5', 'types', 'pytz.sys', '_codecs', 'pytz', 'copy', '_struct'
, '_types', 'matplotlib.dateutil', 'hashlib', 'distutils', 'posix', 'encodings.aliases', 'exceptions', 'sre_parse', 'pytz.bisect', 'd
istutils.distutils ', 'copy_reg', 'sre_compile', '_hashlib', '_random', 'site', '__main__', 'shutil', 'strop', 'encodings.codecs', 'ge
ttext', 'pytz.sets ', 'stat', 'warnings', 'encodings.types', 'encodings.ascii', 'sys', 'os.path', 'pytz.gettext', 'matplotlib.distutil
s', 'distutils.errors', 'linecache', ' matplotlib.shutil', 'sets']
numerix numarray 1.5.2
font search path ['..../python2.5/site-packages/matplotlib/mpl-data']
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmtt10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraMoIt.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmex10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraBI.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraBd.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmmi10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraSeBd.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmr10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraMono.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmsy10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
CONFIGDIR=/home/username/.matplotlib
loaded ttfcache file /home/username/.matplotlib/ttffont.cache
backend TkAgg version 8.5
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=650.0, height=490.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
RendererAgg._get_agg_font
        findfont found sans-serif, normal, normal 400, normal, 12.0
findfont returning ..../python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
Segmentation fault (core dumped)

hostname:~/.matplotlib>

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Numarray does not work with Python 2.5 on 64 bit Linux.
If this is a 64 bit Linux machine try using numpy instead.

Nadia Dencheva

Matt Beal wrote:

···

Having upgraded to 2.5, I get a segfault when running a very simple plot script (test.py) at the show() function. Prior to show() I can save to file and the result looks good. The GUI is crashing on show().
Any suggestions to fix welcome (I'm guessing many of you know the solution to this problem).
"Annoying" debug information below:
Thanks!
-Matt
hostname:~/.matplotlib>cat test.py
from pylab import *
plot([1,2,3])
show()

hostname:~/.matplotlib>python test.py --verbose-debug-annoying -dTkAgg
matplotlib data path ..../python2.5/site-packages/matplotlib/mpl-data
$HOME=/home/username
loaded rc file /home/username/.matplotlib/matplotlibrc
matplotlib version 0.90.0
verbose.level debug-annoying
interactive is False
platform is linux2
loaded modules: ['_bisect', '_sha512', 'pylab', 'datetime', 'matplotlib.tempfile ', 'distutils.sysconfig', 'encodings.encodings', 'str
uct', 'tempfile', 'pytz.os', 'zipimport', 'string', 'matplotlib.__future__', 'pytz.tzinfo', ' pytz.datetime', 'distutils.re <http://distutils.re>', 'bisect'
, 'signal', 'random', 'matplotlib.pytz', 'locale', 'encodings', 'dateutil', ' matplotlib.warnings', 'pytz.pytz', 'matplotlib.sys', 're
', 'math', 'fcntl', 'UserDict', 'distutils.os', 'matplotlib', 'codecs', 'md5', '_locale', ' matplotlib.os', 'thread', 'itertools', 'di
stutils.sys', 'os', '__future__', '_sre', '__builtin__', 'matplotlib.re <http://matplotlib.re>', 'operator', ' distutils.string', 'matplotlib.datetime', 'pos
ixpath', 'errno', 'binascii', 'sre_constants', '_sha256', 'matplotlib.md5', 'types', 'pytz.sys', '_codecs', 'pytz', 'copy', '_struct'
, '_types', 'matplotlib.dateutil', 'hashlib', 'distutils', 'posix', 'encodings.aliases', 'exceptions', 'sre_parse', 'pytz.bisect', 'd
istutils.distutils ', 'copy_reg', 'sre_compile', '_hashlib', '_random', 'site', '__main__', 'shutil', 'strop', 'encodings.codecs', 'ge
ttext', 'pytz.sets ', 'stat', 'warnings', 'encodings.types', 'encodings.ascii', 'sys', 'os.path', 'pytz.gettext', 'matplotlib.distutil
s', 'distutils.errors', 'linecache', ' matplotlib.shutil', 'sets']
numerix numarray 1.5.2
font search path ['..../python2.5/site-packages/matplotlib/mpl-data']
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmtt10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraMoIt.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmex10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraBI.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraBd.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmmi10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraSeBd.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmr10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/VeraMono.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/cmsy10.ttf
trying fontname ..../python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
CONFIGDIR=/home/username/.matplotlib
loaded ttfcache file /home/username/.matplotlib/ttffont.cache
backend TkAgg version 8.5
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=650.0, height=490.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
RendererAgg._get_agg_font
        findfont found sans-serif, normal, normal 400, normal, 12.0
findfont returning ..../python2.5/site-packages/matplotlib/mpl-data/Vera.ttf
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
Segmentation fault (core dumped)

hostname:~/.matplotlib>

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

If this doesn't help, here are the generic "segfault" instructions::

# How to diagnose where a segfault is occurring

First thing to try is simply rm -rf the site-packages/matplotlib and
build subdirs and get a clean install. Installing a new version over
a pretty old version has been known to cause trouble, segfault, etc.

Try importing these packages individually

  import matplotlib._image
  import matplotlib._transforms

  #one of these three depending on which numerix package you are using
  import matplotlib.backends._na_backend_agg # for numarray
  import matplotlib.backends._nc_backend_agg # for Numeric
  import matplotlib.backends._ns_backend_agg # for numpy

  import matplotlib.backends._tkagg
  import matplotlib._agg

If the last two work and the others don't, it is likely you need to
upgrade your gcc, because on some platforms (OS X for sure) old
versions of gcc cannot compile new versions of pycxx, which matplotlib
uses for building some but not all of it's extensions. Report back
which if any work or segfault or raise tracebacks,

If that shed additional light, again flush the build and install dirs,
and try setting VERBOSE=True in setup.py before doing a clean install.
The VERBOSE setting will generate lots of extra output and may help
indicate where the segfault is occurring

···

On 3/28/07, Nadia Dencheva <dencheva@...86...> wrote:

Numarray does not work with Python 2.5 on 64 bit Linux.
If this is a 64 bit Linux machine try using numpy instead.