I'm still investigating for my segmentation fault pb with matplotlib and
Tkagg,
but now, I have no more idea.
Here is a summary of my investigations :
=============
CONFIGURATION
=============
I'm trying to make a local installation of the following programs on a
GNU/Linux i686 (32 bits) :
- gcc-4.2.3
- tcl8.5.1
- tk8.5.1
- Python-2.5.2
- numpy-1.0.4
- scipy-0.6
- matplotlib-0.91.2
I used the option --prefix=${INSTALL_DIR} everywhere, and I compiled gcc,
tcl
tk and Python with the options --enable-shared --enable-threads. For
building
numpy, scipy and matplotlib, I defined a shell varaible named python in
order
to call the python version installed in $INSTALL_DIR.
All compilation are made from the official source tarballs.
I haven't seen any compilation problem in the log of theses compilations,
and
all tests are running fine.
======================
INSTALLING MATPLOTLIB
======================
I've put verbose=True in my setup.cfg file (but didn't see a lot of change
with that) :
$ cat setup.cfg
[ status ]
verbose=True
$python setup.py install --prefix=${INSTALL_DIR}
-------------------------------------------------------------------------------
BUILDING MATPLOTLIB
matplotlib: 0.91.2
python: 2.5.2 (r252:60911, Feb 26 2008, 22:21:12) [GCC
4.2.3]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.0.4
freetype2: 9.16.3
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.15beta5
Tkinter: Tkinter: 50704, Tk: 8.5, Tcl: 8.5
wxPython: no
* wxPython not found
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: matplotlib will provide
pytz: matplotlib will provide
OPTIONAL USETEX DEPENDENCIES
dvipng: 1.9
ghostscript: 8.15.3
latex: 3.141592
pdftops: 3.00
EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
configobj: matplotlib will provide
enthought.traits: matplotlib will provide
[Edit setup.cfg to suppress the above messages]
------------------------------------------------------------------------------
I didn't see any compilation error, only a lot of messages saying :
"""
cc1plus: attention : l'option de la ligne de commande "-Wstrict-prototypes"
est
valide pour Ada/C/ObjC mais pas pour C++
"""
==================
TESTING MATPLOTLIB
==================
$ source setenv_bash # setup environment to call the local version of
python
$ cat test.py
from pylab import *
plot([1, 2, 3])
show()
$ python2.5 test.py --verbose-debug-annoying
$HOME=/home/loic
CONFIGDIR=/home/loic/.matplotlib
matplotlib data path
/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/matplotlib/mpl-data
loaded rc file /home/loic/.matplotlib/matplotlibrc
matplotlib version 0.91.2
verbose.level debug-annoying
interactive is False
units is True
platform is linux2
loaded modules: ['_bisect', 'xml.sax.urlparse', 'distutils', 'pylab',
'datetime', 'matplotlib.tempfile', 'distutils.sysconfig',
'encodings.encodings', 'pytz.cStringIO', 'xml', 'struct', 'tempfile',
'xml.sax.urllib', '_struct', 'pytz.os', 'matplotlib.matplotlib',
'string', 'encodings.utf_8', 'matplotlib.__future__', 'pytz.tzinfo',
'pytz.datetime', 'distutils.re', 'bisect', 'signal', 'random',
'xml.sax.xmlreader', 'matplotlib.pytz', 'pytz.tzfile', 'cStringIO',
'locale', 'xml.sax.saxutils', 'encodings', 'dateutil',
'matplotlib.warnings', 'matplotlib.string', 'pytz.pytz', 'urllib',
'matplotlib.sys', 're', 'math', 'fcntl', 'UserDict', 'distutils.os',
'matplotlib', 'codecs', 'md5', '_locale', 'matplotlib.sre_constants',
'matplotlib.os', 'thread', 'weakref', 'itertools', 'distutils.sys',
'os', 'sre_parse', '__future__', 'matplotlib.copy', 'xml.sax.types',
'_sre', '__builtin__', 'matplotlib.re', 'operator', 'distutils.string
',
'matplotlib.datetime', 'posixpath', 'errno', '_socket', 'binascii',
'sre_constants', 'matplotlib.md5', 'types', 'pytz.sys',
'xml.sax.handler', 'xml.sax.os', 'matplotlib.xml', '_codecs', 'pytz',
'matplotlib.pyparsing', 'copy', 'socket', '_types',
'matplotlib.dateutil', 'hashlib', 'posix', 'encodings.aliases',
'matplotlib.fontconfig_pattern', 'exceptions', 'xml.sax._exceptions',
'pytz.bisect', 'distutils.distutils', 'copy_reg', 'sre_compile',
'xml.sax', '_hashlib', '_random', 'pytz.struct', 'site', 'zipimport',
'__main__', 'shutil', 'matplotlib.weakref', 'strop', '
encodings.codecs',
'gettext', 'matplotlib.rcsetup', 'pytz.sets', 'xml.sax.codecs',
'stat',
'_ssl', 'warnings', 'encodings.types', 'sets', 'sys', 'xml.sax.sys',
'os.path', 'pytz.gettext', 'matplotlib.distutils', '_weakref',
'distutils.errors', 'urlparse', 'linecache', 'matplotlib.shutil',
'time']
numerix numpy 1.0.4
Using fontManager instance from /home/loic/.matplotlib/fontManager.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 Bitstream Vera Sans, normal, normal 400, normal, 12.0
findfont returning
/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/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
Erreur de segmentation
===========
RUNNING GDB
===========
$ gdb python2.5
GNU gdb 6.7.1-debian
Copyright (C) 2007 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 "i486-linux-gnu"...
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/loic/tmp/bluelagoon/bin/python2.5
[Thread debugging using libthread_db enabled]
Python 2.5.2 (r252:60911, Feb 26 2008, 22:21:12)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[New Thread 0xb7c40ad0 (LWP 20090)]
>>> from pylab import *
[New Thread 0xb6916b90 (LWP 20093)]
>>> plot([1, 2, 3])
[<matplotlib.lines.Line2D instance at 0x889d24c>]
>>> show()
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7c40ad0 (LWP 20090)]
PyAggImagePhoto (clientdata=0x0, interp=0x881a068, argc=5, argv=0x8a3d318)
at src/_transforms.h:362
362 Point* ll_api() {return _ll;}
Current language: auto; currently c++
(gdb) bt
#0 PyAggImagePhoto (clientdata=0x0, interp=0x881a068, argc=5,
argv=0x8a3d318) at src/_transforms.h:362
#1 0xb6a81a06 in TclInvokeStringCommand () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#2 0xb6a8277c in TclEvalObjvInternal () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#3 0xb6a8361e in Tcl_EvalObjv () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#4 0xb6d72186 in Tkapp_Call (selfptr=0x8892288, args=0x8801f8c) at
/home/loic/tmp/bluelagoon/src/Python-2.5.2/Modules/_tkinter.c:1327
#5 0xb7e4c238 in PyCFunction_Call (func=0x889d66c, arg=0x8801f8c, kw=0x0)
at Objects/methodobject.c:108
#6 0xb7e99ed6 in PyEval_EvalFrameEx (f=0x8b0118c, throwflag=0) at
Python/ceval.c:3573
#7 0xb7e9b668 in PyEval_EvalCodeEx (co=0x8804b18, globals=0x886224c,
locals=0x0, args=0x8abc724, argcount=2, kws=0x8abc72c, kwcount=1,
defs=0x85735b8, defcount=2, closure=0x0) at Python/ceval.c:2836
#8 0xb7e99bbc in PyEval_EvalFrameEx (f=0x8abc5e4, throwflag=0) at
Python/ceval.c:3669
#9 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87d37b8, globals=0x87d52d4,
locals=0x0, args=0x8abc108, argcount=1, kws=0x8abc10c, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#10 0xb7e99bbc in PyEval_EvalFrameEx (f=0x8abbfb4, throwflag=0) at
Python/ceval.c:3669
#11 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87d3770, globals=0x87d52d4,
locals=0x0, args=0x854ed78, argcount=2, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#12 0xb7e3841f in function_call (func=0x889002c, arg=0x854ed6c, kw=0x0) at
Objects/funcobject.c:517
#13 0xb7e166e7 in PyObject_Call (func=0x6, arg=0x854ed6c, kw=0x0) at
Objects/abstract.c:1861
#14 0xb7e97c07 in PyEval_EvalFrameEx (f=0x8abb684, throwflag=0) at
Python/ceval.c:3853
#15 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87f39b0, globals=0x87d5d74,
locals=0x0, args=0xb7c07720, argcount=20, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#16 0xb7e3841f in function_call (func=0x8859684, arg=0xb7c07714, kw=0x0) at
Objects/funcobject.c:517
#17 0xb7e166e7 in PyObject_Call (func=0x6, arg=0xb7c07714, kw=0x0) at
Objects/abstract.c:1861
#18 0xb7e1de98 in instancemethod_call (func=0x8859684, arg=0xb7c07714,
kw=0x0) at Objects/classobject.c:2519
#19 0xb7e166e7 in PyObject_Call (func=0x6, arg=0x876bc5c, kw=0x0) at
Objects/abstract.c:1861
#20 0xb7e92eac in PyEval_CallObjectWithKeywords (func=0x836caa4,
arg=0x876bc5c, kw=0x0) at Python/ceval.c:3442
#21 0xb6d71082 in PythonCmd (clientData=0x8918010, interp=0x881a068,
argc=20, argv=0x8a3d2bc)
at /home/loic/tmp/bluelagoon/src/Python-2.5.2/Modules/_tkinter.c:2014
#22 0xb6a81a06 in TclInvokeStringCommand () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#23 0xb6a8277c in TclEvalObjvInternal () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#24 0xb6ac8325 in TclExecuteByteCode () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#25 0xb6ad106c in Tcl_ExprObj () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#26 0xb6a814a3 in Tcl_ExprBooleanObj () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#27 0xb6a9435c in Tcl_IfObjCmd () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#28 0xb6a8277c in TclEvalObjvInternal () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#29 0xb6a8321a in TclEvalEx () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#30 0xb6a8346e in Tcl_EvalEx () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#31 0xb6b72c94 in Tk_BindEvent () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#32 0xb6b786d1 in TkBindEventProc () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#33 0xb6b7e827 in Tk_HandleEvent () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#34 0xb6b9b196 in TkDoConfigureNotify () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#35 0xb6b9b9f7 in Tk_MakeWindowExist () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#36 0xb6b9baf8 in Tk_MapWindow () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#37 0xb6b927aa in ArrangePacking () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#38 0xb6b1a668 in TclServiceIdle () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#39 0xb6afd4a7 in Tcl_DoOneEvent () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#40 0xb6d70d9a in Tkapp_MainLoop (selfptr=0x8892288, args=0x8138c0c) at
/home/loic/tmp/bluelagoon/src/Python-2.5.2/Modules/_tkinter.c:2547
#41 0xb7e4c25a in PyCFunction_Call (func=0x88700cc, arg=0x8138c0c, kw=0x0)
at Objects/methodobject.c:73
#42 0xb7e99ed6 in PyEval_EvalFrameEx (f=0x8ab9e94, throwflag=0) at
Python/ceval.c:3573
#43 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87e0800, globals=0x87d5d74,
locals=0x0, args=0x8ab9a18, argcount=0, kws=0x8ab9a18, kwcount=0,
defs=0x88563b8, defcount=1, closure=0x0) at Python/ceval.c:2836
#44 0xb7e99bbc in PyEval_EvalFrameEx (f=0x8ab98d4, throwflag=0) at
Python/ceval.c:3669
---Type <return> to continue, or q <return> to quit---
#45 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87d3608, globals=0x87d52d4,
locals=0x0, args=0x877f678, argcount=0, kws=0x877f678, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#46 0xb7e99bbc in PyEval_EvalFrameEx (f=0x877f53c, throwflag=0) at
Python/ceval.c:3669
#47 0xb7e9b668 in PyEval_EvalCodeEx (co=0xb7c2e5c0, globals=0xb7c18acc,
locals=0xb7c18acc, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#48 0xb7e9b7c3 in PyEval_EvalCode (co=0xb7c2e5c0, globals=0xb7c18acc,
locals=0xb7c18acc) at Python/ceval.c:494
#49 0xb7ebdf53 in PyRun_InteractiveOneFlags (fp=0xb7d8a440,
filename=0xb7ef36fc "<stdin>", flags=0xbfd05ad8) at Python/pythonrun.c:1273
#50 0xb7ebe18b in PyRun_InteractiveLoopFlags (fp=0xb7d8a440,
filename=0xb7ef36fc "<stdin>", flags=0xbfd05ad8) at Python/pythonrun.c:723
#51 0xb7ebe8d7 in PyRun_AnyFileExFlags (fp=0xb7d8a440, filename=0xb7ef36fc
"<stdin>", closeit=0, flags=0xbfd05ad8)
at Python/pythonrun.c:692
#52 0xb7ec819f in Py_Main (argc=0, argv=0xbfd05ba4) at Modules/main.c:523
#53 0x080485b2 in main (argc=Cannot access memory at address 0x6
) at ./Modules/python.c:23
The local version of Python use the good version of Tcl/Tk.
=============
TESTING Tkinter
=============
$ wget
http://academic.evergreen.edu/curricular/modelingmotion/ExampleCode/gui/hello2.py
--07:55:32--
http://academic.evergreen.edu/curricular/modelingmotion/ExampleCode/gui/hello2.py
=> `hello2.py.1'
Résolution de academic.evergreen.edu... 192.211.16.13
Connexion vers academic.evergreen.edu|192.211.16.13|:80...connecté.
requête HTTP transmise, en attente de la réponse...200 OK
Longueur: 613 [text/plain]
100%[=================================>] 613 --.--K/s
07:55:33 (80.95 MB/s) - « hello2.py » sauvegardé [613/613]
$ python2.5 hello2.py
=> works fine.
======================================
TESTING MATPLOTLIB'MODULES IMPORTATION
======================================
I've seen oin the archive that there could be issue with pycxx and some
version
of gcc, and that trying to import matplotlib submodule could give some
clues :
(cf.
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg02822.html
)
$ python2.5
Python 2.5.2 (r252:60911, Feb 26 2008, 22:21:12)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib._image
>>> import matplotlib._transforms
>>> import matplotlib.backends._ns_backend_agg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _ns_backend_agg
>>> import matplotlib.backends._tkagg
>>> import matplotlib._agg
>>>
>>>
>>> import matplotlib.backends
>>> dir(matplotlib.backends)
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__',
'_tkagg', 'all_backends', 'backend', 'interactive_bk', 'matplotlib',
'non_interactive_bk', 'pylab_setup', 'sys', 'time']
Did this give you any information ?
==========
FINALLY...
==========
Does anybody has a clue ?
I've tested to install others versions of gcc, tcl/tk or python, but it
didn't solve the problem.
I've tested to make a local installation pycxx-5.4.0, but this didn't work
either.
So, I'm suspecting a prroblem with the fact of making a local installation
of
these programs, but I don't see where.
I've added $INSTALL_DIR/lib to both $LD_LIBRARY_PATH and $LD_RUN_PATH, and
$INSTALL_DIR/bin is the first directory of my $PATH.
--
LB
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users