MantisBT - VTK
View Issue Details
0001624VTK(No Category)public2005-02-27 15:382014-10-05 15:17
eric kischell 
David Cole 
highmajoralways
closedfixed 
 
6.2.0 
0001624: vtkVRMLImporter EXCEPTION_ACCESS_VIOLATION for valid VRML V2.0 file
Under VTK 4.5 when using vtkVRMLImporter to read in a valid VRML 2.0 file, I get an EXCEPTION_ACCESS_VIOLATION under Java 1.5.

Dump
---
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0be9d701, pid=1700, tid=988
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode)
# Problematic frame:
# C [vtkHybrid.dll+0x9d701]
#
# An error report file with more information is saved as hs_err_pid1700.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp [^]
#

I have a few VRML 2.0 files which also exhibit this behavior. Note, they all load fine under Cortona VRML client.
hackaton
? f15j.wrl (24,484) 1969-12-31 19:00
https://www.vtk.org/Bug/file/5236/f15j.wrl
? rafale.wrl (46,065) 1969-12-31 19:00
https://www.vtk.org/Bug/file/5237/rafale.wrl
? diff (442) 2011-11-25 01:07
https://www.vtk.org/Bug/file/9075/diff
Issue History
2008-11-30 09:23Mathieu MalaterreAssigned ToMathieu Malaterre => David Cole
2011-01-19 10:14David ColeAssigned ToDavid Cole =>
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2011-11-25 01:07Steve RobbinsFile Added: diff
2011-11-25 01:08Steve RobbinsNote Added: 0027732
2013-06-05 15:24Jean-Christophe Fillion-RobinNote Added: 0030909
2013-06-05 23:23Steve RobbinsNote Added: 0030963
2014-10-02 09:38David ColeTag Attached: hackaton
2014-10-02 09:38David ColeAssigned To => David Cole
2014-10-02 09:38David ColeStatusbacklog => active development
2014-10-02 17:06David ColeNote Added: 0033547
2014-10-02 18:16David ColeNote Added: 0033555
2014-10-02 18:18David ColeNote Added: 0033556
2014-10-02 18:18David ColeStatusactive development => gerrit review
2014-10-05 15:17Cory QuammenNote Added: 0033587
2014-10-05 15:17Cory QuammenStatusgerrit review => closed
2014-10-05 15:17Cory QuammenResolutionopen => fixed
2014-10-05 15:17Cory QuammenFixed in Version => 6.2.0

Notes
(0002208)
eric kischell   
2005-03-21 10:35   
This access violation also occurs under VC++ 7.1 (.NET 2003).
vtkPolyDataMapper::GetInput() has 'NumberOfInputs' = 0 thus returning a NULL value.
(0027732)
Steve Robbins   
2011-11-25 01:08   
I ran into the same issue and fixed it with the attached patch (attached file "diff").
(0030909)
Jean-Christophe Fillion-Robin   
2013-06-05 15:24   
Does the problem still occur with VTK 5.10 ? VTK 6 ?

Would be great if you could submit a patch using Gerrit. For more details see http://www.vtk.org/Wiki/VTK/Git/Develop [^]

Thanks
Jc
(0030963)
Steve Robbins   
2013-06-05 23:23   
Jean-Christophe: it should be easy to answer your question simply by examining the history of the file Hybrid/vtkVRMLImporter.cxx to see whether it has been fixed.
(0033547)
David Cole   
2014-10-02 17:06   
Update: I have the crash fixed in a branch based on current master as of today...

Now I am tracking down two last memory leaks, and then I will have a patch for review. I'll update the bug here with a link to the patch when it's available.
(0033555)
David Cole   
2014-10-02 18:16   
// Code used to reproduce and fix the bug:
#include "vtkNew.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkSmartPointer.h"
#include "vtkVRMLImporter.h"


int main(int, char**)
{
  vtkNew<vtkRenderer> ren1;

  vtkNew<vtkRenderWindow> win1;
  win1->AddRenderer(ren1.GetPointer());

  vtkNew<vtkRenderWindowInteractor> iren1;
  iren1->SetRenderWindow(win1.GetPointer());
  iren1->Initialize();

  vtkNew<vtkVRMLImporter> importer;
  importer->SetFileName("f15j.wrl"); // or rafale.wrl
  importer->SetRenderWindow(win1.GetPointer());
  importer->Update();

  win1->Render();
  iren1->Start();

  return 0;
}
(0033556)
David Cole   
2014-10-02 18:18   
http://review.source.kitware.com/#/t/4791 [^]
(0033587)
Cory Quammen   
2014-10-05 15:17   
Fixed in

commit 8450ddd10ea5d645027b4d4db04e4e76631d792e
Author: David Cole <dcole@neocisinc.com>
Date: Sat Oct 4 16:28:14 2014 -0400

    vtkVRMLImporter: if non-NULL, delete CurrentTransform in destructor
    
    In normal usage, it will be deleted at ImportEnd time, but in cases
    where ImportEnd is never called, it needs to be deleted in the
    destructor, too, since it's unconditionally created with New in the
    constructor.
    
    Change-Id: I6747d7d8cf641cf3a7fe9fe03fae0716a49fe4a7