Mayavi bus error in EPD 6.1 on OS X 10.6

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Mayavi bus error in EPD 6.1 on OS X 10.6

Erik Tollerud
I can't seem to get mayavi to work in python scripts under Mac OS X
10.6 using the latest (6.1) EPD.  If I run the mayavi application, it
seems to work fine, but if I invoke any mayavi scripts from the
command line, it crashes with a "Bus Error" whenever the mayavi window
is supposed to actually appear.  Any idea what's causing this?  Mayavi
scripts worked fine in the earlier version of EPD I had installed
(unfortunately I don't remember precisely which version, and I need
some other features of the new version)... The stack trace is below.


Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   org.python.python                   0x746e6e90 PyErr_Occurred + 16
(errors.c:77)
1   org.python.python                   0x7470b09f _PyObject_GC_Malloc +
122 (gcmodule.c:1330)
2   org.python.python                   0x7470b105 _PyObject_GC_NewVar + 37
(gcmodule.c:1357)
3   org.python.python                   0x7469529c PyTuple_New + 252
(tupleobject.c:69)
4   libvtkCommonPythonD.5.4.dylib       0x741b0c82 PyVTKClass_New + 312
5   ...tkGraphicsPythonD.5.4.dylib      0x760021eb
PyVTKClass_vtkEdgeSubdivisionCriterionNew + 77
6   ...tkGraphicsPythonD.5.4.dylib      0x75fe875e
PyVTKClass_vtkDataSetEdgeSubdivisionCriterionNew + 24
7   libvtkGraphicsPython.so             0x73fdf5db
initlibvtkGraphicsPython + 4729
8   org.python.python                   0x000dd607
_PyImport_LoadDynamicModule + 167
9   org.python.python                   0x000daf93 load_module + 227
10  org.python.python                   0x000db4bd import_submodule + 301
11  org.python.python                   0x000db719 load_next + 201
12  org.python.python                   0x000dc0c1
PyImport_ImportModuleLevel + 337
13  org.python.python                   0x000b4c8f builtin___import__ + 159
14  org.python.python                   0x0000ef35 PyObject_Call + 85
15  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
16  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
17  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
18  org.python.python                   0x000c2527 PyEval_EvalCode + 87
19  org.python.python                   0x000d9bfc
PyImport_ExecCodeModuleEx + 188
20  org.python.python                   0x000da89c load_source_module + 540
21  org.python.python                   0x000db4bd import_submodule + 301
22  org.python.python                   0x000db719 load_next + 201
23  org.python.python                   0x000dc0c1
PyImport_ImportModuleLevel + 337
24  org.python.python                   0x000b4c8f builtin___import__ + 159
25  org.python.python                   0x0000ef35 PyObject_Call + 85
26  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
27  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
28  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
29  org.python.python                   0x000c2527 PyEval_EvalCode + 87
30  org.python.python                   0x000d9bfc
PyImport_ExecCodeModuleEx + 188
31  org.python.python                   0x000da89c load_source_module + 540
32  org.python.python                   0x000db2f4 load_package + 468
33  org.python.python                   0x000db4bd import_submodule + 301
34  org.python.python                   0x000db750 load_next + 256
35  org.python.python                   0x000dc0c1
PyImport_ImportModuleLevel + 337
36  org.python.python                   0x000b4c8f builtin___import__ + 159
37  org.python.python                   0x0000ef35 PyObject_Call + 85
38  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
39  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
40  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
41  org.python.python                   0x000c2527 PyEval_EvalCode + 87
42  org.python.python                   0x000d9bfc
PyImport_ExecCodeModuleEx + 188
43  org.python.python                   0x000da89c load_source_module + 540
44  org.python.python                   0x000db4bd import_submodule + 301
45  org.python.python                   0x000db719 load_next + 201
46  org.python.python                   0x000dc113
PyImport_ImportModuleLevel + 419
47  org.python.python                   0x000b4c8f builtin___import__ + 159
48  org.python.python                   0x0000ef35 PyObject_Call + 85
49  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
50  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
51  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
52  org.python.python                   0x000c2527 PyEval_EvalCode + 87
53  org.python.python                   0x000d9bfc
PyImport_ExecCodeModuleEx + 188
54  org.python.python                   0x000da89c load_source_module + 540
55  org.python.python                   0x000db4bd import_submodule + 301
56  org.python.python                   0x000db719 load_next + 201
57  org.python.python                   0x000dc0c1
PyImport_ImportModuleLevel + 337
58  org.python.python                   0x000b4c8f builtin___import__ + 159
59  org.python.python                   0x0000ef35 PyObject_Call + 85
60  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
61  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
62  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
63  org.python.python                   0x000c2527 PyEval_EvalCode + 87
64  org.python.python                   0x000d9bfc
PyImport_ExecCodeModuleEx + 188
65  org.python.python                   0x000da89c load_source_module + 540
66  org.python.python                   0x000db4bd import_submodule + 301
67  org.python.python                   0x000db719 load_next + 201
68  org.python.python                   0x000dc113
PyImport_ImportModuleLevel + 419
69  org.python.python                   0x000b4c8f builtin___import__ + 159
70  org.python.python                   0x0000ef35 PyObject_Call + 85
71  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
72  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
73  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
74  org.python.python                   0x000c2527 PyEval_EvalCode + 87
75  org.python.python                   0x000d9bfc
PyImport_ExecCodeModuleEx + 188
76  org.python.python                   0x000da89c load_source_module + 540
77  org.python.python                   0x000db4bd import_submodule + 301
78  org.python.python                   0x000dba67 ensure_fromlist + 439
79  org.python.python                   0x000dc4fd
PyImport_ImportModuleLevel + 1421
80  org.python.python                   0x000b4c8f builtin___import__ + 159
81  org.python.python                   0x0000ef35 PyObject_Call + 85
82  org.python.python                   0x000ba6ee
PyEval_CallObjectWithKeywords + 78
83  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
84  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
85  org.python.python                   0x000c2527 PyEval_EvalCode + 87
86  org.python.python                   0x000e71e8 PyRun_FileExFlags + 168
87  org.python.python                   0x000e80d3 PyRun_SimpleFileExFlags + 867
88  org.python.python                   0x000f9d18 Py_Main + 3528
89  org.python.python                   0x00001fb6 0x1000 + 4022
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi bus error in EPD 6.1 on OS X 10.6

Ilan Schnell
Hello Erik,

are you running Mayavi application by clicking on the
application icon, or by typing mayavi2 in prompt?
Maybe you have environment variables set which are
responsible for the crash?

- Ilan


On Apr 1, 2010, at 3:46 PM, Erik Tollerud wrote:

> I can't seem to get mayavi to work in python scripts under Mac OS X
> 10.6 using the latest (6.1) EPD.  If I run the mayavi application, it
> seems to work fine, but if I invoke any mayavi scripts from the
> command line, it crashes with a "Bus Error" whenever the mayavi window
> is supposed to actually appear.  Any idea what's causing this?  Mayavi
> scripts worked fine in the earlier version of EPD I had installed
> (unfortunately I don't remember precisely which version, and I need
> some other features of the new version)... The stack trace is below.
>
>
> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> 0   org.python.python                   0x746e6e90 PyErr_Occurred + 16
> (errors.c:77)
> 1   org.python.python                   0x7470b09f  
> _PyObject_GC_Malloc +
> 122 (gcmodule.c:1330)
> 2   org.python.python                   0x7470b105  
> _PyObject_GC_NewVar + 37
> (gcmodule.c:1357)
> 3   org.python.python                   0x7469529c PyTuple_New + 252
> (tupleobject.c:69)
> 4   libvtkCommonPythonD.5.4.dylib       0x741b0c82 PyVTKClass_New +  
> 312
> 5   ...tkGraphicsPythonD.5.4.dylib      0x760021eb
> PyVTKClass_vtkEdgeSubdivisionCriterionNew + 77
> 6   ...tkGraphicsPythonD.5.4.dylib      0x75fe875e
> PyVTKClass_vtkDataSetEdgeSubdivisionCriterionNew + 24
> 7   libvtkGraphicsPython.so             0x73fdf5db
> initlibvtkGraphicsPython + 4729
> 8   org.python.python                   0x000dd607
> _PyImport_LoadDynamicModule + 167
> 9   org.python.python                   0x000daf93 load_module + 227
> 10  org.python.python                   0x000db4bd import_submodule  
> + 301
> 11  org.python.python                   0x000db719 load_next + 201
> 12  org.python.python                   0x000dc0c1
> PyImport_ImportModuleLevel + 337
> 13  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 14  org.python.python                   0x0000ef35 PyObject_Call + 85
> 15  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 16  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 17  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 18  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 19  org.python.python                   0x000d9bfc
> PyImport_ExecCodeModuleEx + 188
> 20  org.python.python                   0x000da89c  
> load_source_module + 540
> 21  org.python.python                   0x000db4bd import_submodule  
> + 301
> 22  org.python.python                   0x000db719 load_next + 201
> 23  org.python.python                   0x000dc0c1
> PyImport_ImportModuleLevel + 337
> 24  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 25  org.python.python                   0x0000ef35 PyObject_Call + 85
> 26  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 27  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 28  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 29  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 30  org.python.python                   0x000d9bfc
> PyImport_ExecCodeModuleEx + 188
> 31  org.python.python                   0x000da89c  
> load_source_module + 540
> 32  org.python.python                   0x000db2f4 load_package + 468
> 33  org.python.python                   0x000db4bd import_submodule  
> + 301
> 34  org.python.python                   0x000db750 load_next + 256
> 35  org.python.python                   0x000dc0c1
> PyImport_ImportModuleLevel + 337
> 36  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 37  org.python.python                   0x0000ef35 PyObject_Call + 85
> 38  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 39  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 40  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 41  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 42  org.python.python                   0x000d9bfc
> PyImport_ExecCodeModuleEx + 188
> 43  org.python.python                   0x000da89c  
> load_source_module + 540
> 44  org.python.python                   0x000db4bd import_submodule  
> + 301
> 45  org.python.python                   0x000db719 load_next + 201
> 46  org.python.python                   0x000dc113
> PyImport_ImportModuleLevel + 419
> 47  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 48  org.python.python                   0x0000ef35 PyObject_Call + 85
> 49  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 50  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 51  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 52  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 53  org.python.python                   0x000d9bfc
> PyImport_ExecCodeModuleEx + 188
> 54  org.python.python                   0x000da89c  
> load_source_module + 540
> 55  org.python.python                   0x000db4bd import_submodule  
> + 301
> 56  org.python.python                   0x000db719 load_next + 201
> 57  org.python.python                   0x000dc0c1
> PyImport_ImportModuleLevel + 337
> 58  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 59  org.python.python                   0x0000ef35 PyObject_Call + 85
> 60  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 61  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 62  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 63  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 64  org.python.python                   0x000d9bfc
> PyImport_ExecCodeModuleEx + 188
> 65  org.python.python                   0x000da89c  
> load_source_module + 540
> 66  org.python.python                   0x000db4bd import_submodule  
> + 301
> 67  org.python.python                   0x000db719 load_next + 201
> 68  org.python.python                   0x000dc113
> PyImport_ImportModuleLevel + 419
> 69  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 70  org.python.python                   0x0000ef35 PyObject_Call + 85
> 71  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 72  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 73  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 74  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 75  org.python.python                   0x000d9bfc
> PyImport_ExecCodeModuleEx + 188
> 76  org.python.python                   0x000da89c  
> load_source_module + 540
> 77  org.python.python                   0x000db4bd import_submodule  
> + 301
> 78  org.python.python                   0x000dba67 ensure_fromlist +  
> 439
> 79  org.python.python                   0x000dc4fd
> PyImport_ImportModuleLevel + 1421
> 80  org.python.python                   0x000b4c8f  
> builtin___import__ + 159
> 81  org.python.python                   0x0000ef35 PyObject_Call + 85
> 82  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 83  org.python.python                   0x000bdc80  
> PyEval_EvalFrameEx + 9680
> 84  org.python.python                   0x000c240d PyEval_EvalCodeEx  
> + 2109
> 85  org.python.python                   0x000c2527 PyEval_EvalCode +  
> 87
> 86  org.python.python                   0x000e71e8 PyRun_FileExFlags  
> + 168
> 87  org.python.python                   0x000e80d3  
> PyRun_SimpleFileExFlags + 867
> 88  org.python.python                   0x000f9d18 Py_Main + 3528
> 89  org.python.python                   0x00001fb6 0x1000 + 4022
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi bus error in EPD 6.1 on OS X 10.6

