VisItBridge GMVReader and GMVReader plugin: incorrect handling of invalid GMV files
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
ParaView git/master, builtin mode
Attached are two (invalid) GMV input files with identical data, stored once in ASCII and binary form, with the exemplary flaw that they define 20 nodes and a point data array named "pressure" which should have length 20, too, but has merely length 0.
-
binary format: VisItBridge-GMVReader and GMVReader plugin are caught in an endless loop while parsing the attached file in binary GMV format, "variable.definition.too.short.binary.gmv", while the following line keeps getting printed on stdout:
I/O error while reading gmv input file.
In fact, both readers get stuck for any (invalid) binary GMV input file where
- an AMR grid's node definition or
- a polygonal mesh definition or
- a polyhedral cell definition or
- a point or cell data array is shorter than it is expected to be.
- ASCII format: When importing the same data in ASCII format from "variable.definition.too.short.ascii.gmv", both VisItBridge-GMVReader and GMVReader plugin fail to detect that the point data array named "pressure" has invalid length 0 instead of the supposed 20. Given that the malloc'd memory does not get initialised, the data array imported into ParaView contains random values as a result.
Same issue when importing a polygonal mesh with an incomplete set of point coordinates ("polygonal.mesh.definition.too.short.ascii.gmv"): The missing coordinate values are completed using uninitialised memory.
VisIt 2.6.1 correctly detects the invalid files.
Patches attached to resolve the issue.