[vtk-developers] [VTK 0013294]: string arrays may cause vtkXMLUnstructuredGridWriter to produce corrupt vtu-files, which are unreadable or cause crash

Mantis Bug Tracker mantis at public.kitware.com
Wed Jul 4 11:39:12 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13294 
====================================================================== 
Reported By:                klaus triendl
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13294
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   high
Status:                     backlog
Project:                    Release 
Type:                       crash 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-07-04 11:39 EDT
Last Modified:              2012-07-04 11:39 EDT
====================================================================== 
Summary:                    string arrays may cause vtkXMLUnstructuredGridWriter
to produce corrupt vtu-files, which are unreadable or cause crash
Description: 
When a string array is appended to the cell data of an unstructured grid,
vtkXMLUnstructuredGridWriter may produce a corrupt vtu-file, depending on how
long the strings are. I cannot tell at what length the issue shows up, but the
longer the strings the sooner it happens.
Even very simple models with just 304 cells can be affected. It doesn't matter
whether the cell data is compressed or not and whether the data is binary or
appended. Only ascii works.

Please see attached zip file, which contains:
* a test cpp file displaying how I produce the vtu-files
* a test msvc2010 project
* the source and resulting vtu files

Notes worth to be mentioned:
* When loading the compressed vtu-files the following error is reported:
<error>
- ERROR: In ..\..\..\..\src\VTK\IO\vtkZLibDataCompressor.cxx, line 83
vtkZLibDataCompressor (00000000139D63E0): Decompression produced incorrect size.
Expected 27728 and got 27529


ERROR: In ..\..\..\..\src\VTK\IO\vtkXMLDataReader.cxx, line 545
vtkXMLUnstructuredGridReader (000000000B2F7ED0): Cannot read cell data array
"strings" from PointData in piece 0.  The data array in the element may be too
short.
</error>
* when loading the uncompressed vtu-files then the reading application crashes
in the template function
vtkXMLDataReaderReadArrayValues<vtkArrayIteratorTemplate<vtkStdString>>


I detected the issue already in version 5.8.0, it's still active in 5.10.0 and
in 6.0 (git #02aef09).
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-07-04 11:39 klaus triendl  New Issue                                    
2012-07-04 11:39 klaus triendl  File Added: vtk-xmlwriter-bug.zip               
    
======================================================================




More information about the vtk-developers mailing list