[IPython-User] ipython -pylab segmenation fault

Philippe Baucour pbaucour@gmail....
Wed Feb 9 03:54:34 CST 2011


Wow, lots of crashes.  Some thoughts:

* I am not sure you can set the backend using rcParams in IPython's
pylab mode.  Try setting it in the config file or using the different
*thread options.
* The degfaults look matplotlib'ish.  I saw this because we simply
don't have any C/C++ code in ipython.
* It could be a subtle threading issue related to how ipython does the
threading tricks to get matplotlib to work in 0.10 pylab mode.
* For 0.11, we have known unicode issues that we are working on.
Other than that, pylab should work fine there.

Hope things helps...

Brian

On Tue, Feb 8, 2011 at 2:23 AM, Philippe Baucour <pbaucour@gmail.com>
wrote:
> hello,
> I get a segmentation fault with the pylab mode and I made several
> test to track down a bug but it's beyond my level and I still don't
> now if it's an ipython bug or matplotlib bug ...
>
> let's reproduce the bug !!!!
>     ________________
> ____/   try 1 Qt4Agg \_____
>
> phil@Numokh ~ % ipython -pylab
> In [1]: plt.plot([4])
> segmentation fault  ipython -pylab
>
> By default I have Qt4Agg as backend but it doesn't work with all
> backends
>
>     _______________
> ____/   try 2 TkAgg \_____
>
> phil@Numokh ~ % ipython -pylab
>
> In [1]: plt.rcParams['backend']='TkAgg'
>
> In [2]: plt.get_backend()
> Out[2]: 'TkAgg'
>
> In [3]: plt.plot([4])
> segmentation fault  ipython -pylab
>
>
>     ____________________________
> ____/   try 3 Qt4Agg + backtrace \_____
>
>
> I made a backtrace with gdb
> phil@Numokh ~ % gdb python
> GNU gdb (Gentoo 7.2 p1) 7.2
> Copyright (C) 2010 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-pc-linux-gnu".
> For bug reporting instructions, please see:
> <http://bugs.gentoo.org/>...
> Reading symbols from /usr/bin/python...(no debugging symbols
> found)...done. (gdb) r /usr/bin/ipython -pylab
> Starting program: /usr/bin/python /usr/bin/ipython -pylab
> process 4149 is executing new program: /usr/bin/python2.7
> [Thread debugging using libthread_db enabled]
> process 4149 is executing new program: /usr/bin/python2.7
> [Thread debugging using libthread_db enabled]
>
> In [1]: plt.plot([4])
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007fffe82d5ce7 in __cxa_allocate_exception ()
>   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6
> (gdb) bt
> #0  0x00007fffe82d5ce7 in __cxa_allocate_exception ()
>   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6
> #1  0x00007fffe4d1f8a4 in py_to_agg_transformation_matrix(_object*,
> bool) () from /usr/lib64/python2.7/site-packages/matplotlib/_path.so
> #2  0x00007fffe4d2a42b in _path_module::update_path_extents(Py::Tuple
> const&) () from /usr/lib64/python2.7/site-packages/matplotlib/_path.so
> #3  0x00007fffe4d31108 in
> Py::ExtensionModule<_path_module>::invoke_method_varargs(void*,
> Py::Tuple const&) ()
> from /usr/lib64/python2.7/site-packages/matplotlib/_path.so #4
> 0x00007fffe4d1acbd in method_varargs_call_handler ()
> from /usr/lib64/python2.7/site-packages/matplotlib/_path.so #5
> 0x00007ffff7b09263 in PyEval_EvalFrameEx ()
> from /usr/lib/libpython2.7.so.1.0 #6  0x00007ffff7b0ab50 in
> PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0 #7
> 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
> from /usr/lib/libpython2.7.so.1.0 #8  0x00007ffff7b0ab50 in
> PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
> #9  0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #10 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> ---Type <return> to continue, or q <return> to quit---
> #11 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #12 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #13 0x00007ffff7a95f26 in ?? () from /usr/lib/libpython2.7.so.1.0
> #14 0x00007ffff7a6d542 in PyObject_Call ()
> from /usr/lib/libpython2.7.so.1.0 #15 0x00007ffff7b07a27 in
> PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
> #16 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #17 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #18 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #19 0x00007ffff7b0ac62 in PyEval_EvalCode ()
> from /usr/lib/libpython2.7.so.1.0 #20 0x00007ffff7b0a155 in
> PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
> #21 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #22 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #23 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> ---Type <return> to continue, or q <return> to quit---
> #24 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #25 0x00007ffff7b09464 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #26 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #27 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #28 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #29 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #30 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #31 0x00007ffff7b09337 in PyEval_EvalFrameEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #32 0x00007ffff7b0ab50 in PyEval_EvalCodeEx ()
>   from /usr/lib/libpython2.7.so.1.0
> #33 0x00007ffff7b0ac62 in PyEval_EvalCode ()
> from /usr/lib/libpython2.7.so.1.0 #34 0x00007ffff7b24e8c in ?? ()
> from /usr/lib/libpython2.7.so.1.0 #35 0x00007ffff7b24f62 in
> PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
> #36 0x00007ffff7b2649c in PyRun_SimpleFileExFlags ()
> ---Type <return> to continue, or q <return> to quit---
>   from /usr/lib/libpython2.7.so.1.0
> #37 0x00007ffff7b37619 in Py_Main () from /usr/lib/libpython2.7.so.1.0
> #38 0x00007ffff74cebbd in __libc_start_main () from /lib/libc.so.6
> #39 0x00000000004008c9 in _start ()
>
>     ___________________________
> ____/   try 4 Qt4Agg + q4thread \_____
>
> With a ipython -pylab -q4thread
> everything seems to work except the autoindent feature
>
>
>     ___________________
> ____/   try 5 python -i \_____
>
> with python -i no pb at all
>
> phil@Numokh ~ % python -i
> Python 2.7.1 (r271:86832, Feb  8 2011, 00:36:24)
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from pylab import *
>>>> plot([4])
> [<matplotlib.lines.Line2D object at 0x17c0ed0>]
>>>> show()
>>>>
>
>     _____________________
> ____/   try 6 ipython git \_____
>
> I tried with ipython from git
> phil@Numokh ipython % python ipython.py --pylab
> Python 2.7.1 (r271:86832, Feb  8 2011, 00:36:24)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.11.dev -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object', use 'object??' for extra details.
>
> Welcome to pylab, a matplotlib-based Python environment [backend:
> Qt4Agg]. For more information, type 'help(pylab)'.
>
> In [1]: plot([4])
> Out[1]: [<matplotlib.lines.Line2D object at 0x1f8e5d0>]
>
> but in this case I have issues with unicode pb ...
> In [2]: xlabel('température')
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
> position 12: ordinal not in range(128)
>
>
>     _________
> ____/   specs \_____
>
> here is my python package :
> - dev-lang/python-2.7.1
> - dev-python/numpy-1.5.1
> - sci-libs/scipy-0.8.1
> - dev-python/matplotlib-1.0.1 (with the USEFLAGS cairo examples excel
>  gtk latex qt4 tk traits wxwidgets -doc -fltk)
> - dev-python/ipython-0.10.1 (with the USEFLAGS doc examples readline
>  smp wxwidgets -emacs -gnuplot -test)
>
>
> At this point I'm lost !!! any idea
>
> Philippe Baucour
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>

I found similar issues

http://bugs.gentoo.org/show_bug.cgi?id=338513
https://github.com/cschwan/sage-on-gentoo/issues/issue/40/
http://archives.gentoo.org/gentoo-science/msg_f8b16ae6a1f48dca0792e75e7e3b702d.xml




-- 
Philippe BAUCOUR
44 rue Voltaire
90000 Belfort
FRANCE
Tel :  +33 (0)9.51.13.65.01


More information about the IPython-User mailing list