[vtkusers] Examples/Python/Widgets/EmbedPyQt segfault on Ubuntu

Elvis Stansvik elvis.stansvik at orexplore.com
Tue Feb 23 02:37:16 EST 2016


Den 22 feb 2016 1:15 em skrev "Elvis Stansvik" <elvis.stansvik at orexplore.com
>:
>
> Hi all,
>
> Trying the
>
>     http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt
>
> example on Ubuntu with python-vtk6 (6.2.0+dfsg1-4ubuntu5) and python-qt4
(4.11.4+dfsg-1build3) installed, I get a strange segmentation fault on
startup:
>
>
>
> estan at newton:~/orexplore/dev/gui-demo$ gdb python
> GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
> Copyright (C) 2015 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-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from python...Reading symbols from
/usr/lib/debug//usr/bin/python2.7...done.
> done.
> (gdb) run test2.py
> Starting program: /usr/bin/python test2.py
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> [New Thread 0x7fffb1bb8700 (LWP 3113)]
> [New Thread 0x7fffb13b7700 (LWP 3114)]
> [New Thread 0x7fffacbb6700 (LWP 3115)]
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007fff97a2885e in _GLOBAL__sub_I_qpycore_classinfo.cpp () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
> (gdb) bt
> #0  0x00007fff97a2885e in _GLOBAL__sub_I_qpycore_classinfo.cpp () from
/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
> #1  0x00007ffff7de960a in call_init (l=<optimized out>, argc=argc at entry=2,
argv=argv at entry=0x7fffffffddf8, env=env at entry=0x7fffffffde10) at
dl-init.c:72
> #2  0x00007ffff7de971b in call_init (env=<optimized out>, argv=<optimized
out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:30
> #3  _dl_init (main_map=main_map at entry=0x9e8d10, argc=2,
argv=0x7fffffffddf8, env=0x7fffffffde10) at dl-init.c:120
> #4  0x00007ffff7dee5d7 in dl_open_worker (a=a at entry=0x7fffffffd1d8) at
dl-open.c:579
> #5  0x00007ffff7de94b4 in _dl_catch_error (objname=objname at entry=0x7fffffffd1c8,
errstring=errstring at entry=0x7fffffffd1d0,
mallocedp=mallocedp at entry=0x7fffffffd1c7,
operate=operate at entry=0x7ffff7dee0f0 <dl_open_worker>,
args=args at entry=0x7fffffffd1d8)
at dl-error.c:187
> #6  0x00007ffff7ded9f3 in _dl_open (file=0xee42e0
"/usr/lib/python2.7/dist-packages/PyQt4/QtCore.so", mode=-2147483646,
caller_dlopen=0x51a359 <_PyImport_GetDynLoadFunc+233>, nsid=-2,
argc=<optimized out>, argv=<optimized out>, env=0x7fffffffde10) at
dl-open.c:663
> #7  0x00007ffff75edfc9 in dlopen_doit (a=a at entry=0x7fffffffd3f0) at
dlopen.c:66
> #8  0x00007ffff7de94b4 in _dl_catch_error (objname=0x9a1650,
errstring=0x9a1658, mallocedp=0x9a1648, operate=0x7ffff75edf70
<dlopen_doit>, args=0x7fffffffd3f0) at dl-error.c:187
> #9  0x00007ffff75ee62d in _dlerror_run (operate=operate at entry=0x7ffff75edf70
<dlopen_doit>, args=args at entry=0x7fffffffd3f0) at dlerror.c:163
> #10 0x00007ffff75ee061 in __dlopen (file=<optimized out>, mode=<optimized
out>) at dlopen.c:87
> #11 0x000000000051a359 in _PyImport_GetDynLoadFunc () at
../Python/dynload_shlib.c:140
> #12 0x0000000000519eb4 in _PyImport_LoadDynamicModule () at
../Python/importdl.c:42
> #13 0x00000000004a2891 in import_submodule () at ../Python/import.c:2704
> #14 0x00000000004a7545 in ensure_fromlist () at ../Python/import.c:2610
> #15 0x00000000004a1cc8 in import_module_level.isra.3 (level=-1,
fromlist=('QtCore', 'QtGui'), globals=<optimized out>, name=<optimized
out>) at ../Python/import.c:2273
> #16 PyImport_ImportModuleLevel () at ../Python/import.c:2292
> #17 0x00000000004a4834 in builtin___import__ () at
../Python/bltinmodule.c:49
> #18 0x00000000004a45de in PyObject_Call () at ../Objects/abstract.c:2529
> #19 0x00000000004c3e40 in PyEval_CallObjectWithKeywords () at
../Python/ceval.c:4225
> #20 0x00000000004c2a38 in PyEval_EvalFrameEx () at ../Python/ceval.c:2628
> #21 0x00000000004b7986 in PyEval_EvalCodeEx () at ../Python/ceval.c:3588
> #22 0x00000000004e8f3f in PyEval_EvalCode (locals={'vtk': <module at
remote 0x7ffff7eb70f8>, '__builtins__': <module at remote 0x7ffff7f79b08>,
'__file__': 'test2.py', '__package__': None, 'sys': <module at remote
0x7ffff7f79bb0>, '__name__': '__main__', '__doc__': None},
>     globals={'vtk': <module at remote 0x7ffff7eb70f8>, '__builtins__':
<module at remote 0x7ffff7f79b08>, '__file__': 'test2.py', '__package__':
None, 'sys': <module at remote 0x7ffff7f79bb0>, '__name__': '__main__',
'__doc__': None}, co=0x7ffff7ee8db0) at ../Python/ceval.c:669
> #23 run_mod.lto_priv () at ../Python/pythonrun.c:1370
> #24 0x00000000004e3b02 in PyRun_FileExFlags () at
../Python/pythonrun.c:1356
> #25 0x00000000004e22e6 in PyRun_SimpleFileExFlags () at
../Python/pythonrun.c:948
> #26 0x0000000000490fe1 in Py_Main () at ../Modules/main.c:640
> #27 0x00007ffff7811a40 in __libc_start_main (main=0x4909f0 <main>,
argc=2, argv=0x7fffffffddf8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffdde8) at libc-start.c:289
> #28 0x0000000000490919 in _start ()
> Warning: the current language does not match this frame.
> (gdb)
>
>
>
> Has anyone seen this before? I'm a little perplexed, as even a very
simple program like:
>
> from PyQt4.QtGui import QApplication, QMainWindow
>
> from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
>
> import sys
>
> app = QApplication(sys.argv)
>
> gives a segmentation fault, though in this case, the crash occurs when
dlopen()ing /usr/lib/libkdecore.so.5 instead:

