Fernando Perez wrote:
> Hi all,
> 
> 
> I'm getting:
> 
> planck[examples]> python pylab_segfault.py
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> 
> 
> with this trivial code
> 
> planck[examples]> cat pylab_segfault.py
> import sys
> import numpy as N
> import pylab as P
> 
> print "Numpy version:",N.__version__
> sys.stdout.flush()
> 
> P.imshow(N.ones((4,4),dtype=N.uint8))
> P.show()
> 
> # EOF

I have fixed this in two ways: by raising an exception in _image.cpp if 
the input to frombyte lacks 3 dimensions--this prevents the 
segfault--and by checking uint8 arrays for 3 dimensions in image.py 
before sending them to frombyte in the first place.

The problem cropped up recently because of another change I made. 
cm.ScalarMappable.set_array had been making all float arrays float32, 
and all int arrays int16.  This was causing problems with int32 arrays, 
  of course, and I could not figure out any reason why it was needed, so 
I eliminated it.  (I think I put that conversion in in the first place a 
long time ago; presumably I had a reason, and I hope I am correct that 
if it ever was necessary, it no longer is.  The backend_driver tests are 
happy with the present state of affairs.)

Eric

> 
> Is anyone else seeing this?  My matplotlib build is SVN:
> 
> planck[scipy]> svn info matplotlib/
> Path: matplotlib
> URL: https://svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib
> Repository Root: https://svn.sourceforge.net/svnroot/matplotlib
> Repository UUID: f61c4167-ca0d-0410-bb4a-bb21726e55ed
> Revision: 3141
> Node Kind: directory
> Schedule: normal
> Last Changed Author: efiring
> Last Changed Rev: 3141
> Last Changed Date: 2007-04-01 18:19:08 -0600 (Sun, 01 Apr 2007)
> Properties Last Updated: 2006-07-08 22:39:32 -0600 (Sat, 08 Jul 2006)
> 
> 
> And I get the above error with all GUI backends I've tested so far
> (Tk, GTK, Qt and WX).
> 
> 
> planck[examples]> python pylab_segfault.py -dWXAgg
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> planck[examples]> python pylab_segfault.py -dTkAgg
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> planck[examples]> python pylab_segfault.py -dQtAgg
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> planck[examples]> python pylab_segfault.py -dGTKAgg
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> planck[examples]> python pylab_segfault.py -dGTK
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> planck[examples]> python pylab_segfault.py -dQt
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> planck[examples]> python pylab_segfault.py -dTk
> Numpy version: 1.0.3.dev3651
> Segmentation fault (core dumped)
> 
> 
> The TkAgg and the GTKAgg get as far as making the pylab window, but
> then they crash.
> 
> I should add that this same example ran fine for me about a week ago;
> I can try to track down the exact versions of numpy and matplotlib I
> was using at the time, but if someone has a fix for this, it would be
> enormously appreciated.
> 
> Cheers,
> 
> f
> 
> -------------------------------------------------------------------------
> 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-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


-------------------------------------------------------------------------
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-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to