Re: Fwd: Java core dump on freeBSD 12.2

From: Michael Osipov <1983-01-06_at_gmx.net>
Date: Mon, 12 Jul 2021 16:46:33 UTC
Am 2021-07-12 um 17:59 schrieb Simeo Reig:
> Hi again,
>
>    You are right. JDBC driver from xerial seems to have some issues in
> freebsd. Version 3.32.X versions works ok, but above it (right now last one
> is 3.36.01 <https://github.com/xerial/sqlite-jdbc/releases>) don't want to
> connect with DB: "DB corrupt" or "java.lang.UnsatisfiedLinkError: 'int
> org.sqlite.core.NativeDB.limit(int, int)'" it depends on version.  Db isn't
> corrupt, it has the same sha1 in the Linux machine and I have tested it
> with pragma integrity_check on freeBSD. I needed to have it online and I
> downgraded jdbc to last 3.32 version.

Although I don't have access to your deployment, the error is likely
very obvious.
I'd like to see these solved to avoid issues like yours:
* https://github.com/xerial/sqlite-jdbc/issues/542
* https://github.com/xerial/sqlite-jdbc/issues/495

Generally, I don't trust binaries precomplied for FreeBSD because I know
people screw up.

There is a mismatch between the compiled version and the version loaded
at runtime. It seems that the bundled (if this one is used) native
library misses these:
*
https://github.com/xerial/sqlite-jdbc/blame/master/src/main/java/org/sqlite/core/NativeDB.java#L434-L436
*
https://github.com/xerial/sqlite-jdbc/blame/master/src/main/java/org/sqlite/core/NativeDB.c#L1329-L1343

My recommendation:
* Remove all native libs from the JAR
* Install SQLite 3 through ports
* Compile the driver native shim and link /dynamically/ against the
libsqlte3.so from LOCALBASE.

I have modified the driver recently and upstreamed to load all libs from
loader's default path w/o the need to provide anything.

If you don't know how to do the above, let me know I can compile the
shim for you for amd64.

Michael