Segmentation fault in FreePascal multi-threaded program when using 2.5.x client library on Linux [CORE3646] #3997
Submitted by: Pumuqui (pumuqui)
Segmentation fault for a FreePascal program,
The example code below should illustrate the situation.
There are no problems on Windows, nor on Linux when using
I posted the error first on the fpc-devel list, where they told me that
Change the connection string in the following code, so that it points
This is the example program:
The text was updated successfully, but these errors were encountered:
Commented by: @AlexPeshkoff
Thread's destructor function does not behave exactly according to POSIX standard on linux. After destroying associated key function is anyway attempted to be called when thread terminates, which (taken together with aleready unloaded client library) causes segfault. Solution is to use windows-like approach, where we never used thread dtor at all.