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
Engine may hang due to races when starting crypt thread and simultaneous shutdown [CORE6360] #6601
Comments
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Modified by: @AlexPeshkoffreporter: Alexander Peshkov [ alexpeshkoff ] => Artyom Smirnov [ artyom.smirnov ] |
Modified by: @AlexPeshkoff |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 RC 1 [ 10930 ] Fix Version: 3.0.7 [ 10940 ] |
Commented by: @artyom-smirnov Another issue related to CryptoManager. It less disruptive issue and hardly to achieve. Looks like sometime CryptoManager::cryptThread calling PAG_attachment_id(tempDbb) but it never released. Can be reproduced same script as above. It causing assertion in debug mode. BackupManager::localStateLock::lockCounter > 0 Assertion (lockCounter.value() == 0) failure: /workspace/rdb/firebird_3_0/src/jrd/../jrd/../jrd/../common/classes/rwlock.h 233 Backtrace: #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 |
Submitted by: @artyom-smirnov
Relate to CORE6338
When CM thread starting it assigns its internal attachment flag "ATT_crypt_thread", but on short connection this attachment and shutdown racing and flag may be never assigned therefore attachment and CM thread can not properly stopped causing server hang.
Reproducing:
#!/bin/bash
set -e
echo Auto = y > plugins/DbCrypt_example.conf
rm tmp.fdb
echo "create database 'tmp.fdb';" | bin/isql -u sysdba -p masterkey
while true; do
cp tmp.fdb repro.fdb; echo 'alter database encrypt with "DbCrypt_example";'| bin/isql -u sysdba -p masterkey repro.fdb
done
Commits: bcd6ca8 ebddc8f
The text was updated successfully, but these errors were encountered: