View Issue Details

IDProjectCategoryView StatusLast Update
0002442Slicer4Core: Base Codepublic2014-03-06 06:09
Reporterslisse Assigned Tosankhesh  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.1.0 RC 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0002442: Corrupted memory (double free?) when attempting to load an .stl file
Description

Slicer developers,

  I wanted to notify you of a memory error that I'm getting when running Slicer4.  

Here's the background info:
My machine is Ubuntu 12.04 64-bit Linux ("Linux slisse-G75VW 3.2.0-29-generic 0000046-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux).

 I'm working from the nightly build which I git-pulled and remade this AM (with the usual make -k workaround).  I have slightly modified one of the vtkSTLReader.cxx to catch a SIGABRT which was probably related to the below, but otherwise am pretty close to stock code.

Here's how I reproduce my crash:
1) Start Slicer4 (in DDD).  
2) Choose "Load Data", select the attached STL file (040 sacrum .stl).  Click "OK".  
3) The following memory error appears when loading (specifically, usually when at 99% of loading, seems like it might be relate to the fclose(p) on line 171 of vtkSTLReader.cxx).

Please let me know if any additional information is needed and I can provide it.

Additional Information

DDD Trace:

glibc detected /home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/SlicerApp-real: double free or corruption (!prev): 0x0000000001436bb0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7e626)[0x7ffff47ea626]
/lib/x86_64-linux-gnu/libc.so.6(fclose+0x155)[0x7ffff47da2a5]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkIO.so.5.10(ZN12vtkSTLReader11RequestDataEP14vtkInformationPP20vtkInformationVectorS3+0x712)[0x7fffeb4d4430]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(ZN20vtkPolyDataAlgorithm14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3+0x5e)[0x7ffff355456e]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(ZN12vtkExecutive13CallAlgorithmEP14vtkInformationiPP20vtkInformationVectorS3+0x87)[0x7ffff33dad75]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(ZN23vtkDemandDrivenPipeline11ExecuteDataEP14vtkInformationPP20vtkInformationVectorS3+0x6f)[0x7ffff33c35b3]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(ZN23vtkDemandDrivenPipeline14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3+0x517)[0x7ffff33c2c71]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(ZN32vtkStreamingDemandDrivenPipeline14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3+0x714)[0x7ffff35daf20]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(_ZN23vtkDemandDrivenPipeline10UpdateDataEi+0x2d8)[0x7ffff33c337a]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(_ZN32vtkStreamingDemandDrivenPipeline6UpdateEi+0xd6)[0x7ffff35db13e]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(_ZN12vtkExecutive6UpdateEv+0x43)[0x7ffff33d9019]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(_ZN23vtkDemandDrivenPipeline6UpdateEv+0x18)[0x7ffff33c2d0c]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(_ZN32vtkStreamingDemandDrivenPipeline6UpdateEv+0x18)[0x7ffff35db066]
/home/slisse/working/external_software/Slicer4_binary/VTK-build/bin/libvtkFiltering.so.5.10(_ZN12vtkAlgorithm6UpdateEv+0x2a)[0x7ffff3340f68]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libMRMLCore.so(_ZN23vtkMRMLModelStorageNode16ReadDataInternalEP11vtkMRMLNode+0xf02)[0x7ffff3bffbc2]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libMRMLCore.so(_ZN18vtkMRMLStorageNode8ReadDataEP11vtkMRMLNodeb+0x70e)[0x7ffff3d059b2]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/lib/Slicer-4.1/qt-loadable-modules/libvtkSlicerModelsModuleLogic.so(_ZN20vtkSlicerModelsLogic8AddModelEPKc+0xa6c)[0x7fffbb570620]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/lib/Slicer-4.1/qt-loadable-modules/libqSlicerModelsModule.so(_ZN15qSlicerModelsIO4loadERK4QMapI7QString8QVariantE+0x1a6)[0x7fffa8382738]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libqSlicerBaseQTCore.so(_ZN20qSlicerCoreIOManager9loadNodesERK7QStringRK4QMapIS0_8QVariantEP13vtkCollection+0x733)[0x7ffff64915e1]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libqSlicerBaseQTGUI.so(_ZN16qSlicerIOManager9loadNodesERK7QStringRK4QMapIS0_8QVariantEP13vtkCollection+0x152)[0x7ffff7262a7a]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libqSlicerBaseQTGUI.so(_ZN16qSlicerIOManager9loadNodesERK5QListI4QMapI7QString8QVariantEEP13vtkCollection+0x12b)[0x7ffff7262c3d]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libqSlicerBaseQTGUI.so(_ZN17qSlicerDataDialog4execERK4QMapI7QString8QVariantE+0x316)[0x7ffff7255696]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libqSlicerBaseQTGUI.so(_ZN16qSlicerIOManager10openDialogE7QStringN17qSlicerFileDialog8IOActionE4QMapIS0_8QVariantE+0x268)[0x7ffff726204e]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/bin/libqSlicerApp.so(_ZN16qSlicerIOManager17openAddDataDialogEv+0x57)[0x7ffff7b66555]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/lib/Slicer-4.1/qt-loadable-modules/libqSlicerWelcomeModule.so(_ZN26qSlicerWelcomeModuleWidget16loadNonDicomDataEv+0x46)[0x7fff61e7fa24]
/home/slisse/working/external_software/Slicer4_binary/Slicer-build/lib/Slicer-4.1/qt-loadable-modules/libqSlicerWelcomeModule.so(+0x1278f)[0x7fff61e8478f]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(_ZN11QMetaObject8activateEP7QObjectPKS_iPPv+0x2b1)[0x7ffff51ce281]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(_ZN15QAbstractButton7clickedEb+0x32)[0x7ffff5d6cc72]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x599a4e)[0x7ffff5aaaa4e]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x59ad8b)[0x7ffff5aabd8b]
/usr/lib/x86_64-linu

