Page 1 of 1

query raise SIGSEGV in not main thread if connection lost (Linux, Firebird)

Posted: 28.10.2022, 14:48
by abk964
Hi.

Use Zeos r7867, Lazarus 2.2.2, FPC 3.2.2, Ubuntu 16.04 32bit, Firebird 3.0.

Testing reconnection after connection lost. Found, that if TZReadOnlyQuery.Open executed in different (not main) thread on connection lost raises SIGSEGV, so connection can not be reopened. Seems, connection object is broken. ExecuteDirect instead of Query.Open works right.

Test project attached.

Code: Select all

'select ''Now'' from rdb$database'
must work with any DB.

Run application, stop Firebird, SIGSEGV raise, start Firebird, after ENTER Reconnect raise one more SIGSEGV.

TFPTimer used with option "UseTimerThread" to run in separate thread.

Similar code in Delphi 7 works right.

Re: query raise SIGSEGV in not main thread if connection lost (Linux, Firebird)

Posted: 29.10.2022, 08:54
by marsupilami
I can confirm the bug. Unfortunately it is hard to debug on Windows. I will have to see what happens on Linux.

What timer do you use for testing this on Windows?

Re: query raise SIGSEGV in not main thread if connection lost (Linux, Firebird)

Posted: 31.10.2022, 08:17
by abk964
I use TThread instead of timer on Windows.

Re: query raise SIGSEGV in not main thread if connection lost (Linux, Firebird)

Posted: 02.11.2022, 11:46
by marsupilami
Could you please also post the code that uses TTimer? It would help me in debugging this.

Re: query raise SIGSEGV in not main thread if connection lost (Linux, Firebird)

Posted: 07.11.2022, 10:33
by abk964
I had not use TTimer. As I understand it works in same thread.

Re: query raise SIGSEGV in not main thread if connection lost (Linux, Firebird)

Posted: 08.11.2022, 09:16
by marsupilami
I am sorry - I meant the code using TThread. I just want to see if I can add an example to the test suites and if I can modify it to generate the problem on FPC too without using TFPTimer.