BUG: Class inconsistencies (and segfaults) introduced in VTK9
I am working on porting the Python Mayavi bindings for VTK to support VTK 9. In theory there should be nothing to do if everything in VTK 9 is consistent. I have noticed the following problems:
- The
vtkJavaScriptDataWriter
class causes a segfault when it is instantiated, then garbage collected by Python (see workaround here). This is presumably a problem with the class destructor if the class is never really used? Either that, or calling some or all of theGet
methods on the class -- we call only some of them (should be all; see point (2)) -- causes some internal memory problem that later causes things to die during destruction...? - In VTK <= 8.2, there were a handful of
Get
methods that, when called on instantiated (but otherwise unchanged) classes, would cause a segfault. This list has gotten much larger (see expanded list here) - In VTK <= 8.2, there were a handful of method that, when called, would return
None
instead of a default numeric value (even though they were designed to take numeric values). This list has gotten much longer for VTK 9 (see list here).
I'm not sure which of these, if any, are worth fixing. I can and am working around them at the Python end, but they might suggest some internal problems with these classes, hence the issue here.
If any or all of them do indeed seem like bugs, in the future it might make sense to pull the latest mayavi
version and try doing python setup.py build
with it, as it will expose such inconsistencies immediately instead of seeing a bunch at release time. Basically it can serve as a consistency check that might be beneficial during PR review via CI.