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 for crash when concurrent calls are made to find normalized fold #18

Conversation

mlwelles
Copy link
Contributor

@mlwelles mlwelles commented Oct 4, 2020

Hi, found it was possible to reliably cause panics when there are concurrent calls to FindNormalizedFold() (and I think FindNormazlied(), too) that use the same slice as a target.

Added a test to reproduce and fixed by changing the transformers from being package vars that are reused to being functions that return new instances on each use.

To reproduce the crash, you can run the test in the current release, or change normalizeTransformer() and normalizedFoldTransformer() in this PR to return an package var where the results from the Transform.Chain calls they wrap have been assigned.

@mlwelles mlwelles force-pushed the bugfix/concurrent-find-normalized-fold-panic branch from d025b9e to 5ef9091 Compare October 4, 2020 03:25
@lithammer
Copy link
Owner

Nice find. And thanks for contributing a fix to boot!

@lithammer lithammer merged commit 4762799 into lithammer:master Oct 4, 2020
@lithammer
Copy link
Owner

Tagged a v1.1.1 release with your fix.

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

Successfully merging this pull request may close these issues.

2 participants