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

Lock Timeouts return with error imediately without waiting, even if no lock [CORE1740] #2163

Closed
firebird-automations opened this issue Feb 12, 2008 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Mathias Dellaert (mithandir)

Attachments:
fb21rc1 transaction block bugtest.zip

When setting a lock timeout on a transaction and running a query, an error isc_tpb_lock_timeout is received immediately (long before the timeout should expire), even if there's no lock. The exact same code worked fine with 2.1 Beta 1 and Beta 2.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Could you please provide a reproducible test case (binary preferred)?

@firebird-automations
Copy link
Collaborator Author

Commented by: Mathias Dellaert (mithandir)

Of course. My apologies for not doing so immediately. I will try and get a test case to you by this time tomorrow.

@firebird-automations
Copy link
Collaborator Author

Commented by: Mathias Dellaert (mithandir)

My apologies, it seems I was mistaken. The actual error is not a timeout but as follows:

"Invalid format for transaction parameter block. Unsuccesful execution by system error that does not preclude succesful execution of subsequent statements.
Error Code: 11"

It seems thus to be an issue with the components I use (UIB) sending the wrong transaction block when timeout parameters are set. Still, the exact same code worked with 2.1 Beta 1 and 2.1 Beta 2 (and 2.0) and I could not find any documentation about a change to this format in the release notes. Presumably other packages will run into the same problem (meaning a break in backwards compatibility between 2.1 and 2.0).

Should I take this up with the component's developers instead?

I have attached a test case (binary + sourcecode) for this problem should you still want it.

@firebird-automations
Copy link
Collaborator Author

Commented by: Mathias Dellaert (mithandir)

Reproducable testcase. Contains binary + source code. Simply unzip in a directory and run.

@firebird-automations
Copy link
Collaborator Author

Modified by: Mathias Dellaert (mithandir)

Attachment: fb21rc1 transaction block bugtest.zip [ 10772 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

The UIB components send the timeout value wrongly. They do:

        tpLockTimeout : Result := Result \+ Char\(Ord\(tp\)\+1\) \+ PChar\(@FLockTimeout\)\[0\] \+ PChar\(@FLockTimeout\)\[1\];

but the correct code should be:

        tpLockTimeout : Result := Result \+ Char\(Ord\(tp\)\+1\) \+ Char\(2\) \+ PChar\(@FLockTimeout\)\[0\] \+ PChar\(@FLockTimeout\)\[1\];

i.e. they don't pass the timeout value length (in bytes).

Prior FB versions didn't validate the TPB format and could read garbage behind the buffer boundaries.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

1 participant