TagsNo tags attached.

Activities

2012-08-28 12:43

 

OPII044_Sacrum_Model_Ax.stl (2,259,458 bytes)

2012-08-28 12:45

 

cxx_diffs.txt (1,210 bytes)
cxx_diffs.txt (1,210 bytes)
slisse

slisse

2012-08-28 12:46

reporter   ~0005840

Just in case, I've uploaded the diffs from my vtkSTLReader.cxx file (it's some simple signal debugging stuff and not worth merging into the tree, IMO).

pieper

pieper

2012-08-29 07:32

administrator   ~0005852

Hi -

Thanks for providing the data and info. I wasn't able to replicate this issue - I tested on a mac in xcode with extra memory debugging turned on but the model loaded okay.

Can you try with a slicer nightly and/or release build to see if it also crashes on your machine with this data?

-Steve

slisse

slisse

2012-08-29 08:23

reporter   ~0005854

I'll download a premade build and see whether it reproduces the problem. Thanks,
Sean

slisse

slisse

2012-08-29 08:39

reporter   ~0005855

Confirmed, it also crashes on premade "4.1.0-2012-08-28-linux-amd64", with the above steps.

pieper

pieper

2012-08-29 10:13

administrator   ~0005857

This is an odd one - I don't get any errors on windows or mac, but do see a consistent crash on linux (tested Ubuntu 11.04).

The crash occurs in vtkSTLReader and I can replicate this in pure vtk by instantiating the reader and trying to read the attached file using the vtkpython interpreter in slicer superbuild.

@Jcfr - can you try on your machine ? The file seems well formed.

sankhesh

sankhesh

2012-09-12 07:19

developer   ~0006042

This issue is fixed in the development version of VTK. http://paraview.org/Bug/view.php?id=13101

Confirmed this by building with the current VTK development HEAD and reading in the attached file.

jcfr

jcfr

2012-09-13 11:20

administrator   ~0006062

As discussed this morning, would be great if you could cherry-pick and integrate commit(s) into Slicer fork.

See also here for commit message guideline regarding the corresponding commit into Slicer itself. See http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Style_Guide#Importing_changes_from_external_project.2Frepository

Thanks
Jc

sankhesh

sankhesh

2012-09-14 04:27

developer   ~0006068

Topic pushed to https://github.com/sankhesh/Slicer/tree/2442-vtkSTLReader-corrupted-memory

jcfr

jcfr

2012-09-14 08:37

administrator   ~0006070

Last edited: 2012-09-14 08:38

Looks good to me. Thanks
The change in VTK is fairly minimal, I suggest you go ahead and integrate into Slicer. Do you anticipate any side effect ?

sankhesh

sankhesh

2012-09-14 09:46

developer   ~0006074

Its in. I don't think this would break anything.

jcfr

jcfr

2012-09-14 09:57

administrator   ~0006075

Thanks Sankhesh.

Sean> Make sure to close issue if you confirm that the issue is fixed.

slisse

slisse

2012-09-17 09:25

reporter   ~0006111

Success! Thank you, developers!

Issue History

Date Modified Username Field Change
2012-08-28 12:43 slisse New Issue
2012-08-28 12:43 slisse Status new => assigned
2012-08-28 12:43 slisse Assigned To => pieper
2012-08-28 12:43 slisse File Added: OPII044_Sacrum_Model_Ax.stl
2012-08-28 12:45 slisse File Added: cxx_diffs.txt
2012-08-28 12:46 slisse Note Added: 0005840
2012-08-29 07:32 pieper Note Added: 0005852
2012-08-29 08:23 slisse Note Added: 0005854
2012-08-29 08:39 slisse Note Added: 0005855
2012-08-29 10:10 pieper Assigned To pieper => jcfr
2012-08-29 10:13 pieper Note Added: 0005857
2012-08-29 13:36 jcfr Assigned To jcfr => sankhesh
2012-08-29 13:36 jcfr Target Version => Slicer 4.3.0
2012-09-12 07:19 sankhesh Note Added: 0006042
2012-09-13 11:20 jcfr Note Added: 0006062
2012-09-14 04:27 sankhesh Note Added: 0006068
2012-09-14 08:37 jcfr Note Added: 0006070
2012-09-14 08:38 jcfr Note Edited: 0006070
2012-09-14 09:46 sankhesh Note Added: 0006074
2012-09-14 09:46 sankhesh Status assigned => resolved
2012-09-14 09:46 sankhesh Resolution open => fixed
2012-09-14 09:55 jcfr Target Version Slicer 4.3.0 => Slicer 4.2.0 - coming release
2012-09-14 09:57 jcfr Note Added: 0006075
2012-09-17 09:25 slisse Note Added: 0006111
2012-09-17 09:25 slisse Status resolved => closed
2014-03-06 06:09 jcfr Fixed in Version => Slicer 4.2.0