-
Notifications
You must be signed in to change notification settings - Fork 152
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 on Results.freeze after owning collection removal #6445
Fix crash on Results.freeze after owning collection removal #6445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, at least it mimics the current behaviour (although really weird), but I would not merge it without some review either from @finnschiermer or @jedelbo. But it also breaks a lot of tests, so something is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the fix works now
@kiburtse I have approved, but I think the changelog line should reflect that freeze() will no longer crash but throw. |
Well, as i've noted on the issue i believe this pr doesn't fully resolve the problem yet. Added tests here don't yet test the change in is_valid method itself, only missing 'validate_read()' call in freeze. I think tests need to be expanded at least. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
06d872f
to
35a3897
Compare
35a3897
to
32ea6a3
Compare
…tions + throw if results is constructed using a deleted object. (#6448) * fix Results::is_valid() * cope with stale accessor while freezing realm
…erent check order for collection attached. Test also Results on a table.
32ea6a3
to
efa87ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
So apparently ThreadSanitizer is not happy about something i have no idea about. Something is fishy with teardown code i guess:
|
It is possible there is a race in catch2 itself. See for example: catchorg/Catch2#1833 |
@@ -269,10 +269,12 @@ TEST_CASE("Freeze Results", "[freeze_results]") { | |||
REQUIRE(frozen_res.get<Int>(0) == 2); | |||
}); | |||
|
|||
/* FIXME causes ThreadSanitizer error in Catch2? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... This is what triggered ThreadSanitizer error it seems. And it was only reported in Jenkins TSAN builder (linux x64), and not on evergreen TSAN builder (clang x64). I've tried failing configuration locally, and it runs fine for me. Weird. I'll merge it for now with this thing disabled, and investigate it later. Also, probably with updating Catch2. The same codepath is essentially tested below (on added specific test), and it doesn't fail. Should be fine this way.
What, How & Why?
Fixes #6401
☑️ ToDos