MantisBT - VTK
View Issue Details
0013676VTK(No Category)public2012-11-25 07:072013-10-22 10:22
David Doria 
Dan Lipsa 
normalminoralways
closedfixed 
6.0.0 
6.0.1 
TBD
crash
0013676: vtkLightActor crashes if the light is not positional
In the following demo, if

light->SetPositional(true);

is not called, the program crashes. With the above line, it does not crash and displays the light correctly.

#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkLightActor.h>
#include <vtkLight.h>
#include <vtkSmartPointer.h>
#include <vtkRenderWindowInteractor.h>

int main()
{
  vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();

  // Display where the light is
  vtkSmartPointer<vtkLight> light = vtkSmartPointer<vtkLight>::New();
// light->SetPositional(true); // without this line, the program crashes
  vtkSmartPointer<vtkLightActor> lightActor = vtkSmartPointer<vtkLightActor>::New();
  lightActor->SetLight(light);
  renderer->AddViewProp(lightActor);

  vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
  renderWindow->AddRenderer(renderer);

  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
      vtkSmartPointer<vtkRenderWindowInteractor>::New();
  renderWindowInteractor->SetRenderWindow(renderWindow);

  renderWindow->Render();
  renderWindowInteractor->Start();

}
build vtk 6.1 with standard options
use this cmakelists

cmake_minimum_required(VERSION 2.8.7)
project(vtkApplication)
find_package(VTK 6.1 REQUIRED NO_MODULE)
include(${VTK_USE_FILE})
add_executable(bug bug.cxx)
target_link_libraries(bug ${VTK_LIBRARIES})

compile and run, will segfault, change to positional, compile and run, works fine
No tags attached.
Issue History
2012-11-25 07:07David DoriaNew Issue
2013-06-24 21:55Dave DeMarleReproducibilityhave not tried => always
2013-06-24 21:55Dave DeMarleStatusbacklog => todo
2013-06-24 21:55Dave DeMarleProduct Version => 6.0.0
2013-06-24 21:55Dave DeMarleTarget Version => 6.0.1
2013-06-24 21:55Dave DeMarleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=620#r620
2013-07-22 20:07Dave DeMarleStatustodo => backlog
2013-10-15 13:02Dave DeMarleAssigned To => Dan Lipsa
2013-10-15 13:02Dave DeMarleStatusbacklog => tabled
2013-10-18 13:28Dave DeMarleStatustabled => backlog
2013-10-18 13:47Dan LipsaStatusbacklog => closed
2013-10-22 10:12Dan LipsaStatusclosed => backlog
2013-10-22 10:12Dan LipsaResolutionopen => reopened
2013-10-22 10:22Dan LipsaStatusbacklog => closed
2013-10-22 10:22Dan LipsaResolutionreopened => fixed

There are no notes attached to this issue.