Hi folks,
close to deleting FPC/Lazarus.

Ubuntu18.10-64bit/FPC304/Laz200
Library with exported functions.
First call to the library creates a Thread, which takes over as MainThread (because of CheckSynchronize).
This FakeMainthread creates a/many childthreads. Everything woking so far.
The moment i add DB-Components to the Childthreads, everything goes south.
If i use MySQL in the TSQLConnector, it works (with one thread! Many threads it still goes haywire)
If i use SQLite3 i get the Error-MEssage
"Inconsistency detected by ld.so: dl-minimal.c: 126: realloc: Assertion `ptr == alloc_last_block' failed!"
I found exactly one thread in the forum having the error-message. And the discussion there didn't help.
cthreads is the first Unit in the libraray.lpr
and i don't use cmem, because that one doesn't work for me (heaptrc always saying no Memory leaks), and i get a lot of corrupted memory from cmem.
Help?
EDIT: I forgot: The error occurs after connection has been established (connection.connected returns true), on the first try to grab any information from the database (Query.Open, Connection.GetTableNames etc.)
EDIT2: Before anyone asks: YEs, i have successfully worked with SQLite under FPC304, so i don't understand what's happening here, since i don't do anything different than before
EDIT3: And yes: Each thread has its own DB-Conn, Trans and Query! I'm not mixing them, and the threads/db-components don't have to talk with each other.