Fix: smart memory managing against memory corruption when tests shuffle#86
Closed
metaq3 wants to merge 1 commit into
Closed
Fix: smart memory managing against memory corruption when tests shuffle#86metaq3 wants to merge 1 commit into
metaq3 wants to merge 1 commit into
Conversation
Some tests are divided into groups that share same memory chunk. They rely on it and assume it's never touched by other tests. Catch2 may shuffle tests from different groups with each other to ensure they're state independent. This causes them to corrupt memory of each other. It was fixed with memory forks. Each test group contains own fork of zone memory, and this fork is activated every time test needs one.
2586a2f to
67b1b52
Compare
Contributor
Author
|
I missed point in the PR description, but for the record: yes, I have googled some way of turning off shuffles within the test group, but found nothing. Seems that Catch2 is incapable of such a thing. |
Owner
|
Thank you! |
Contributor
Author
|
I fixed tests for MinGW in #85. This PR has no need now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
READ THIS! Before you merge and even read all of stuff I wrote below, please, take a note about much, much easier solution. You could just provide
--order declarg to the test binary. If you don't wan't to use Catch2 features and ensuring your tests are state-independent is not important for you, consider using this instead of my PR.Some tests are divided into groups that share same memory chunk. They rely on it and assume it's never touched by other tests. But Catch2 may shuffle tests from different groups with each other to ensure they're state independent. This causes them to corrupt memory of each other.
It was fixed with memory forks. Each test group contains own fork of zone memory, and this fork is activated every time test needs group's one. Forks are not freed until all test finish, though.