-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
memtx: fix 'use after free' of garbage collected MVCC stories #7466
memtx: fix 'use after free' of garbage collected MVCC stories #7466
Conversation
fab326e
to
f01bf2f
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.
Please, make the lines of the commit messages shorter, and see my comment about the test. Otherwise, it's OK.
test/box-luatest/gh_7449_tuple_is_dirty_assertion_on_replace_test.lua
Outdated
Show resolved
Hide resolved
f01bf2f
to
45e900f
Compare
@drewdzzz fixed commit subject length, opened a corresponding issue (tarantool/checkpatch#29). |
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.
It won't work if we rework GC as we discussed f2f.
45e900f
to
9d6d08a
Compare
9353c18
to
d166e45
Compare
d166e45
to
4745224
Compare
src/box/memtx_tx.c
Outdated
@@ -2992,7 +3003,7 @@ memtx_tx_snapshot_clarify_slow(struct memtx_tx_snapshot_cleaner *cleaner, | |||
assert(entry->from == tuple); | |||
tuple = entry->to; | |||
} | |||
|
|||
memtx_tx_story_gc(); |
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.
Snapshot cleaner must not collect garbage at least because it may be run from different thread.
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.
Sorry, I didn't bear that in mind, removed it.
I added it just for the sake of more often garbage collection.
36e3e1a
to
2e77c99
Compare
`directly_replaced` stories can potentially get garbage collected in `memtx_tx_handle_gap_write`, which is unexpected and leads to 'use after free': in order to fix this, limit garbage collection points only to external API calls. Wrap all possible garbage collection points with explicit warnings (see c9981a5). Closes tarantool#7449 NO_DOC=bugfix
2e77c99
to
ba16861
Compare
directly_replaced
stories can potentially get garbage collected inmemtx_tx_handle_gap_write
, which is unexpected and leads to 'use afterfree': in order to fix this, limit garbage collection points only to
external API calls.
Wrap all possible garbage collection points with explicit warnings (see
c9981a5).
Closes #7449