-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
SIGSEGV in Firebird 5.0.0.1306 embedded during update on cursor #8185
Comments
Can you also provide xz-compressed core dump? |
The core dump contains too many personal information of customers, but I can reproduce the problem with an anonymized version of the DB and send you the new core dump, maybe tomorrow |
Could you show us query that defines cursor SCHEDPEEK? |
Of course
|
Is it opened as an unidirectional or scrollable cursor? |
Unidirectional, the code is written for Firebird 2.5 |
Here we go!
|
I forgot some possibly useful information:
The code runs well with Firebird 2.5 and 3.0. |
It seems I'm able to reproduce it. Working on it. |
Try to set MaxStatementCacheSize to zero. |
You are right, the bug is evidently related to the statement cache. Putting the cache size to zero make the SIGSEGV disappear, but also disappear performance gaining, the main reason for me to adopt FB 5.0 |
Do you mean performance of this particular query or performance of your application as whole? I can't believe that preparation of this "update" can be slow. |
I mean performance as measured by my personal benchmark with prepared and unprepared query loop. I can't say that preparation of this specific "update" is slow. |
In this case I think that the simplest fix would be to disable caching of positional DML statements. |
I've already implemented this, but honestly expected to do something more clever. |
Alternatives could be "partial release/prepare" mechanic which is too big work for v5 or parent statement lookup on each execution which may be not good for performance. |
Is this dependent on table and query structure? I've tried simple table with many executions and not reproduced it. |
In my tests, I'm having error |
The worse is the case when there are two parent statements in the cache and by chance DML statement is used referring to the wrong SELECT statement. |
Cursor names are attached to dsql requests. What is cached is dsql statements. |
Right. But still actual problem is that parentRequest, parentDbKey and parentRecVersion are members of DsqlStatement. |
@dyemanov let me know if you are actively working on a fix or want that I look at it. |
I've just made two tests.
I removed the time gap and forced the scheduler to run for "10:00" and then for "10:01" without any delay between the calls, the SIGSEGV appeared in the same way. So the one minute delay is not involved.
This happen to me too if I try to rewrite the code in attempt to reproduce the bug in a simpler situation. |
I'll have to solve it anyway in #8145 so you don't need to spend much of your time to find something more clever. |
…g update on cursor - disallow caching for positioned updates/deletes
QA note. |
@pavel-zotov PSQL cursors and DSQL cursors are completely different beasts. This problem cannot happen with PSQL cursors which you are trying to use. |
@pavel-zotov Steps to reproduce should be like this:
At step 10 you can get "Invalid handle" error or a crash if you swap steps 5 and 6. |
::: QA NOTE ::: |
The program was executing the following query:
Stack trace:
Registers:
Shared library:
/usr/lib/libfbembed.so.2.5
is a link to/opt/firebird/lib/libfbclient.so
for compatibility reasons./opt/firebird/firebird.conf
:I hope this can help.
The text was updated successfully, but these errors were encountered: