[vtkusers] Python crash [was: Problem with loading libvtkRenderingPythonTkWidgets.dylib]

Miguel Ortiz Lombardia ibdeno at gmail.com
Thu Jun 10 15:09:28 EDT 2010


Hi Eric,

Thank you for your e-mail.
Sorry, I should have mentioned that I had already compiled VTK with 

VTK_USE_RPATH: ON
BUILD_SHARED_LIBS: ON

As install prefix I'm giving /usr/local so all vtk libraries get installed in /usr/local/lib/vtk-5.6
For some reason, though, they are sought in /usr/local/lib even if I modify the vtkLoadPythonTkWidgets.py file to force a search in /usr/local/lib/vtk-5.6. So in the end I found that I could solve my problem by simply creating links in /usr/local/lib pointing to the dylib files in /usr/local/lib/vtk-5.6 Perhaps not an elegant solution, but seems to work.

Unfortunately I'm now facing another problem, a segmentation fault. I am attaching the relevant part (hopefully) of the crash report in case someone could find the culprit:

Process:         Python [43233]
Path:            /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
Identifier:      org.python.python.app
Version:         2.6 (2.6)
Build Info:      python-440100~6
Code Type:       X86-64 (Native)
Parent Process:  bash [818]

PlugIn Path:       /usr/X11/lib/libX11.6.dylib
PlugIn Identifier: libX11.6.dylib
PlugIn Version:    9.0.0 (compatibility 9.0.0)

Date/Time:       2010-06-10 20:51:17.588 +0200
OS Version:      Mac OS X 10.6.3 (10D573)
Report Version:  6

(...)

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libX11.6.dylib                	0x000000010499ec06 XQueryExtension + 100
1   libX11.6.dylib                	0x0000000104994281 XInitExtension + 40
2   libXext.6.dylib               	0x0000000104ac5f1e XextAddDisplay + 96
3   libGL.1.dylib                 	0x0000000104b23a5d __glXInitialize + 25
4   libGL.1.dylib                 	0x0000000104b246e5 GetGLXPrivScreenConfig + 46
5   libGL.1.dylib                 	0x0000000104b2554f glXChooseVisual + 50
6   libvtkRendering.5.6.dylib     	0x00000001044bddfa vtkXOpenGLRenderWindowTryForVisual(_XDisplay*, int, int, int, int, int) + 755
7   libvtkRendering.5.6.dylib     	0x00000001044be062 vtkXOpenGLRenderWindow::GetDesiredVisualInfo() + 614
8   libvtkRendering.5.6.dylib     	0x00000001044baea7 vtkXOpenGLRenderWindow::GetDesiredColormap() + 71
9   ...deringPythonTkWidgets.dylib	0x0000000107cde1fe vtkTkRenderWidget_MakeRenderWindow(vtkTkRenderWidget*) + 601
10  ...deringPythonTkWidgets.dylib	0x0000000107cde764 vtkTkRenderWidget_Configure(Tcl_Interp*, vtkTkRenderWidget*, int, char**, int) + 132
11  ...deringPythonTkWidgets.dylib	0x0000000107cde8d5 vtkTkRenderWidget_Cmd + 338
12  Tcl                           	0x000000010713a05b TclInvokeStringCommand + 105
13  Tcl                           	0x000000010713e559 Tcl_CreateInterp + 4820
14  Tcl                           	0x000000010713f769 Tcl_EvalObjv + 66
15  _tkinter.so                   	0x0000000107124243 Tkapp_CallDeallocArgs + 11477
16  org.python.python             	0x0000000100089187 PyEval_EvalFrameEx + 15317
17  org.python.python             	0x000000010008acce PyEval_EvalCodeEx + 1803
18  org.python.python             	0x000000010002c8e1 PyClassMethod_New + 1748
19  org.python.python             	0x000000010000aff3 PyObject_Call + 112
20  org.python.python             	0x000000010001a9df PyClass_New + 1575
21  org.python.python             	0x000000010000aff3 PyObject_Call + 112
22  org.python.python             	0x000000010008a51a PyEval_EvalFrameEx + 20328
23  org.python.python             	0x000000010008acce PyEval_EvalCodeEx + 1803
24  org.python.python             	0x000000010002c88f PyClassMethod_New + 1666
25  org.python.python             	0x000000010000aff3 PyObject_Call + 112
26  org.python.python             	0x000000010001a9df PyClass_New + 1575
27  org.python.python             	0x000000010000aff3 PyObject_Call + 112
28  org.python.python             	0x00000001000849db PyEval_CallObjectWithKeywords + 175
29  org.python.python             	0x000000010001a303 PyInstance_New + 309
30  org.python.python             	0x000000010000aff3 PyObject_Call + 112
31  org.python.python             	0x000000010008a51a PyEval_EvalFrameEx + 20328
32  org.python.python             	0x00000001000892e1 PyEval_EvalFrameEx + 15663
33  org.python.python             	0x000000010008acce PyEval_EvalCodeEx + 1803
34  org.python.python             	0x000000010008ad61 PyEval_EvalCode + 54
35  org.python.python             	0x00000001000a265a Py_CompileString + 78
36  org.python.python             	0x00000001000a2723 PyRun_FileExFlags + 150
37  org.python.python             	0x00000001000a423d PyRun_SimpleFileExFlags + 704
38  org.python.python             	0x00000001000b0286 Py_Main + 2718
39  org.python.python.app         	0x0000000100000e6c start + 52

