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

[BugFix] BeamDyn nodal outputs occasionally segfaulted #996

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

andrew-platt
Copy link
Collaborator

Ready for merging

Feature or improvement description
BeamDyn would occasionally incur a segmentation fault when nodal outputs were requested. This appeared to happen only with certain Intel compiler version on Windows and was difficult to reproduce reliably. The root cause was the first entry in NdIndxInverse index lookup table not getting set (this index table is used to map the quadrature point node to the correct nodal output channel). Thus the first index value would be whatever was resident in that memory location and might be a value outside the range of the output nodes which would result in a segmentation fault.

For whatever reason, I could only reproduce this error with some Intel compiles on Windows. It did not show up on Linux or with the gcc compilers. Maybe this is due to different memory layout or previous stored values in the particular memory space (hard to tell without spending more time on the issue).

This issue only affected the indexing for the first node, so may in some instances have caused incorrect outputs for the first node nodal outputs to not match the root outputs.

Related issue, if one exists
Maybe related: #248
Noted in forum post: https://forums.nrel.gov/t/sending-rtaeropwr-via-servodyn-to-bladed-style-dll-controller/2043/14

Impacted areas of the software
BeamDyn node based outputs are the only bit of code affected.

The cause was an index that never got set.  So this could result in
attempting to retrieve a value from the output mapping array using an
out of bounds index (sometimes a very large negative number).  This
never appeared in gcc compiled versions, but occasionally would appear
in certain intel compiled versions (others initialized the value
apparently).
Copy link
Collaborator

@jjonkman jjonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the details of the code here, but uninitialized variables can certainly cause problems.

@andrew-platt andrew-platt merged commit 1f53061 into OpenFAST:dev Feb 10, 2022
@rafmudaf rafmudaf mentioned this pull request Mar 2, 2022
11 tasks
@andrew-platt andrew-platt deleted the b/BD_BldNdOuts branch June 30, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants