Skip to content
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

Bugcheck could happen when read-only database with non-zero linger is set to read-write mode [CORE5949] #6205

Closed
firebird-automations opened this issue Oct 24, 2018 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Basil A. Sidorov (basid)

Change access mode to security3.fdb.

Set read-only is success:
fbsvcmgr xnet://service_mgr action_properties prp_access_mode prp_am_readonly dbname security.db

Try return to read-write (fbsvcmgr xnet://service_mgr action_properties prp_access_mode prp_am_readwrite dbname security.db) - bugcheck in firebird.log:
Database: C:\PROGRAM FILES\FB\3.0.4\SECURITY3.FDB
internal Firebird consistency check (next transaction older than oldest active transaction (266), file: cch.cpp line: 4830)

After bugchek many operation will hang. F.e. connect to Firebir server on stop Firebird service.
Bug can exploit any user on server console, who knows sysdba password.

If set linger to zero (default is 60 for security3.db):
echo alter database drop linger | isql xnet://security.db
or
echo alter database drop linger | isql security.db
on initial setup for security3.db, then mode changed without bugcheck.

Commits: d7790dc

@firebird-automations
Copy link
Collaborator Author

Modified by: Basil A. Sidorov (basid)

security: Developers [ 10012 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The problem happens when read-only database with non-zero linger is set to read-write mode and
if some transactions was processed in read-only mode before database was shutdown.

1. Prepare some database (S:\TEMP\R.FDB in my case) and set linger to, say, 60 sec

2. set database to read-only mode
fbsvcmgr xnet://service_mgr action_properties prp_access_mode prp_am_readonly dbname S:\TEMP\R.FDB

3. run some transactions in database
isql xnet://S:\TEMP\R.FDB
show database;
// note, it reported "Transaction - Next" less than "Transaction - oldest snapshot"

4. set database to read-write mode
fbsvcmgr xnet://service_mgr action_properties prp_access_mode prp_am_readwrite dbname S:\TEMP\R.FDB

Bugcheck is logged at firebird.log at this poin

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

summary: security3.fdb and "internal Firebird consistency check" => Bugcheck could happen when read-only database with non-zero linger is set to read-write mode

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

v4 is not affected

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.5 [ 10885 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants