Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Tecplot reader #19983

Open
JustinPrivitera opened this issue Oct 30, 2024 Discussed in #19968 · 0 comments
Open

Bug in Tecplot reader #19983

JustinPrivitera opened this issue Oct 30, 2024 Discussed in #19968 · 0 comments

Comments

@JustinPrivitera
Copy link
Member

Discussed in #19968

Originally posted by celynchgt1 October 29, 2024
I believe I have found a bug in VisIt's Tecplot reader. I have an unstructured grid of 407^3 cells, for a total of about 67.4 million cells. When I try to read that into VisIt, I get an error in my terminal saying:

terminate called after throwing an instance of 'std::bad_array_new_length'
what():  std::bad_array_new_length

With 406^3 cells (about 66.9 million), I can read the grid in successfully and make plots. I believe the bug is on line 1839 of src/databases/Tecplot/TecplotFile.C. The zone connectivity size is stored in a long long there, but the right hand side of that expression is calculated as an int, potentially leading to an overflow. In my case, the Tecplot file uses the FEBRICK connectivity format, so all cells have 8 nodes. So numElements * nodesPerElem * sizeof(int) is numElements * 8 * 4, which will overflow an int when numElements > 67108863.

Since the data files required to debug this are rather large (about 3 GB), I've attached code for a program that will generate them.
makeTestFile_cpp.txt
Use it like so:

g++ -O2 -Wall makeTestFile.cpp -o makeTestFile
./makeTestFile 407 good407.plt
./makeTestFile 408 bad408.plt

I tested this with VisIt 3.4.1, installed from the rockylinux8 asset on Github. However, I originally found this bug in ParaView 5.13.0, which reads binary Tecplot files via the VisItBridge. The error message coming out of ParaView is:

ERROR: In vtkAvtSTMDFileFormatAlgorithm.cxx, line 550
vtkVisItTecplotBinaryReader (0x626c1f0): VisIt Exception caught.

The problematic data files can be used successfully in Tecplot itself, so I believe the underlying data is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant