-
Notifications
You must be signed in to change notification settings - Fork 85
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
Issue 5984 - Crash when paged result search are abandoned #5985
Merged
Conversation
This file contains 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
Problem: Fix 389ds#4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by:
tbordaz
reviewed
Nov 17, 2023
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.
The overall fix looks good to me.
I added few comments/questions to clarify my understanding.
tbordaz
approved these changes
Nov 17, 2023
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.
The C code looks good to me
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 17, 2023
* Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks !
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Nov 21, 2023
Chasing several rabbits at the same time is a bad idea ! and I mixed branches and unwillingly pushed one commit for #5980 in #5984 just before the PR #5985 merge ! -:( Hopefully it does not break anything but just logs some useless crap if instance fails to starts. Anyway This commit reverts the change about __init.py and also do a minor code cleanup (removed a trailing space) in abandon.c Issue #5984 Reviewed by: @tbordaz Thanks ! (cherry picked from commit df7dd83)
progier389
added a commit
that referenced
this pull request
Dec 13, 2023
#5985 and #5987) Notice: This cherry-pick include two commit: df7dd83 Issue 5984 - Crash when paged result search are abandoned - fix2 (#5987) 06bd086 Issue 5984 - Crash when paged result search are abandoned (#5985) The reason is that cherry pick of #5985 generates lots of conflict in __init.py and #5987 only revert that file ==> So it is easier and safer to keep the original file. * Issue 5984 - Crash when paged result search are abandoned Problem: Fix #4551 has changed the lock that protects the paged result data within a connection. But the abandon operation attempts to free the paged search result with the connection lock. This leads to race condition and double free causing an heap corruption and a SIGSEGV. Solution: - Get a copy of the operation data that needs to be logged. - Unlock the connection mutex (to avoid deadlock risk) - Free the paged result while holding the paged result lock. Issue: 5984 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit 06bd086)
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.
Problem:
Fix #4551 has changed the lock that protects the paged result data
within a connection. But the abandon operation attempts to free
the paged search result with the connection lock.
This leads to race condition and double free causing an heap
corruption and a SIGSEGV.
Solution:
Issue: 5984
Reviewed by: @tbordaz (Thanks!)