VTK9.1.0 problems

In the following code

import vtk

src = vtk.vtkCylinderSource()

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(src.GetOutputPort())

actor = vtk.vtkActor()
actor.SetMapper(mapper)

actor.GetProperty().EdgeVisibilityOn()
actor.GetProperty().SetLineWidth(5)
actor.GetProperty().SetOpacity(0.5)

ren = vtk.vtkRenderer()
ren.AddActor(actor)
ren.SetBackground(0.1, 0.2, 0.4)

renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.SetSize(500, 500)
#print(renWin.GetScreenSize()) # THIS SEG FAULTS in ubuntu

iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
#iren.Start() # need this to see it rotating in OSX

for i  in range(180):
    iren.Render()
    ren.GetActiveCamera().Azimuth(1)
iren.Start()

Screenshot from 2021-11-07 00-01-43

  • one can see thin lines which should not be there.
  • the renWin.GetScreenSize() causes either segmentation fault (ubuntu), or this output error depending on the machine:
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  38 (X_QueryPointer)
  Resource id in failed request:  0x5e00002
  Serial number of failed request:  188
  Current serial number in output stream:  188
  • on OSX (Monterey) the cylinder is not rotating at all, only the final rendering is shown, unless Start() is called.

Hi, Marco,

Please, make sure you have the latest X11/Xorg and graphics card drivers in your systems.

regards,

Paulo

I could not reproduce the crash, with either the whl package or with a VTK 9.1 that I built myself.

But I can reproduce the edge visibility bug (the thin lines). These lines definitely did not appear with VTK 9.0.

actor.GetProperty().EdgeVisibilityOn()

FYI, Iā€™m using the open-source amdgpu drivers on ubuntu 20.04. @marcomusy what drivers are you using?

I also have Ubuntu 20.04.3 LTS with nvidia

Screenshot from 2021-11-08 16-54-17

I have 2 ubuntu machines and they both crash in erratic ways on GetScreenSize() when the rendering window closes.

Ah, okay. I also see a crash on window close if I uncomment the GetScreenSize() line. That crash occurs for both 9.0 and 9.1. Must be a resource allocation/deallocation error or something similar. Stack trace shows the crash occurs while X11 is waiting for events:

#0  0x00007ffff17679b4 in xcb_poll_for_event () from /lib/x86_64-linux-gnu/libxcb.so.1
#1  0x00007ffff17c156e in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#2  0x00007ffff17c16ed in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#3  0x00007ffff17c19ea in _XEventsQueued () from /lib/x86_64-linux-gnu/libX11.so.6
#4  0x00007ffff17b3211 in XPending () from /lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007ffff18f5dc7 in vtkXRenderWindowInteractor::StartEventLoop (this=<optimized out>) at VTK/Rendering/UI/vtkXRenderWindowInteractor.cxx:272
#6  0x00007ffff3cd114d in PyvtkRenderWindowInteractor_Start (self=<optimized out>, args=<optimized out>) at VTK-build/CMakeFiles/vtkRenderingCorePython/vtkRenderWindowInteractorPython.cxx:249
#7  0x00007ffff7ab3667 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#8  0x00007ffff7ab3afb in _PyObject_MakeTpCall () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#9  0x00007ffff787fdf3 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#10 0x00007ffff7887ef6 in _PyEval_EvalFrameDefault () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#11 0x00007ffff79d5ecb in _PyEval_EvalCodeWithName () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#12 0x00007ffff79d6252 in PyEval_EvalCodeEx () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#13 0x00007ffff79d663f in PyEval_EvalCode () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#14 0x00007ffff79970dc in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#15 0x00007ffff7998a47 in PyRun_SimpleFileExFlags () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#16 0x00007ffff7979558 in Py_RunMain () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#17 0x00007ffff7979aa7 in Py_Main () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0
#18 0x00007ffff7da88cb in vtkPythonInterpreter::PyMain (argc=<optimized out>, argv=0x7fffffffdfa8) at VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx:554
#19 0x00005555555552ff in main (argc=2, argv=0x7fffffffdfa8) at VTK/Wrapping/Python/vtkPythonAppInit.cxx:110

I created a bug report (#18372) for the X11 crash. A work-around is to not call renWin.GetScreenSize() until after iren.Initialize().

The ghostly diagonals look similar to the ones reported in #18064, but that report was against VTK 9.0, not VTK 9.1. @cory.quammen are there other known issues with EdgeVisibilityOn()?

1 Like