FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0069 — NetStructureABAQUS opens the input directory instead of the file and indexes the parsed tokens and parts unchecked (Windows only)
ID 0069
Class BUG
Severity 3
Status ready
Models Net/NetStructureABAQUS
Found 2026-09-25, independent review of the MARE-0005 documentation (a1e7260)

The class compiles only when WIN32 is defined (src/net/CMakeLists.txt:8), so none of this can be built or tested on Linux; see MARE-0031.

Evidence

(1) src/net/Test/NetStructureSpecABAQUS.cpp:17-23 builds and checks fullPath, then passes the directory:

std::filesystem::path fullPath(filePath);
fullPath /= fileName;
...
ReadAbaqusInputFile(filePath);

(2) GetABAQUSPart (src/net/Test/NetStructureSpecABAQUS.h:51) returns m_parts[partNr] with no bounds check, and NetStructureABAQUS.cpp:20 calls it with 0 unconditionally, so an input file with no part (or the directory of (1)) indexes an empty container.

(3) NetStructureSpecABAQUS.cpp:217:

} else if (!(tokens.size() > 1) && (tokens[1] == "LOADS")) {

reads tokens[1] exactly when there is at most one token. :219 reads tokens[1] when there may be only one token too.

Effect

The class cannot read any ABAQUS file as written: it opens the directory, finds no part, and reads out of bounds. With (1) fixed, a malformed file or a one-token line still gives undefined behaviour instead of an error.

Possible fix

(1) ReadAbaqusInputFile(fullPath.string()). (2) Report an error when m_parts is empty. (3) tokens.size() > 1 && tokens[1] == "LOADS" (the intended test), and the same size check at :219.

Test that would prove it

On Windows, load a minimal ABAQUS file with one part and check the node count. See MARE-0031.

Risk

None for valid input: today no valid input can be read.