Gael Varoquaux
In reply to this post by Erik Tollerud
On Thu, Apr 01, 2010 at 01:46:34PM -0700, Erik Tollerud wrote:
> I can't seem to get mayavi to work in python scripts under Mac OS X
> 10.6 using the latest (6.1) EPD.  If I run the mayavi application, it
> seems to work fine, but if I invoke any mayavi scripts from the
> command line, it crashes with a "Bus Error" whenever the mayavi window
> is supposed to actually appear.  

That suck. What happens if you run them in 'ipython -pylab'?

> The stack trace is below.

> [snip]

> 80  org.python.python                   0x000b4c8f builtin___import__ + 159
> 81  org.python.python                   0x0000ef35 PyObject_Call + 85
> 82  org.python.python                   0x000ba6ee
> PyEval_CallObjectWithKeywords + 78
> 83  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
> 84  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
> 85  org.python.python                   0x000c2527 PyEval_EvalCode + 87
> 86  org.python.python                   0x000e71e8 PyRun_FileExFlags + 168
> 87  org.python.python                   0x000e80d3 PyRun_SimpleFileExFlags + 867
> 88  org.python.python                   0x000f9d18 Py_Main + 3528
> 89  org.python.python                   0x00001fb6 0x1000 + 4022
I am having a hard time understanding this stack trace. It seems to me
that the segfault is happening at import time, rather than at run time.
Can you try simply running:

    python -c "from enthought.mayavi import mlab"