I can send the full crash report off the list if that might help.

Thanks again!


Miguel

Le 10 juin 2010 à 16:03, Eric E. Monson a écrit :

> Hey Miguel,
> 
> Are you sure it's really looking for the library in /usr/local/lib/vtk-5.6/ ? On my OS X build the Python.so libraries in the site-packages VTK egg really look in my build/bin directory. Have you tried running "otool -L" on the .so library? If you have built VTK with VTK_USE_RPATH: OFF, then it will just list libvtkRenderingPythonTkWidgets.dylib with no absolute path before it, and thus will not be able to find it. If it has a path, then that's where it's really looking for it, and you can check if it's there. If you haven't, I would recommend building on OS X with VTK_USE_RPATH: ON so the system has an easier time finding the libraries it needs.
> 
> I don't build with Tcl/Tk wrapping on, so maybe I'm off-base on this, but it's worth a try. You really shouldn't have to add any extra paths if the Python wrappers have been built and installed correctly.
> 
> Talk to you later,
> -Eric
> 
> On Jun 10, 2010, at 3:22 AM, Miguel Ortiz Lombardia wrote:
> 
>> Hi,
>> 
>> I have installed VTK-5.6 on a 64bit OSX 10.6.3 machine with Tcl,Tk and Python wrappers. When trying to use one application that requires VTK I get this error:
>> 
>> File "/Users/mol/tmp/veda/VEDA/mod/gfx.py", line 94, in setenv
>>   self.iren = vtkTkRenderWindowInteractor(root,rw=self.renwin, width=1000, height=800)
>> File "/usr/local/lib/python2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkTkRenderWindowInteractor.py", line 48, in __init__
>>   vtkLoadPythonTkWidgets(master.tk)
>> File "/usr/local/lib/python2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkLoadPythonTkWidgets.py", line 70, in vtkLoadPythonTkWidgets
>>   interp.call('load', filename)
>> _tkinter.TclError: dlopen(libvtkRenderingPythonTkWidgets.dylib, 10): image not found
>> 
>> I looked into /usr/local/lib/python2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkLoadPythonTkWidgets.py and found that the path where the vtk libraries were installed ( /usr/local/lib/vtk-5.6/ ) was not included in the pathlist. So I modified  vtkLoadPythonTkWidgets.py accordingly :
>> 
>>   if os.name == 'posix':
>>       pathlist.append('/usr/local/lib/vtk-5.6')
>> 
>> I checked (via print) that the "interp.eval('catch {load '+fullpath+' '+pkgname+'}')" construction was correctly built, and it was. I also checked, of course, that the libvtkRenderingPythonTkWidgets.dylib was where I was looking for it and that it contains Vtkrenderingpythontkwidgets (via strings).
>> 
>> But I keep getting the same error. I would appreciate if anyone can suggest what is going on here.
>> 
>> Best wishes,
>> 
>> 
>> -- Miguel
>> 
>> 
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> 

-- Miguel






More information about the vtkusers mailing list