MantisBT - VTK
View Issue Details
0006259VTK(No Category)public2008-01-18 10:362008-02-19 11:22
Jerome Robert 
Jeff Baumes 
normalcrashalways
closedfixed 
 
 
0006259: The JVM crash when vtk.vtkAbstractPropPicker.GetPath() should return null:
With the head of the CVS, the JVM crash when vtk.vtkAbstractPropPicker.GetPath() should return null:

Stack: [0x89857000,0x898a8000), sp=0x898a6b50, free space=318k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libvtkCommonJava.so.5.1.0+0x6d586] Java_vtk_vtkObjectBase_VTKRegister+0x2a
j vtk.vtkObjectBase.VTKRegister()V+0
j vtk.vtkObjectBase.<init>(J)V+20
j vtk.vtkObject.<init>(J)V+2
j vtk.vtkCollection.<init>(J)V+2
j vtk.vtkAssemblyPath.<init>(J)V+2
j vtk.vtkAbstractPropPicker.GetPath()Lvtk/vtkAssemblyPath;+51
j testvtk.TestVTK$1.mouseClicked(Ljava/awt/event/MouseEvent;)V+44

vtk.vtkAbstractPropPicker.GetPath() is trying to create a vtkAssemblyPath with a 0/NULL native adress:

  public vtkAssemblyPath GetPath() {
    long temp = GetPath_3(); //temp == 0L

    vtkAssemblyPath obj = null;
    java.lang.ref.WeakReference ref = (java.lang.ref.WeakReference)vtkGlobalJavaHash.PointerToReference.get(new Long(temp));
    if (ref != null) {
      obj = (vtkAssemblyPath)ref.get();
    }
    if (obj == null) {
      vtkAssemblyPath tempObj = new vtkAssemblyPath(temp); //crash here because temp == 0L
...


Suggested solution:

-- Wrapping/vtkParseJava.c 8 Oct 2007 14:40:27 -0000 1.39
+++ Wrapping/vtkParseJava.c 18 Jan 2008 15:09:00 -0000
@@ -555,6 +555,7 @@
           fprintf(fp,"id%i",i);
           }
         fprintf(fp,");\n");
+ fprintf(fp,"\n if(temp==0) return null;");
         fprintf(fp,"\n %s obj = null;", currentFunction->ReturnClass);
         fprintf(fp,"\n java.lang.ref.WeakReference ref = (java.lang.ref.WeakReference)vtkGlobalJavaHash.PointerToReference.get(new Long(temp));");
         fprintf(fp,"\n if (ref != null) {");
No tags attached.
Issue History
2008-01-18 10:36Jerome RobertNew Issue
2008-02-06 09:19Jeff BaumesStatusbacklog => tabled
2008-02-06 09:19Jeff BaumesAssigned To => Jeff Baumes
2008-02-19 11:22Jeff BaumesStatustabled => closed
2008-02-19 11:22Jeff BaumesNote Added: 0010587
2008-02-19 11:22Jeff BaumesResolutionopen => fixed
2011-06-16 13:11Zack GalbreathCategory => (No Category)

Notes
(0010587)
Jeff Baumes   
2008-02-19 11:22   
This one line change has been committed to VTK CVS.