Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2021 22:11:42 +0200
From:      Michael Osipov <1983-01-06@gmx.net>
To:        Simeo Reig <simeo.reig@gmail.com>
Cc:        freebsd-java@freebsd.org
Subject:   Re: Fwd: Java core dump on freeBSD 12.2
Message-ID:  <cf0dbc9b-bb93-f802-2e0e-8a356d6811ba@gmx.net>
In-Reply-To: <CAJJNRpOZ4YLbecMfAnqkcotdRxodJoZ2_jwoofySVJt2cmrQMQ@mail.gmail.com>
References:  <CAJJNRpNasQD==m7G_FB8cCcgCDJjPehj53NFz54zGsRWzwpTAw@mail.gmail.com> <261b4107-b2cb-8008-e092-8b05300ef337@gmx.net> <CAJJNRpObe3MEZTjCbsaJWC%2BBjKgYFQbVGXAFynPqrsBukN9ULg@mail.gmail.com> <CAJJNRpOjShfuKjjCQ0OGR86hbHM61UHz2ohQsQBWBRSi%2BZogrQ@mail.gmail.com> <a6b17525-18a2-6fad-4943-bca378fa1ffa@gmx.net> <CAJJNRpOZ4YLbecMfAnqkcotdRxodJoZ2_jwoofySVJt2cmrQMQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 2021-07-12 um 21:39 schrieb Simeo Reig:
>> If you don't know how to do the above, let me know I can compile the
>> shim for you for amd64.
>
> It would be very kind of yo. Thanks

General instructions for everyone:
> $ git clone https://github.com/xerial/sqlite-jdbc.git
> $ cd sqlite-jdbc
> $ export JAVA_HOME=3D/usr/local/openjdk8
> $ gmake native SQLITE_HEADER=3D/usr/local/include/sqlite3.h SQLITE_OBJ=
=3D/usr/local/lib/libsqlite3.so
> "$JAVA_HOME/bin/javac"  -d target/common-lib -sourcepath src/main/java -=
h target/common-lib src/main/java/org/sqlite/core/NativeDB.java
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: src/main/java/org/sqlite/jdbc3/JDBC3Connection.java uses unchecked=
 or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> mv target/common-lib/org_sqlite_core_NativeDB.h target/common-lib/Native=
DB.h
> cc -Itarget/sqlite-3.36.0-FreeBSD-x86_64 -I/usr/local/include -I/usr/loc=
al/openjdk8/include -Ilib/inc_linux -Os -fPIC -fvisibility=3Dhidden   -I"/=
usr/local/openjdk8/include" -I"/usr/local/openjdk8/include/freebsd" -I tar=
get/common-lib -c -o target/sqlite-3.36.0-FreeBSD-x86_64/NativeDB.o src/ma=
in/java/org/sqlite/core/NativeDB.c
> cc -Itarget/sqlite-3.36.0-FreeBSD-x86_64 -I/usr/local/include -I/usr/loc=
al/openjdk8/include -Ilib/inc_linux -Os -fPIC -fvisibility=3Dhidden   -I"/=
usr/local/openjdk8/include" -I"/usr/local/openjdk8/include/freebsd" -o tar=
get/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so target/sqlite-3.36.0-Fre=
eBSD-x86_64/NativeDB.o /usr/local/lib/libsqlite3.so -shared
> cp target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so /tmp/libsqlitejd=
bc.so
> strip /tmp/libsqlitejdbc.so
> cp /tmp/libsqlitejdbc.so target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejd=
bc.so
> cp target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so src/main/resourc=
es/org/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so
> cp target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so target/classes/o=
rg/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so
> $ ldd target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so
> target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so:
>         libsqlite3.so.0 =3D> /usr/local/lib/libsqlite3.so.0 (0x800e00000=
)
>         libc.so.7 =3D> /lib/libc.so.7 (0x80024e000)
>         libz.so.6 =3D> /lib/libz.so.6 (0x800677000)
>         libm.so.5 =3D> /lib/libm.so.5 (0x800693000)
>         libthr.so.3 =3D> /lib/libthr.so.3 (0x8006c9000)
> $ readelf -aW target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so | gre=
p limit
> 000000000000a1e8  0000002e00000007 R_X86_64_JUMP_SLOT     00000000000000=
00 sqlite3_limit + 0
>     46: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND sqlite3_limit
>     77: 0000000000006fce    81 FUNC    GLOBAL DEFAULT   12 Java_org_sqli=
te_core_NativeDB_limit

Now you have two options:
* Install the JNI lib to /usr/local/lib and the loader will find it
automatically,
* or put in a directory of your choice and supply
-Dorg.sqlite.lib.path=3D... to the JVM when starting Wildfly.

As a precaution I would recommend to remove all native libs from the JAR
with the zip(1) command.

You can make sure by running "gmake test" and should see this failure at
most:
> Failed tests:   version(org.sqlite.DBMetaDataTest): db version expected:=
<3.3[6.0]> but was:<3.3[5.5]>

Because the SQLite 3 port isn't up to date.

http://home.apache.org/~michaelo/freebsd/libsqlitejdbc.so
> $ sha256 target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so
> SHA256 (target/sqlite-3.36.0-FreeBSD-x86_64/libsqlitejdbc.so) =3D 871b4b=
f681c40de7a283a7ecbc7bd6da0995f03cc7b54a8b55d0bf8aed87992e


Good luck,

Michael



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cf0dbc9b-bb93-f802-2e0e-8a356d6811ba>