openfast
openfast copied to clipboard
Incorrect error handling causes seg-fault in MAP with incorrect node keyword
Bug description
In MAP, the keyword fix
in the node list is used to denote an anchor node of a line (the only allowed keywords are fix
, connect
, and vessel
). Any other word should result in an error reported to OpenFAST, not a segmentation fault. This appears to be a bug in the error handling in the set_node_list
routine in mapinit.c
To Reproduce
- Use any release of OpenFAST (v3.2.0 was used for testing, v3.1.0
- Run a regression test that includes MAP (
5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti
was used in testing), but change the keywordfix
in the MAP input file node list section tofixed
. - The resulting error occurs (note there is no indication that this is in MAP):
Likely cause (or at least where to start)
In the set_node_list
subroutine in mapinit.c
, an incorrect keyword should be caught by line 1936 and a message passed out to OpenFAST with graceful termination of MAP. It may be that the subroutine is continuing and trying to access a pointer that should have been set in that logic block, but is left unassociated (maybe we need to exit that routine earlier if there is a bad keyword).
OpenFAST Version Looking at the source code history, this bug dates back to at least OpenFAST v2.0.0, if not earlier.
Other info
This was discovered when the word fixed
is used instead of fixed
. This is a very easy mistake to make since MAP and MoorDyn look very similar and MoorDyn uses fixed
to denote an anchor point. To help eliminate this potential issue, we should add the word fixed
into the keyword checking for the node list section parsing in MAP. This will be remedied in a following PR.
@andrew-platt I want to confirm that #1186 does not fix this issue. The issue here is the incorrect error handling in mapinit. Is that right?
@rafmudaf, that is correct. #1186 does not resolve the seg-fault.