BUG: Segfault for vtkContextMouseEvent
When working to get Mayavi to deal with all classes properly, I got a segfault. The macOS OS-level traceback for pytest tvtk
ends up being:
Process: python3.8 [49631]
Path: /Users/USER/*/python
Identifier: python3.8
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [49188]
Responsible: Terminal [49185]
User ID: 501
Date/Time: 2020-07-22 16:51:50.203 -0400
OS Version: Mac OS X 10.15.5 (19F101)
Report Version: 12
Bridge OS Version: 4.5 (17P5300)
Anonymous UUID: 530319EF-AA7E-7A31-4BE7-0B0F7E9D6775
Sleep/Wake UUID: 159D81B3-E5F6-4DB4-A810-C49ABB404825
Time Awake Since Boot: 280000 seconds
Time Since Wake: 100 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff720ac33a __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff72168e60 pthread_kill + 430
2 libsystem_c.dylib 0x00007fff71fc393e raise + 26
3 libsystem_platform.dylib 0x00007fff7215d5fd _sigtramp + 29
4 ??? 000000000000000000 0 + 0
5 libvtkWrappingPythonCore.1.dylib 0x00000001096e71a5 vtkPythonUtil::GetObjectFromPointer(vtkObjectBase*) + 53
6 vtkRenderingContext2D.cpython-38-darwin.so 0x000000011954b444 PyvtkContextMouseEvent_GetInteractor(_object*, _object*) + 132
7 python 0x0000000107835020 cfunction_call_varargs + 224
8 python 0x00000001078341d7 _PyObject_MakeTpCall + 167
9 python 0x000000010796b76d _PyEval_EvalFrameDefault + 46269
... up to 139 frames of Python calls
I can also trigger it with something simpler:
$ python -c "import vtk; vtk.vtkContextMouseEvent().GetInteractor()"
Segmentation fault: 11
I can work around this in Mayavi, but it might be worth digging into the VTK code to figure out why this breaks. It happens on both Linux and macOS in testing.