Skip to content

Fix potential deadlock when starting the encryption thread#8403

Merged
AlexPeshkoff merged 3 commits intoFirebirdSQL:masterfrom
MochalovAlexey:crypt_thread_deadlock
Jan 23, 2025
Merged

Fix potential deadlock when starting the encryption thread#8403
AlexPeshkoff merged 3 commits intoFirebirdSQL:masterfrom
MochalovAlexey:crypt_thread_deadlock

Conversation

@MochalovAlexey
Copy link
Copy Markdown
Contributor

@MochalovAlexey MochalovAlexey commented Jan 20, 2025

fixes #8402
add a check to verify thread matching between the encryption thread and the thread where we release the attachment. If they match, use a dummy mutex instead of the actual dbb_thread_mutex to avoid a deadlock

…nd the thread where we release the attachment. If they match, use a dummy mutex instead of the actual dbb_thread_mutex to avoid a deadlock
@MochalovAlexey MochalovAlexey changed the title Fix potential deadlock when starting the encryption thread (fixes #8402) Fix potential deadlock when starting the encryption thread Jan 20, 2025
@AlexPeshkoff AlexPeshkoff self-assigned this Jan 20, 2025
Comment thread src/jrd/CryptoManager.h
Comment thread src/jrd/jrd.cpp
@AlexPeshkoff AlexPeshkoff merged commit 7aac4d7 into FirebirdSQL:master Jan 23, 2025
@MochalovAlexey MochalovAlexey deleted the crypt_thread_deadlock branch January 24, 2025 06:21
dyemanov pushed a commit that referenced this pull request Jan 27, 2025
* add a check to verify thread matching between the encryption thread and the thread where we release the attachment. If they match, use a dummy mutex instead of the actual dbb_thread_mutex to avoid a deadlock

* fix Windows build by introducing a method to retrieve thread id from crypto thread handle

* rename the crypt process thread id variable to its actual purpose as handle

---------

Co-authored-by: aleksey.mochalov <[email protected]>
dyemanov pushed a commit that referenced this pull request Jan 27, 2025
* add a check to verify thread matching between the encryption thread and the thread where we release the attachment. If they match, use a dummy mutex instead of the actual dbb_thread_mutex to avoid a deadlock

* fix Windows build by introducing a method to retrieve thread id from crypto thread handle

* rename the crypt process thread id variable to its actual purpose as handle

---------

Co-authored-by: aleksey.mochalov <[email protected]>
MochalovAlexey pushed a commit to MochalovAlexey/firebird that referenced this pull request Jan 27, 2025
…QL#8403) B3_0_Release backport

add a check to verify thread matching between the encryption thread and the thread where we release the attachment. If they match, use a dummy mutex instead of the actual dbb_thread_mutex to avoid a deadlock
dyemanov pushed a commit that referenced this pull request Jan 28, 2025
…_0_Release backport (#8412)

add a check to verify thread matching between the encryption thread and the thread where we release the attachment. If they match, use a dummy mutex instead of the actual dbb_thread_mutex to avoid a deadlock

Co-authored-by: aleksey.mochalov <[email protected]>
dyemanov added a commit that referenced this pull request Mar 12, 2025
…ad_t) conversions that does not work properly (it mangles the value on my Linux box, causing deadlocks in exactly the same place that was fixed by PR #8403)
dyemanov added a commit that referenced this pull request Mar 13, 2025
…ad_t) conversions that does not work properly (it mangles the value on my Linux box, causing deadlocks in exactly the same place that was fixed by PR #8403)
dyemanov added a commit that referenced this pull request Mar 13, 2025
…ad_t) conversions that does not work properly (it mangles the value on my Linux box, causing deadlocks in exactly the same place that was fixed by PR #8403)
@mrotteveel mrotteveel added the rlsnotes60: no Intentionally not added to the Firebird 6.0 release notes. label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential deadlock when starting the encryption thread

7 participants