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

FB craches with "invalid lock id (NNNNN)" [CORE4185] #4511

Closed
firebird-automations opened this issue Aug 20, 2013 · 14 comments
Closed

FB craches with "invalid lock id (NNNNN)" [CORE4185] #4511

firebird-automations opened this issue Aug 20, 2013 · 14 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
core_firebird_log_+_LT_rawdump.rar

Scenario:

1. Database with table TLOCK(id int, f01 int) and single record in it (e.g ID=1, F01=100).

2. Machine #⁠1.
Connect to this database via TCP and do:
SELECT * FROM TLOCK WHERE ID=1;
UPDATE TLOCK SET F01=RAND()*10000 WHERE ID=1;
SELECT * FROM TLOCK WHERE ID=1;

3. Machine #⁠2.
Run batch (or shell) that:
3.1. Opens simultaneously N test ISQLs (I've reproduced result on at least N=10) which all should just stay quiet in "SQL>" prompt after being loaded;
3.2. Waits ~10 seconds to insure that all ISQLs do establishe connect to the database;
3.3. Runs the utility from SysInternals package to kill all ISQL processes: PSKILL.EXE ISQL;
3.4. Waits again ~10 seconds to insure that all test windows and processes are killed;
3.5. Loop to step 3.1

After some (short) time the Firebird daemon will craches with producing core file, LockTable dump and the following message in it's log:
---------------
vmoel63.local Tue Aug 20 13:37:35 2013
Fatal lock manager error: invalid lock id (143960), errno: 0

vmoel63.local Tue Aug 20 13:37:59 2013
/opt/fb30cs/bin/fbguard: /opt/fb30cs/bin/firebird terminated abnormally (-1)

vmoel63.local Tue Aug 20 13:37:59 2013
/opt/fb30cs/bin/fbguard: guardian starting /opt/fb30cs/bin/firebird
--------------

Commits: edd2f69 40bacdd d2b7575 ee0be48 FirebirdSQL/fbt-repository@ee0fee1 FirebirdSQL/fbt-repository@90f65e7 FirebirdSQL/fbt-repository@59d0569 FirebirdSQL/fbt-repository@5c72735

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

core, raw dump of LT and firebirrd.log sample see in attach.

PS-1.
SQL> show version;
ISQL Version: WI-V2.5.3.26661 Firebird 2.5
Server version:
Firebird/linux AMD64 (access method), version "LI-T3.0.0.30590 Firebird 3.0 Alpha 1"
Firebird/linux AMD64 (remote server), version "LI-T3.0.0.30590 Firebird 3.0 Alpha 1/tcp (vmoel63.local)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.3.26661 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 12.0

PS-2. FB runs as SuperServer

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: core_firebird_log_+_LT_rawdump.rar [ 12362 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Confirmed, invalid lock id messages happens due to some bug in database encryption code.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Bug was due to incorrect lock kind chosen (database level instead of attachment).

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Fix is incomplete and wrong

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 3.0 Alpha 2 [ 10560 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

summary: FB craches with "invalid lock id (NNNNN), errno: 0" when all connects except one (that locks some record) are forcely killed => FB craches with "invalid lock id (NNNNN)"

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test

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