|
From: Steve S. <el...@gm...> - 2005-08-08 13:13:09
|
Hi I recently posted something about segfaults I get when plotting. Now here is a little update and I really hope someone has an idea how I can solve this problem. I'm running IPython 0.6.13 on a Debian box, installed the recent mpl 0.83.2 from source, GTKAgg backend. 1) When I start ipython (as normal user) with the -pylab option and then say plot([1,2,3]) I get In [1]: plot([1,2,3]) --------------------------------------------------------------------------- exceptions.SystemError Traceback (most recent call last) SystemError: ../Objects/moduleobject.c:48: bad argument to internal function 2) However when I change to root su <pwd> ipython -pylab then plotting works fine!? I have no idea where this moduleobject.c lives or to which application it belongs. 2) If I try the same with the normal python interpreter python from pylab import *; ion() plot([1,2,3]) a plot window pops up but shows no picture (no matter if I'm root or not). I'll appreciate any hints. Thanx!! cheers, steve |
|
From: Graeme O'K. <gj...@ne...> - 2005-08-08 13:42:01
|
Hi,
I have just fink-installed matplotlib-py24.
When I do the following, I get a 10 sec delay after the warning
message until I can enter further text.
>>> pylab.figure(1)
/sw/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py:
960: GtkWarning: Could not find the icon 'gnome-fs-home'. The
'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://freedesktop.org/Software/icon-theme/releases
buttons, backend)
pylab.plot(x,y)
gnome-fs-home.png is in:
/sw/share/icons/{Flat-Blue, gnome, HighContrastLargePrint,
HighContrastLargePrintInverse, LowContrastLargePrint}/48x48
hicolor exists as a directory at:
/sw/share/icons/hicolor
Am I missing some files?
regards,
Graeme
|
|
From: John H. <jdh...@ac...> - 2005-08-08 14:16:38
|
>>>>> "Steve" == Steve Schmerler <el...@gm...> writes:
Steve> Hi I recently posted something about segfaults I get when
Steve> plotting. Now here is a little update and I really hope
Steve> someone has an idea how I can solve this problem.
Steve> I'm running IPython 0.6.13 on a Debian box, installed the
Steve> recent mpl 0.83.2 from source, GTKAgg backend.
Steve> 1)
Steve> When I start ipython (as normal user) with the -pylab
Steve> option and then say
Steve> plot([1,2,3])
Steve> I get
Steve> In [1]: plot([1,2,3])
Steve> ---------------------------------------------------------------------------
Steve> exceptions.SystemError Traceback (most recent call last)
Steve> SystemError: ../Objects/moduleobject.c:48: bad argument to
Steve> internal function
You say this is a segfault, but it looks like an exception. Does this
actually kill the ipython shell? Is this a full posting of the
traceback?
What happens if you run the following script outside of ipython
from pylab import plot, show
plot([1,2,3])
show()
with
> python test.py --verbose-helpful
Does this create a proper figure window -- please post all output from
the script.
Steve> 2)
Steve> However when I change to root
Steve> su <pwd>
Steve> ipython -pylab
Steve> then plotting works fine!?
Perhaps this has something to do with having permission to connect to
the X11 server? As a normal user, can you launch graphical apps from
the shell, eg
> gedit&
Have you done anything unusual with your system, changed the default
permission bits, done a chroot, etc? What linux distro are you
running?
Steve> I have no idea where this moduleobject.c lives or to which
Steve> application it belongs.
Steve> 2)
Steve> If I try the same with the normal python interpreter
Steve> python
Steve> from pylab import *; ion() plot([1,2,3])
Steve> a plot window pops up but shows no picture (no matter if
Steve> I'm root or not).
GTKAgg is not expected to work unless you are in a special threaded
environment like ipython with -gthread or -pylab. Try the same with
the TkAgg backend (edit your rc file) and let me know what happens.
The last thing I'd advise is upgrading your ipython to the latest.
I've never seen this one before so I'm flying by the seat of my pants.
JDH
|
|
From: Charles M. <cm...@in...> - 2005-08-08 14:40:21
|
I get segfaults with ipython -pylab (and without the flag) quite a bit as well. They usually seem pretty random and frequent, but I found one way to reproduce. gentoo-linux ipython-0.6.15 matplotlib-cvs plot(rand(10)) a = gca() a.bbox<return> Segmentation fault This may not be a practical example, but it is the only consistent one I can find right now. - Charlie John Hunter wrote: >>>>>>"Steve" == Steve Schmerler <el...@gm...> writes: > > > Steve> Hi I recently posted something about segfaults I get when > Steve> plotting. Now here is a little update and I really hope > Steve> someone has an idea how I can solve this problem. > > Steve> I'm running IPython 0.6.13 on a Debian box, installed the > Steve> recent mpl 0.83.2 from source, GTKAgg backend. > > Steve> 1) > > Steve> When I start ipython (as normal user) with the -pylab > Steve> option and then say > > Steve> plot([1,2,3]) > > Steve> I get > > Steve> In [1]: plot([1,2,3]) > Steve> --------------------------------------------------------------------------- > Steve> exceptions.SystemError Traceback (most recent call last) > > > Steve> SystemError: ../Objects/moduleobject.c:48: bad argument to > Steve> internal function > > You say this is a segfault, but it looks like an exception. Does this > actually kill the ipython shell? Is this a full posting of the > traceback? > > What happens if you run the following script outside of ipython > > from pylab import plot, show > plot([1,2,3]) > show() > > with > > > python test.py --verbose-helpful > > Does this create a proper figure window -- please post all output from > the script. > > > Steve> 2) > > Steve> However when I change to root > > Steve> su <pwd> > > Steve> ipython -pylab > > Steve> then plotting works fine!? > > Perhaps this has something to do with having permission to connect to > the X11 server? As a normal user, can you launch graphical apps from > the shell, eg > > > gedit& > > > Have you done anything unusual with your system, changed the default > permission bits, done a chroot, etc? What linux distro are you > running? > > > Steve> I have no idea where this moduleobject.c lives or to which > Steve> application it belongs. > > Steve> 2) > > Steve> If I try the same with the normal python interpreter > > Steve> python > > Steve> from pylab import *; ion() plot([1,2,3]) > > Steve> a plot window pops up but shows no picture (no matter if > Steve> I'm root or not). > > > GTKAgg is not expected to work unless you are in a special threaded > environment like ipython with -gthread or -pylab. Try the same with > the TkAgg backend (edit your rc file) and let me know what happens. > > The last thing I'd advise is upgrading your ipython to the latest. > > I've never seen this one before so I'm flying by the seat of my pants. > > > JDH > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jdh...@ac...> - 2005-08-08 14:56:11
|
>>>>> "Charles" == Charles Moad <cm...@in...> writes:
Setting followups to matplotlib-devel
Charles> I get segfaults with ipython -pylab (and without the
Charles> flag) quite a bit as well. They usually seem pretty
Charles> random and frequent, but I found one way to reproduce.
Charles> gentoo-linux ipython-0.6.15 matplotlib-cvs
Charles> plot(rand(10)) a = gca() a.bbox<return> Segmentation
Charles> fault
Charles> This may not be a practical example, but it is the only
Charles> consistent one I can find right now.
Hey Charles,
Thanks for reporting this. I'm not sure this is related to Steve's
bug, but it's good to know about.
I can reproduce your crash on ubuntu, and only in ipython. This is
independent of backends and can be reproduced with this minimal script
peds-pc311:~> python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib.transforms import unit_bbox
>>> b = unit_bbox()
>>> b
<Bbox object at 0x81e3a6c>
>>>
but in ipython I get the segfault
peds-pc311:~> ipython
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
Type "copyright", "credits" or "license" for more information.
IPython 0.6.16_cvs -- An enhanced Interactive Python.
? -> Introduction to IPython's features.
%magic -> Information about IPython's 'magic' % functions.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: from matplotlib.transforms import unit_bbox
In [2]: b = unit_bbox()
In [3]: b
Segmentation fault
bbox is a pycxx extension object defined in src/_transforms.cpp
Something ipython is doing to represent the object is causing the
crash. I can do the following in ipython
In [1]: from matplotlib.transforms import unit_bbox
In [2]: b = unit_bbox()
In [3]: print b
<Bbox object at 0x82601c4>
In [4]: str(b)
Out[4]: '<Bbox object at 0x82601c4>'
Fernando, what kind of whacky magic are you doing when I type
In [5]: b
Segmentation fault
We've seen segfault's before when doing type inspection in pycxx; I've
reported this but haven't gotten any resolution
http://sourceforge.net/tracker/index.php?func=detail&aid=1210007&group_id=3180&atid=103180
JDH
|
|
From: Fernando P. <Fer...@co...> - 2005-08-08 17:22:01
|
John Hunter wrote: > but in ipython I get the segfault > > peds-pc311:~> ipython > Python 2.4.1 (#2, Mar 30 2005, 21:51:10) > Type "copyright", "credits" or "license" for more information. > > IPython 0.6.16_cvs -- An enhanced Interactive Python. > ? -> Introduction to IPython's features. > %magic -> Information about IPython's 'magic' % functions. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: from matplotlib.transforms import unit_bbox > > In [2]: b = unit_bbox() > > In [3]: b > Segmentation fault This one is going to be hard to track, since I can't reproduce it on my system (Fedora 3): planck[~]> ip Python 2.3.4 (#1, Feb 2 2005, 12:11:53) Type "copyright", "credits" or "license" for more information. IPython 0.6.16_svn -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from matplotlib.transforms import unit_bbox In [2]: b = unit_bbox() In [3]: b Out[3]: <Bbox object at 0x965d6d4> In [4]: In [4]: planck[~]> pylab In [1]: from matplotlib.transforms import unit_bbox In [2]: b = unit_bbox() In [3]: b Out[3]: <Bbox object at 0x893866c> So neither plain ipython nor 'ipython -pylab' show me any sign of trouble here. I'm afraid we'll have to debug this one by proxy, since I can't see any problem here. The code which is executed when output is to be printed is the __call__ method of the CachedOutput object. Look around line 476 in IPython/Prompts.py. Adding some print/debug statements to that function might shed some light. One thing you could try is toggling %Pprint back and forth. This is the pretty printer used by ipython, which is part of the stdlib (module pprint). It might be triggering some problem in the underlying pycxx objects. Cheers, f |
|
From: Charles M. <cm...@in...> - 2005-08-08 17:26:46
|
FYI, turning off pprint gets rid of the error. Will look into it more. Fernando Perez wrote: > John Hunter wrote: > >> but in ipython I get the segfault >> >> peds-pc311:~> ipython >> Python 2.4.1 (#2, Mar 30 2005, 21:51:10) >> Type "copyright", "credits" or "license" for more information. >> >> IPython 0.6.16_cvs -- An enhanced Interactive Python. >> ? -> Introduction to IPython's features. >> %magic -> Information about IPython's 'magic' % functions. >> help -> Python's own help system. >> object? -> Details about 'object'. ?object also works, ?? prints >> more. >> >> In [1]: from matplotlib.transforms import unit_bbox >> >> In [2]: b = unit_bbox() >> >> In [3]: b >> Segmentation fault > > > This one is going to be hard to track, since I can't reproduce it on my > system (Fedora 3): > > planck[~]> ip > Python 2.3.4 (#1, Feb 2 2005, 12:11:53) > Type "copyright", "credits" or "license" for more information. > > IPython 0.6.16_svn -- An enhanced Interactive Python. > ? -> Introduction to IPython's features. > %magic -> Information about IPython's 'magic' % functions. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: from matplotlib.transforms import unit_bbox > > In [2]: b = unit_bbox() > > In [3]: b > Out[3]: <Bbox object at 0x965d6d4> > > In [4]: > > In [4]: > planck[~]> pylab > > In [1]: from matplotlib.transforms import unit_bbox > > In [2]: b = unit_bbox() > > In [3]: b > Out[3]: <Bbox object at 0x893866c> > > So neither plain ipython nor 'ipython -pylab' show me any sign of > trouble here. > > I'm afraid we'll have to debug this one by proxy, since I can't see any > problem here. The code which is executed when output is to be printed > is the __call__ method of the CachedOutput object. Look around line 476 > in IPython/Prompts.py. Adding some print/debug statements to that > function might shed some light. > > One thing you could try is toggling %Pprint back and forth. This is the > pretty printer used by ipython, which is part of the stdlib (module > pprint). It might be triggering some problem in the underlying pycxx > objects. > > Cheers, > > f |
|
From: Fernando P. <Fer...@co...> - 2005-08-08 17:31:48
|
Charles Moad wrote: > FYI, turning off pprint gets rid of the error. Will look into it more. OK, that's a start. Try running the following at a command line, via plain python: import pprint from matplotlib.transforms import unit_bbox b = unit_bbox() print pprint.pformat(b) This is what I get: planck[~/test]> python pprint_bug.py <Bbox object at 0x8f3c99c> If you get a segfault, it means that there's a problem with those objects triggered by pprint. As a temporary workaround, you can permanently disable pprint in your ipython sessions by setting pprint 0 in your ~/.ipython/ipythonrc file. Cheers, f |
|
From: Charles M. <cm...@in...> - 2005-08-08 17:42:49
|
I found this link, http://mail.python.org/pipermail/python-bugs-list/2004-November/026192.html. I am guessing Jon and I are using python2.4 and you are using 2.3? - Charlie Fernando Perez wrote: > Charles Moad wrote: > >> FYI, turning off pprint gets rid of the error. Will look into it more. > > > OK, that's a start. Try running the following at a command line, via > plain python: > > import pprint > > from matplotlib.transforms import unit_bbox > b = unit_bbox() > print pprint.pformat(b) > > > This is what I get: > > planck[~/test]> python pprint_bug.py > <Bbox object at 0x8f3c99c> > > If you get a segfault, it means that there's a problem with those > objects triggered by pprint. > > As a temporary workaround, you can permanently disable pprint in your > ipython sessions by setting > > pprint 0 > > in your ~/.ipython/ipythonrc file. > > Cheers, > > f |
|
From: Fernando P. <Fer...@co...> - 2005-08-08 17:45:44
|
Charles Moad wrote: > I found this link, > http://mail.python.org/pipermail/python-bugs-list/2004-November/026192.html. I > am guessing Jon and I are using python2.4 and you are using 2.3? That's correct. I have 2.4 lying around, but matplotlib isn't built for it, nor are any of its dependencies. So I can only do mpl tests with 2.3, I'm afraid. Cheers, f |
|
From: Charles M. <cm...@in...> - 2005-08-08 18:37:01
|
I would consider this a python bug, and I just added a quick fix for me. Changed line 511 in Prompts.py to say if self.Pprint and hasattr(arg, '__repr__'): instead of if self.Pprint: You probably don't want to add this for everything, but would it be possible to override the display method of the CachedOutput when the pylab option is specified? Further, you could only do this for python v.2.4. - Charlie Fernando Perez wrote: > Charles Moad wrote: > >> I found this link, >> http://mail.python.org/pipermail/python-bugs-list/2004-November/026192.html. >> I am guessing Jon and I are using python2.4 and you are using 2.3? > > > That's correct. I have 2.4 lying around, but matplotlib isn't built for > it, nor are any of its dependencies. So I can only do mpl tests with > 2.3, I'm afraid. > > Cheers, > > f |
|
From: John H. <jdh...@ac...> - 2005-08-10 03:51:00
|
>>>>> "Charles" == Charles Moad <cm...@in...> writes:
Charles> I would consider this a python bug, and I just added a
Charles> quick fix for me. Changed line 511 in Prompts.py to say
Charles> if self.Pprint and hasattr(arg, '__repr__'): instead of
Charles> if self.Pprint:
Charles> You probably don't want to add this for everything, but
Charles> would it be possible to override the display method of
Charles> the CachedOutput when the pylab option is specified?
Charles> Further, you could only do this for python v.2.4.
I'll see if I can add repr to all the pycxx mpl classes. Perhaps this
is the cause of the issubclass segfault as well, which would be a
great bonus.
JDH
|
|
From: Fernando P. <Fer...@co...> - 2005-08-10 04:22:10
|
Charles Moad wrote: > I would consider this a python bug, and I just added a quick fix for me. > > Changed line 511 in Prompts.py to say > if self.Pprint and hasattr(arg, '__repr__'): > instead of > if self.Pprint: > > You probably don't want to add this for everything, but would it be possible to > override the display method of the CachedOutput when the pylab option is > specified? Further, you could only do this for python v.2.4. Since it's really a python bug, I'd rather see it fixed upstream than adding (yet another) hack in ipython to defend against it. But I also don't want ipython to crash for users, that's for sure. Let's see if John can get his pycxx animals to grow a __repr__, which will fix the issue. If that doesn't work, I'll go ahead and stick in a version-specific defense layer into Prompts.py to at least help the ipython users, while python fixes the problem upstream. Cheers, f |
|
From: Charles M. <cm...@in...> - 2005-08-09 22:55:31
|
The problem seems to be alleviated for me now from you latest commit, John. Thanks, Fernando Perez wrote: > Charles Moad wrote: > >> I would consider this a python bug, and I just added a quick fix for me. >> >> Changed line 511 in Prompts.py to say >> if self.Pprint and hasattr(arg, '__repr__'): >> instead of >> if self.Pprint: >> >> You probably don't want to add this for everything, but would it be >> possible to override the display method of the CachedOutput when the >> pylab option is specified? Further, you could only do this for python >> v.2.4. > > > Since it's really a python bug, I'd rather see it fixed upstream than > adding (yet another) hack in ipython to defend against it. But I also > don't want ipython to crash for users, that's for sure. > > Let's see if John can get his pycxx animals to grow a __repr__, which > will fix the issue. If that doesn't work, I'll go ahead and stick in a > version-specific defense layer into Prompts.py to at least help the > ipython users, while python fixes the problem upstream. > > Cheers, > > f |
|
From: Fernando P. <Fer...@co...> - 2005-08-09 17:46:01
|
Charles Moad wrote: > The problem seems to be alleviated for me now from you latest commit, John. OK, thanks for the info. I'll leave Prompts.py alone for now then. Cheers, f |
|
From: Steve S. <el...@gm...> - 2005-08-09 18:46:56
|
John Hunter wrote: >>>>>>"Steve" == Steve Schmerler <el...@gm...> writes: > > > Steve> Hi I recently posted something about segfaults I get when > Steve> plotting. Now here is a little update and I really hope > Steve> someone has an idea how I can solve this problem. > > Steve> I'm running IPython 0.6.13 on a Debian box, installed the > Steve> recent mpl 0.83.2 from source, GTKAgg backend. > > Steve> 1) > > Steve> When I start ipython (as normal user) with the -pylab > Steve> option and then say > > Steve> plot([1,2,3]) > > Steve> I get > > Steve> In [1]: plot([1,2,3]) > Steve> --------------------------------------------------------------------------- > Steve> exceptions.SystemError Traceback (most recent call last) > > > Steve> SystemError: ../Objects/moduleobject.c:48: bad argument to > Steve> internal function > > You say this is a segfault, but it looks like an exception. Does this > actually kill the ipython shell? Is this a full posting of the > traceback? I upgraded to IPython 0.6.15 (installed from source), the former 0.6.13 was apt-get installed on Debian (sarge, stable). Actually, it is a segfault, and it kills the IPython shell. ############################################################################### elcorto@bach:~/Install/IPython$ ipython -pylab /usr/lib/python2.3/site-packages/IPython/Shell.py:627: GtkDeprecationWarning: gtk.timeout_add is deprecated, use gobject.timeout_add instead self.gtk.timeout_add(self.TIMEOUT, self.on_timer) Python 2.3.5 (#2, May 4 2005, 08:51:39) Type "copyright", "credits" or "license" for more information. IPython 0.6.15 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. In [1]: plot([1,2,3]) --------------------------------------------------------------------------- exceptions.SystemError Traceback (most recent call last) SystemError: ../Objects/moduleobject.c:48: bad argument to internal function Speicherzugriffsfehler elcorto@bach:~/Install/IPython$ ################################################################################# At least "Speicherzugriffsfehler" is german for segfault :) I still can plot as root, but not as user!? If it's some kind of permission problem it would be good to know something about "../Objects/moduleobject.c". I there a way to get IPython to print the full path? BTW, Fernando mentioned earlier that this GtkDeprecationWarning would go away if I upgrade to IPython 0.6.15 but unfortunately it's still there. > > What happens if you run the following script outside of ipython > > from pylab import plot, show > plot([1,2,3]) > show() > > with > > > python test.py --verbose-helpful > > Does this create a proper figure window -- please post all output from > the script. > This works, a window shows up. ################################################################################# elcorto@bach:~/Install/IPython$ python test.py --verbose-helpful matplotlib data path /usr/share/matplotlib $HOME=/home/elcorto CONFIGDIR=/home/elcorto/.matplotlib loaded rc file /usr/share/matplotlib/matplotlibrc matplotlib version 0.83.2 verbose.level helpful interactive is False platform is linux2 numerix Numeric 23.8 font search path ['/usr/share/matplotlib'] loaded ttfcache file /home/elcorto/.matplotlib/ttffont.cache backend GTKAgg version 2.6.1 ################################################################################# > > Steve> 2) > > Steve> However when I change to root > > Steve> su <pwd> > > Steve> ipython -pylab > > Steve> then plotting works fine!? > > Perhaps this has something to do with having permission to connect to > the X11 server? As a normal user, can you launch graphical apps from > the shell, eg > > > gedit& > I can do that. > > Have you done anything unusual with your system, changed the default > permission bits, done a chroot, etc? What linux distro are you > running? > > > Steve> I have no idea where this moduleobject.c lives or to which > Steve> application it belongs. > > Steve> 2) > > Steve> If I try the same with the normal python interpreter > > Steve> python > > Steve> from pylab import *; ion() plot([1,2,3]) > > Steve> a plot window pops up but shows no picture (no matter if > Steve> I'm root or not). > > Debian sarge, stable. I'm not a Linux expert but it's a pretty fresh installation (on my computer at work) and I can't see what I should have done wrong. In fact I installed mpl on my (the same) Debian at home and it works fine there (OK it's mpl 0.81 and IPython 0.6.13). > GTKAgg is not expected to work unless you are in a special threaded > environment like ipython with -gthread or -pylab. Try the same with > the TkAgg backend (edit your rc file) and let me know what happens. > Uh, I didn't build TkAgg, So I set BUILD_TKAGG = 'auto', but python setup.py build fails: [...] src/_tkagg.cpp:26:19: tk.h: Datei oder Verzeichnis nicht gefunden (file not found) [...] error: command 'gcc' failed with exit status 1 Do I have to install something besides python-tk? > The last thing I'd advise is upgrading your ipython to the latest. > > I've never seen this one before so I'm flying by the seat of my pants. > > I hope we can sort this out. cheers, steve |
|
From: Fernando P. <Fer...@co...> - 2005-08-09 18:59:56
|
Steve Schmerler wrote: > I upgraded to IPython 0.6.15 (installed from source), the former 0.6.13 > was apt-get installed on Debian (sarge, stable). > > Actually, it is a segfault, and it kills the IPython shell. > > ############################################################################### > > elcorto@bach:~/Install/IPython$ ipython -pylab > /usr/lib/python2.3/site-packages/IPython/Shell.py:627: > GtkDeprecationWarning: gtk.timeout_add is deprecated, use > gobject.timeout_add instead > self.gtk.timeout_add(self.TIMEOUT, self.on_timer) > Python 2.3.5 (#2, May 4 2005, 08:51:39) > Type "copyright", "credits" or "license" for more information. > > IPython 0.6.15 -- An enhanced Interactive Python. > ? -> Introduction to IPython's features. > %magic -> Information about IPython's 'magic' % functions. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > Welcome to pylab, a matplotlib-based Python environment. > For more information, type 'help(pylab)'. > > In [1]: plot([1,2,3]) > --------------------------------------------------------------------------- > exceptions.SystemError Traceback (most > recent call last) > > > SystemError: ../Objects/moduleobject.c:48: bad argument to internal function > Speicherzugriffsfehler > elcorto@bach:~/Install/IPython$ > > ################################################################################# > > At least "Speicherzugriffsfehler" is german for segfault :) > > I still can plot as root, but not as user!? If it's some kind of > permission problem it would be good to know something about > "../Objects/moduleobject.c". I there a way to get IPython to print the > full path? No, unfortunately the string: SystemError: ../Objects/moduleobject.c:48: bad argument to internal function is being generated internally, so the path has already been truncated by somebody else. IPython has no access to any more info than this, as that string is the value of the exception given to the ipython traceback handler. You can try setting '%xmode verbose' in ipython to produce more verbose tracebacks, but I doubt we'll see anything more meaningful in this particular case (since there don't seem to be any frames properly generated in the traceback). This is really strange. I can only suggest trying some of the other backends (QtAgg, TKAgg, WXAgg) and seeing what happens. But we're really debugging in the dark here. > BTW, Fernando mentioned earlier that this GtkDeprecationWarning would go > away if I upgrade to IPython 0.6.15 but unfortunately it's still there. Sorry, I should have clarified that this change was made to SVN, _right after_ we released .15. So only an SVN install would make it go away (or manually applying the relevant fix). If it really bothers you, I can track down the exact changes needed for you. Cheers, f |
|
From: John H. <jdh...@ac...> - 2005-08-10 00:29:43
|
>>>>> "Steve" == Steve Schmerler <el...@gm...> writes:
Steve> I still can plot as root, but not as user!? If it's some
That I find bizarre. Could it be a PATH or an LD_LIBRARY_PATH issue;
ie, you and root are using different libraries. Have you customized
either of these variables? For example, if you do the following as
yourself and root, do you get the same link information
> ldd /usr/lib/python2.4/site-packages/matplotlib/_nc_transforms.so
> ldd /usr/lib/python2.4/site-packages/Numeric/_numpy.so
Steve> kind of permission problem it would be good to know
Steve> something about "../Objects/moduleobject.c". I there a way
Steve> to get IPython to print the full path?
This is part of python -- if you install python-dev you should be able
to find the header on your system, eg at
/usr/include/python2.4/moduleobject.h
Steve> Uh, I didn't build TkAgg, So I set BUILD_TKAGG = 'auto',
Steve> but
Steve> Do I have to install something besides python-tk?
You need the tk8.4-dev and maybe the tcl8.4-dev headers. You may have
a different version number.
Steve> I hope we can sort this out.
Two other things to try.
1) See if we can narrow down where the segfault is occurring by trying
to import the matplotlib modules separately
import matplotlib.ft2font
import matplotlib._transforms
import matplotlib._agg
import matplotlib.backends._backend_agg
import matplotlib.backends._gtkagg
2) Compile matplotlib with
VERBOSE = True
in setup.py. This will cause the extension code to generate lots
of messages, and we may be able to narrow down precisely where
the crash is occurring.
JDH
|
|
From: Steve S. <el...@gm...> - 2005-08-09 17:35:41
Attachments:
mpl_ipython.tar.bz2
|
John Hunter wrote:
>>>>>>"Steve" == Steve Schmerler <el...@gm...> writes:
>
>
> Steve> I still can plot as root, but not as user!? If it's some
>
> That I find bizarre. Could it be a PATH or an LD_LIBRARY_PATH issue;
> ie, you and root are using different libraries. Have you customized
> either of these variables? For example, if you do the following as
> yourself and root, do you get the same link information
>
> > ldd /usr/lib/python2.4/site-packages/matplotlib/_nc_transforms.so
I'm using Python 2.3.5, but
no, both:
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4009e000)
libm.so.6 => /lib/tls/libm.so.6 (0x40159000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4017b000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40184000)
libc.so.6 => /lib/tls/libc.so.6 (0x40193000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> > ldd /usr/lib/python2.4/site-packages/Numeric/_numpy.so
no, both:
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40026000)
libc.so.6 => /lib/tls/libc.so.6 (0x40036000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
> Steve> kind of permission problem it would be good to know
> Steve> something about "../Objects/moduleobject.c". I there a way
> Steve> to get IPython to print the full path?
>
> This is part of python -- if you install python-dev you should be able
> to find the header on your system, eg at
>
> /usr/include/python2.4/moduleobject.h
>
Yes, I have this one (/usr/include/python2.3/moduleobject.h).
>
> Steve> Uh, I didn't build TkAgg, So I set BUILD_TKAGG = 'auto',
> Steve> but
>
>
> Steve> Do I have to install something besides python-tk?
>
> You need the tk8.4-dev and maybe the tcl8.4-dev headers. You may have
> a different version number.
>
Ah OK. That does it.
>
> Steve> I hope we can sort this out.
>
> Two other things to try.
>
> 1) See if we can narrow down where the segfault is occurring by trying
> to import the matplotlib modules separately
>
> import matplotlib.ft2font
> import matplotlib._transforms
> import matplotlib._agg
> import matplotlib.backends._backend_agg
>
>
I hope this was what you ment:
ipython -pylab and then
####################################################################
In [1]: import matplotlib.ft2font
In [2]: import matplotlib._transforms
In [3]: import matplotlib._agg
In [4]: import matplotlib.backends._backend_agg
---------------------------------------------------------------------------
exceptions.ImportError Traceback (most
recent call last)
/home/elcorto/Install/Matplotlib/matplotlib-0.83.2/<console>
ImportError: No module named _backend_agg
In [5]: import matplotlib.backends._gtkagg
####################################################################
> 2) Compile matplotlib with
>
> VERBOSE = True
OK this prints a lot. I did
python setup.py build > build_log.txt
It then prints some additional output which I pasted into
build_log2.txt. I hope this helps in any way.
I attached my setup.py and the *.txt files.
BTW, I installed the .debs (mpl 0.82)
from http://anakonda.altervista.org (on the mpl website)
and this works!
cheers,
steve
|
|
From: Steve S. <el...@gm...> - 2005-08-09 18:14:50
Attachments:
mpl_ipython.tar.bz2
|
John Hunter wrote:
>>>>>>"Steve" == Steve Schmerler <el...@gm...> writes:
>
>
> Steve> I still can plot as root, but not as user!? If it's some
>
> That I find bizarre. Could it be a PATH or an LD_LIBRARY_PATH issue;
> ie, you and root are using different libraries. Have you customized
> either of these variables? For example, if you do the following as
> yourself and root, do you get the same link information
>
> > ldd /usr/lib/python2.4/site-packages/matplotlib/_nc_transforms.so
I'm using Python 2.3.5, but
no, both:
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4009e000)
libm.so.6 => /lib/tls/libm.so.6 (0x40159000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4017b000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40184000)
libc.so.6 => /lib/tls/libc.so.6 (0x40193000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> > ldd /usr/lib/python2.4/site-packages/Numeric/_numpy.so
no, both:
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40026000)
libc.so.6 => /lib/tls/libc.so.6 (0x40036000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
> Steve> kind of permission problem it would be good to know
> Steve> something about "../Objects/moduleobject.c". I there a way
> Steve> to get IPython to print the full path?
>
> This is part of python -- if you install python-dev you should be able
> to find the header on your system, eg at
>
> /usr/include/python2.4/moduleobject.h
>
Yes, I have this one (/usr/include/python2.3/moduleobject.h).
>
> Steve> Uh, I didn't build TkAgg, So I set BUILD_TKAGG = 'auto',
> Steve> but
>
>
> Steve> Do I have to install something besides python-tk?
>
> You need the tk8.4-dev and maybe the tcl8.4-dev headers. You may have
> a different version number.
>
Ah OK. That does it.
>
> Steve> I hope we can sort this out.
>
> Two other things to try.
>
> 1) See if we can narrow down where the segfault is occurring by trying
> to import the matplotlib modules separately
>
> import matplotlib.ft2font
> import matplotlib._transforms
> import matplotlib._agg
> import matplotlib.backends._backend_agg
>
>
I hope this was what you ment:
ipython -pylab and then
####################################################################
In [1]: import matplotlib.ft2font
In [2]: import matplotlib._transforms
In [3]: import matplotlib._agg
In [4]: import matplotlib.backends._backend_agg
---------------------------------------------------------------------------
exceptions.ImportError Traceback (most
recent call last)
/home/elcorto/Install/Matplotlib/matplotlib-0.83.2/<console>
ImportError: No module named _backend_agg
In [5]: import matplotlib.backends._gtkagg
####################################################################
> 2) Compile matplotlib with
>
> VERBOSE = True
OK this prints a lot. I did
python setup.py build > build_log.txt
It then prints some additional output which I pasted into
build_log2.txt. I hope this helps in any way.
I attached my setup.py and the *.txt files.
BTW, I installed the .debs (mpl 0.82)
from http://anakonda.altervista.org (on the mpl website)
and this works!
cheers,
steve
|
|
From: Steve S. <el...@gm...> - 2005-08-10 11:42:56
|
Hi Ups I think I missunderstood the meaning of VERBOSE = True in setup.py when compiling. When I start ipython -pylab and try to plot mpl prints a lot of mesages and _these_ are the ones of interest, sorry. OK here is the output of some tests: Starting iython -pylab: ######################################################################### elcorto@bach:~/Install/Matplotlib/matplotlib-0.83.2$ ipython -pylab LazyValue::init_type Value::init_type BinOp::init_type Point::init_type Interval::init_type Bbox::init_type Func::init_type FuncXY::init_type Transformation::init_type SeparableTransformation::init_type NonseparableTransformation::init_type Affine::init_type init_nc_transforms Glyph::init_type FT2Font::init_type _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation init_nc_image Image::init_type _transforms_module::new_value Value::~Value init_nc_backend_agg /usr/lib/python2.3/site-packages/IPython/Shell.py:627: GtkDeprecationWarning: gtk.timeout_add is deprecated, use gobject.timeout_add instead self.gtk.timeout_add(self.TIMEOUT, self.on_timer) Python 2.3.5 (#2, May 4 2005, 08:51:39) Type "copyright", "credits" or "license" for more information. IPython 0.6.15 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. In [1]: ######################################################################### Plotting: ######################################################################### In [1]: plot([1,2,3]) _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation _transforms_module::new_value _transforms_module::new_value _transforms_module::new_value _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point LazyValue::number BinOp::BinOp LazyValue::number BinOp::BinOp _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation SeparableTransformation::~SeparableTransformation Func::~Func Func::~Func BBoxTransformation::~BBoxTransformation Bbox::~Bbox Point::~Point Value::~Value Value::~Value Point::~Point Value::~Value Value::~Value Bbox::~Bbox Point::~Point Value::~Value Value::~Value Point::~Point Value::~Value Value::~Value Transformation::~Transformation Value::get Value::set Value::set Bbox::get_bounds Value::get Value::get RendererAgg::RendererAgg _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox SeparableTransformation::eval_scalars Transformation::seq_xy_tups SeparableTransformation::operator SeparableTransformation::operator SeparableTransformation::operator SeparableTransformation::operator RendererAgg::draw_polygon GCAgg::GCAgg GCAgg::points_to_pixels GCAgg::get_color GCAgg::antialiased GCAgg::_set_linecap GCAgg::_set_joinstyle GCAgg::_set_dashes GCAgg::_set_clip_rectangle RendererAgg::_get_rgba_face RendererAgg::rgb_to_color RendererAgg::set_clipbox_rasterizer RendererAgg::set_clipbox_rasterizer done RendererAgg::draw_polygon DONE --------------------------------------------------------------------------- exceptions.SystemError Traceback (most recent call last) SystemError: ../Objects/moduleobject.c:48: bad argument to internal function Speicherzugriffsfehler elcorto@bach:~/Install/Matplotlib/matplotlib-0.83.2$ ######################################################################### This was with GTKAgg. The same happens with Agg, TkAgg, GTK. This bug really annoys me by now and I'm wondering why mpl 0.82 installed as Debian package works. cheers, steve |
|
From: John H. <jdh...@ac...> - 2005-08-10 12:00:12
|
>>>>> "Steve" == Steve Schmerler <el...@gm...> writes:
Steve> Hi Ups I think I missunderstood the meaning of VERBOSE =
Steve> True in setup.py when compiling.
Steve> When I start ipython -pylab and try to plot mpl prints a
Steve> lot of mesages and _these_ are the ones of interest, sorry.
Steve> OK here is the output of some tests:
...
Steve> This was with GTKAgg. The same happens with Agg, TkAgg,
Steve> GTK.
Steve> This bug really annoys me by now and I'm wondering why mpl
Steve> 0.82 installed as Debian package works.
Steve,
Thanks for the patient tests. I am taking this offlist so we don't annoy
everyone with too much mail on this subject, but am CC-ing the parties
who might have additional insight.
It is interesting that it happens both on Agg and non-Agg backends --
that narrows things down a bit. It is also most interesting that it
only happens when you run as a normal user and not root. The VERBOSE
output you posted suggests the problem is not occurring inside a mpl
extension code function, since it ends with "RendererAgg::draw_polygon
DONE"
I'm about out of suggestions sadly, but do have one more request
Compile 0.82 from src. Since that version is working in the debian
build, it would be interesting to see if it works when *you* build
it. Ie, is there something wrong with matplotlib, or something
wrong with your build environment.
Also, how do you compile matplotlib, as a normal user or as root?
If you are compiling and installing as root, may I suggests
installing sudo (apt-get install sudo) and adding yourself to
/etc/sudoers. Then compile matplotlib as a normal user and install
with sudo
> python setup.py build
> sudo python setup.py install
Or is this the way you are already doing it.
As always, before anything else, sudo rm -rf site-packages/matplotlib
and the build dir of your matplotlib src tree.
One other thing that would be helpful, you can start inserting debug
print statements in lib/matplotlib/pylab.py
print "ich bin hier 1"
skip 20 lines
print "ich bin hier 2"
skip 20 lines
print "ich bin hier 3"
and try and figure out exactly where in the module the failure occurs
(it could also be in lib/matplotlib/__init__.py). Once you have the
crash narrowed down between two lines, you can add more print
statements further subdivide it and triangulate down to the true evil
line. If we could at least figure out which part of the code is
triggering the failure, it might help diagnose and fix it. This can
be tedious, but is sometimes the best way to resolve these problems.
JDH
|