Sorry, I meant breeze.so, the Qt 4 style library from KDE.

In any case, I can reproduce a segfault with the tiny example above in a
clean Ubuntu Docker container, using the packages I mentioned. I'll post
the instructions + Dockerfile to do so as soon as I'm at work.

Has really no one seen this before? Surely someone has used VTK 6.2 + PyQt4
on Ubuntu?

Elvis

>
>
> #0  0x00007fff93d9bd4e in ?? () from /usr/lib/libkdecore.so.5
> #1  0x00007ffff7de960a in call_init (l=<optimized out>, argc=argc at entry=2,
argv=argv at entry=0x7fffffffddf8, env=env at entry=0x7fffffffde10) at
dl-init.c:72
> #2  0x00007ffff7de971b in call_init (env=<optimized out>, argv=<optimized
out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:30
> #3  _dl_init (main_map=main_map at entry=0x10c4470, argc=2,
argv=0x7fffffffddf8, env=0x7fffffffde10) at dl-init.c:120
> #4  0x00007ffff7dee5d7 in dl_open_worker (a=a at entry=0x7fffffffc508) at
dl-open.c:579
> #5  0x00007ffff7de94b4 in _dl_catch_error (objname=objname at entry=0x7fffffffc4f8,
errstring=errstring at entry=0x7fffffffc500,
mallocedp=mallocedp at entry=0x7fffffffc4f7,
operate=operate at entry=0x7ffff7dee0f0 <dl_open_worker>,
args=args at entry=0x7fffffffc508)
at dl-error.c:187
> #6  0x00007ffff7ded9f3 in _dl_open (file=0x10d6638
"/usr/lib/kde4/plugins/styles/breeze.so", mode=-2147483647,
caller_dlopen=0x7ffff4f08cd6, nsid=-2, argc=<optimized out>,
argv=<optimized out>, env=0x7fffffffde10) at dl-open.c:663
> #7  0x00007ffff75edfc9 in dlopen_doit (a=a at entry=0x7fffffffc720) at
dlopen.c:66
> #8  0x00007ffff7de94b4 in _dl_catch_error (objname=0x98b920,
errstring=0x98b928, mallocedp=0x98b918, operate=0x7ffff75edf70
<dlopen_doit>, args=0x7fffffffc720) at dl-error.c:187
> #9  0x00007ffff75ee62d in _dlerror_run (operate=operate at entry=0x7ffff75edf70
<dlopen_doit>, args=args at entry=0x7fffffffc720) at dlerror.c:163
> #10 0x00007ffff75ee061 in __dlopen (file=<optimized out>, mode=<optimized
out>) at dlopen.c:87
> #11 0x00007ffff4f08cd6 in ?? () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
> #12 0x00007ffff4f0307d in ?? () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
> #13 0x00007ffff4f0370b in ?? () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
> #14 0x00007ffff4efc066 in QFactoryLoader::instance(QString const&) const
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
> #15 0x00007ffff575317d in QStyleFactory::create(QString const&) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
> #16 0x00007ffff54479ce in QApplication::style() () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
> #17 0x00007ffff54b910a in ?? () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
> #18 0x00007ffff54bcc83 in ?? () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
> #19 0x00007ffff5447fa2 in QApplicationPrivate::construct(_XDisplay*,
unsigned long, unsigned long) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
> #20 0x00007ffff544824f in QApplication::QApplication(int&, char**, int)
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
> #21 0x00007ffff64fbfae in sipQApplication::sipQApplication
(this=0xba80d0, a0=<optimized out>, a1=<optimized out>) at
sipQtGuipart9.cpp:36106
> #22 0x00007ffff64fc196 in init_type_QApplication (sipSelf=0x7ffff1136938,
sipArgs=<optimized out>, sipKwds=0x0, sipUnused=<optimized out>,
sipParseErr=<optimized out>) at
/build/python-qt4-DPZMhZ/python-qt4-4.11.4+dfsg/sip/QtGui/qapplication.sip:901
> #23 0x00007ffff16901cb in sipSimpleWrapper_init (self=0x7ffff1136938,
args=(['test.py'],), kwds=0x0) at siplib.c:9702
> #24 0x00000000004a9efb in type_call.lto_priv () at
../Objects/typeobject.c:745
> #25 0x00000000004bf3cc in PyObject_Call (kw=0x0, arg=(['test.py'],),
func=<PyQt4.QtCore.pyqtWrapperType at remote 0xac4880>) at
../Objects/abstract.c:2529
> #26 do_call (nk=<optimized out>, na=<optimized out>,
pp_stack=0x7fffffffd9b0, func=<PyQt4.QtCore.pyqtWrapperType at remote
0xac4880>) at ../Python/ceval.c:4574
> #27 call_function (oparg=<optimized out>, pp_stack=0x7fffffffd9b0) at
../Python/ceval.c:4379
> #28 PyEval_EvalFrameEx () at ../Python/ceval.c:2993
> #29 0x00000000004b7986 in PyEval_EvalCodeEx () at ../Python/ceval.c:3588
> #30 0x00000000004e8f3f in PyEval_EvalCode (
>     locals={'QMainWindow': <PyQt4.QtCore.pyqtWrapperType at remote
0xb0d900>, 'QVTKRenderWindowInteractor': <PyQt4.QtCore.pyqtWrapperType at
remote 0xba7cc0>, '__builtins__': <module at remote 0x7ffff7f79b08>,
'__file__': 'test.py', 'QApplication': <PyQt4.QtCore.pyqtWrapperType at
remote 0xac4880>, '__package__': None, 'sys': <module at remote
0x7ffff7f79bb0>, '__name__': '__main__', '__doc__': None},
>     globals={'QMainWindow': <PyQt4.QtCore.pyqtWrapperType at remote
0xb0d900>, 'QVTKRenderWindowInteractor': <PyQt4.QtCore.pyqtWrapperType at
remote 0xba7cc0>, '__builtins__': <module at remote 0x7ffff7f79b08>,
'__file__': 'test.py', 'QApplication': <PyQt4.QtCore.pyqtWrapperType at
remote 0xac4880>, '__package__': None, 'sys': <module at remote
0x7ffff7f79bb0>, '__name__': '__main__', '__doc__': None},
co=0x7ffff7edfe30) at ../Python/ceval.c:669
> #31 run_mod.lto_priv () at ../Python/pythonrun.c:1370
> #32 0x00000000004e3b02 in PyRun_FileExFlags () at
../Python/pythonrun.c:1356
> #33 0x00000000004e22e6 in PyRun_SimpleFileExFlags () at
../Python/pythonrun.c:948
> #34 0x0000000000490fe1 in Py_Main () at ../Modules/main.c:640
> #35 0x00007ffff7811a40 in __libc_start_main (main=0x4909f0 <main>,
argc=2, argv=0x7fffffffddf8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffdde8) at libc-start.c:289
> #36 0x0000000000490919 in _start ()
>
>
> Just removing the
>
>    from vtk.qt4.QVTKRenderWindowInteractor import
QVTKRenderWindowInteractor
>
> from the above minimal test and the segmentation fault goes away.
>
> So something seems quite broken :/
>
> I'm surprised, as I've had VTK + PyQt4 programs working fine before.
>
> Thankful for any advice / ideas.
>
> Elvis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160223/57e59300/attachment.html>


More information about the vtkusers mailing list