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

Fix crash in MAP_End when using Intel's new icx compiler and disable caching in setup-python GH action #2173

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

deslaughter
Copy link
Collaborator

This pull request is ready to be merged.

Feature or improvement description
This PR provides two fixes:

  1. Fixes a crash in MAP during module shutdown (MAP_End) caused by double freeing memory related to strings. This crash only occurred when using the new Intel icx compiler.
  2. Adjusting the settings in the setup-python Github Action to disable caching of Python modules. This should fix the issue where regression tests fail because setup-python can't find requirements.txt.

Related issue, if one exists
PR #2129 was a previous attempt to fix the issue with setup-python and the regression tests which didn't succeed.

Impacted areas of the software

  • MAP
  • Github Actions

Additional supporting information
The issue with MAP trying to free the memory twice looks like it has been around since the module was added. The problem stemmed from several nodes being added to the OutputList by directly copying the data. These nodes contained pointers to strings which were allocated. These pointers were shared with nodes in other lists which were freed earlier in MAP_End. When the OutputList nodes were freed, the code tried to free the same pointers again, resulting in a crash. The issue was resolved by creating new nodes in OutputList with a copy of the data instead of reusing the existing pointers. The amount of data copied is very small so this was a simpler solution than trying to track the pointer usage.

This fix will need to be migrated to the other branches once approved.

The new icx compiler is a bit smarter about checking for memory errors and a new one was discovered which causes OpenFAST to crap when calling MAP_End. The error is due to the OutputList nodes containing pointers to memory which has already been freed. This is due to the way the OutputList is constructed where nodes from other lists (containing pointers to string memory) were appended without allocating new memory. So when the original list was freed, these pointers became invalid, but then the OutputList tried to free them again, resulting in a double free error. To fix this issue, set_output_list was changed to allocate new memory for copies of these nodes.
Copy link
Collaborator

@andrew-platt andrew-platt left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@andrew-platt andrew-platt merged commit 2510bc2 into OpenFAST:rc-3.5.4 Apr 24, 2024
19 checks passed
@deslaughter deslaughter deleted the b/MAP_free_outlist_crash branch September 4, 2024 20:42
@andrew-platt andrew-platt mentioned this pull request Oct 21, 2024
28 tasks
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