MantisBT - VTK
View Issue Details
0008942VTK(No Category)public2009-04-29 04:142016-08-12 09:55
dbarbier 
Kitware Robot 
normalcrashalways
closedmoved 
 
 
0008942: [Java] vtkObjectBase.Delete() corrupts vtkGlobalJavaHash
The Java garbage collector (called GC in this bugreport) removes weak references from vtkGlobalJavaHash.PointerToReference when it deletes unused objects.
This is all good. Buf if vtkObjectBase.Delete() is called explicitly (which is recommended in Java to avoid threading issues), vtkGlobalJavaHash.PointerToReference is not updated and contains an invalid entry, old vtkId points to an object which has been deleted from native code but not yet GC'ed.
If native code reuses the same address before object is GC'ed, vtkGlobalJavaHash.PointerToReference.get(vtkId) will return this object instead of null.
Here is a test case to reproduce this bug, output is:
Exception in thread "main" java.lang.ClassCastException: vtk.vtkQuadric cannot be cast to vtk.vtkDataArray
        at vtk.vtkDataArray.CreateDataArray(vtkDataArray.java:267)
        at BugWeakRef.main(BugWeakRef.java:21)
No tags attached.
? BugWeakRef.java (724) 2009-04-29 04:14
https://www.vtk.org/Bug/file/7199/BugWeakRef.java
patch BugWeakRef.patch (1,673) 2009-04-29 04:16
https://www.vtk.org/Bug/file/7200/BugWeakRef.patch
Issue History
2009-04-29 04:14dbarbierNew Issue
2009-04-29 04:14dbarbierFile Added: BugWeakRef.java
2009-04-29 04:16dbarbierFile Added: BugWeakRef.patch
2009-04-29 04:17dbarbierNote Added: 0016238
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037072
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0016238)
dbarbier   
2009-04-29 04:17   
Patch applies against VTK 5.4 and current CVS HEAD.
(0037072)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.