Also, if you can run gdb, I have recently discovered the very useful gdb
Python helpers: copy the attached .gdbinit file to your home directory,
and when you get the crash, 'up' till you are in the Python eval loop,
and then use 'pyframe' to print the position of the crash in the Python
source code.

HTH,

Gaël

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

.gdbinit (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi bus error in EPD 6.1 on OS X 10.6

Erik Tollerud
I've discovered the problem while trying to get gdb working... Turns
out Ilan was right although I missed it the first time around - a
while back I had installed the dev version of VTK and was forced to
point DYLD_LIBRARY_PATH to the /usr/local vtk directory... But of
course, the new mayavi was linked against the one that comed with EPD,
so it was freaking out because it was linked against the wrong version
of VTK.  That does explain why the segfault is at import time, though,
and why it works using the shortcut but not from the terminal.

Anyway, removing the entry fro DYLD_LIBRARY_PATH seems to have fixed
the problem.

That .gdbinit file looks like it may be very useful in the future,
though Gael... am I correct in assuming that the executable has to
have debug symbols for it to work?


On Sat, Apr 3, 2010 at 4:01 PM, Gael Varoquaux
<[hidden email]> wrote:

> On Thu, Apr 01, 2010 at 01:46:34PM -0700, Erik Tollerud wrote:
>> I can't seem to get mayavi to work in python scripts under Mac OS X
>> 10.6 using the latest (6.1) EPD.  If I run the mayavi application, it
>> seems to work fine, but if I invoke any mayavi scripts from the
>> command line, it crashes with a "Bus Error" whenever the mayavi window
>> is supposed to actually appear.
>
> That suck. What happens if you run them in 'ipython -pylab'?
>
>> The stack trace is below.
>
>> [snip]
>
>> 80  org.python.python                   0x000b4c8f builtin___import__ + 159
>> 81  org.python.python                   0x0000ef35 PyObject_Call + 85
>> 82  org.python.python                   0x000ba6ee
>> PyEval_CallObjectWithKeywords + 78
>> 83  org.python.python                   0x000bdc80 PyEval_EvalFrameEx + 9680
>> 84  org.python.python                   0x000c240d PyEval_EvalCodeEx + 2109
>> 85  org.python.python                   0x000c2527 PyEval_EvalCode + 87
>> 86  org.python.python                   0x000e71e8 PyRun_FileExFlags + 168
>> 87  org.python.python                   0x000e80d3 PyRun_SimpleFileExFlags + 867
>> 88  org.python.python                   0x000f9d18 Py_Main + 3528
>> 89  org.python.python                   0x00001fb6 0x1000 + 4022
>
> I am having a hard time understanding this stack trace. It seems to me
> that the segfault is happening at import time, rather than at run time.
> Can you try simply running:
>
>    python -c "from enthought.mayavi import mlab"
>
> Also, if you can run gdb, I have recently discovered the very useful gdb
> Python helpers: copy the attached .gdbinit file to your home directory,
> and when you get the crash, 'up' till you are in the Python eval loop,
> and then use 'pyframe' to print the position of the crash in the Python
> source code.
>
> HTH,
>
> Gaël
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi bus error in EPD 6.1 on OS X 10.6

Gael Varoquaux
On Mon, Apr 05, 2010 at 10:26:20AM -0700, Erik Tollerud wrote:
> I've discovered the problem while trying to get gdb working... Turns
> out Ilan was right although I missed it the first time around - a
> while back I had installed the dev version of VTK and was forced to
> point DYLD_LIBRARY_PATH to the /usr/local vtk directory... But of
> course, the new mayavi was linked against the one that comed with EPD,
> so it was freaking out because it was linked against the wrong version
> of VTK.  That does explain why the segfault is at import time, though,
> and why it works using the shortcut but not from the terminal.

Useful information. When you mention it, segfault at import time should
have rung a bell. Also, shortcut versus terminal option seemed like a
configuration problem, but these can be hard to track down.

> That .gdbinit file looks like it may be very useful in the future,
> though Gael... am I correct in assuming that the executable has to
> have debug symbols for it to work?

It works much better when the executable has debug symbols, because the
full stack inspection works, but I have never managed to get this to work
on real life problems: there end up being linking problems with an
external library (eg VTK). On the other hand, simple debug functions like
pyframe, pyframev or pyo work, and are already very useful.

Cheers,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev