bytedeco/javacpp-presets

UnsatisfiedLinkError with tesseract-platform after upgrade to 5.3.4-1.5.10

bskorka opened this issue · 1 comments

Hey!
We are using the tesseract-platform in our app to run the OCR of the PDF files. It worked just fine until we upgraded the dependency version from 5.3.1-1.5.9 to 5.3.4-1.5.10.

After the upgrade, the OCR process started to throw the error on our docker environment.

2024-06-07 14:57:22,583 [boundedElastic-3] WARN  reactor.core.Exceptions - throwIfFatal detected a jvm fatal exception, which is thrown and logged below:
2024-06-07T14:57:22.586792636Z java.lang.UnsatisfiedLinkError: no jnileptonica in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
Caused by: java.lang.UnsatisfiedLinkError: /root/.javacpp/cache/leptonica-1.84.1-1.5.10-linux-x86_64.jar/org/bytedeco/leptonica/linux-x86_64/libjnileptonica.so: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /root/.javacpp/cache/leptonica-1.84.1-1.5.10-linux-x86_64.jar/org/bytedeco/leptonica/linux-x86_64/libleptonica.so.6)

I tried to add the dependency to:
implementation 'org.bytedeco:leptonica-platform:1.84.1-1.5.10'

But it changes nothing.
We are using the amazoncorretto:17 image to build our apps which underneath builds on amazonlinux:2 <- alpine:3.17:
https://github.com/corretto/corretto-docker/blob/681bfefafc18d88293253af8b529454855f76c81/17/jdk/al2-generic/Dockerfile

I tried to run the investigation from wiki (https://github.com/bytedeco/javacpp-presets/wiki/Debugging-UnsatisfiedLinkError-and-StackOverflowError-on-Linux):

bash-4.2# ldd -v libjnileptonica.so
ldd: warning: you do not have execution permission for `./libjnileptonica.so'
./libjnileptonica.so: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /root/.javacpp/cache/leptonica-1.84.1-1.5.10-linux-x86_64.jar/org/bytedeco/leptonica/linux-x86_64/./libleptonica.so.6)
./libjnileptonica.so: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /root/.javacpp/cache/leptonica-1.84.1-1.5.10-linux-x86_64.jar/org/bytedeco/leptonica/linux-x86_64/./libleptonica.so.6)
        libleptonica.so.6 => /root/.javacpp/cache/leptonica-1.84.1-1.5.10-linux-x86_64.jar/org/bytedeco/leptonica/linux-x86_64/./libleptonica.so.6 (0x00007ffffece9000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007ffffe964000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ffffe74e000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffffe530000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ffffe183000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ffffde43000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fffffdda000)

        Version information:
        ./libjnileptonica.so:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libstdc++.so.6 (CXXABI_1.3.8) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /root/.javacpp/cache/leptonica-1.84.1-1.5.10-linux-x86_64.jar/org/bytedeco/leptonica/linux-x86_64/./libleptonica.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.11) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.22) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libm.so.6 (GLIBC_2.29) => not found
                libm.so.6 (GLIBC_2.27) => not found
                libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6
        /lib64/libstdc++.so.6:
                libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libgcc_s.so.1 (GCC_4.2.0) => /lib64/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib64/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.18) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.16) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libpthread.so.0:
                ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
        /lib64/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        /lib64/libm.so.6:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6

bash-4.2# objdump -p libjnileptonica.so

libjnileptonica.so:     file format elf64-x86-64

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
         filesz 0x0000000000100130 memsz 0x0000000000100130 flags r--
    LOAD off    0x0000000000101000 vaddr 0x0000000000101000 paddr 0x0000000000101000 align 2**12
         filesz 0x00000000001dd879 memsz 0x00000000001dd879 flags r-x
    LOAD off    0x00000000002df000 vaddr 0x00000000002df000 paddr 0x00000000002df000 align 2**12
         filesz 0x000000000007ed8c memsz 0x000000000007ed8c flags r--
    LOAD off    0x000000000035de68 vaddr 0x000000000035ee68 paddr 0x000000000035ee68 align 2**12
         filesz 0x000000000000e938 memsz 0x000000000000f018 flags rw-
 DYNAMIC off    0x0000000000366d70 vaddr 0x0000000000367d70 paddr 0x0000000000367d70 align 2**3
         filesz 0x0000000000000230 memsz 0x0000000000000230 flags rw-
    NOTE off    0x00000000000002a8 vaddr 0x00000000000002a8 paddr 0x00000000000002a8 align 2**3
         filesz 0x0000000000000020 memsz 0x0000000000000020 flags r--
    NOTE off    0x00000000000002c8 vaddr 0x00000000000002c8 paddr 0x00000000000002c8 align 2**2
         filesz 0x0000000000000024 memsz 0x0000000000000024 flags r--
0x6474e553 off    0x00000000000002a8 vaddr 0x00000000000002a8 paddr 0x00000000000002a8 align 2**3
         filesz 0x0000000000000020 memsz 0x0000000000000020 flags r--
EH_FRAME off    0x00000000002e57f0 vaddr 0x00000000002e57f0 paddr 0x00000000002e57f0 align 2**2
         filesz 0x000000000000cc44 memsz 0x000000000000cc44 flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
   RELRO off    0x000000000035de68 vaddr 0x000000000035ee68 paddr 0x000000000035ee68 align 2**0
         filesz 0x0000000000009198 memsz 0x0000000000009198 flags r--

Dynamic Section:
  NEEDED               libleptonica.so.6
  NEEDED               libstdc++.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6
  SYMBOLIC             0x0000000000000000
  RUNPATH              $ORIGIN/:/home/runner/work/javacpp-presets/javacpp-presets/leptonica/cppbuild/linux-x86_64/lib
  INIT                 0x0000000000101000
  FINI                 0x00000000002de86c
  INIT_ARRAY           0x000000000035ee68
  INIT_ARRAYSZ         0x0000000000000010
  FINI_ARRAY           0x000000000035ee78
  FINI_ARRAYSZ         0x0000000000000008
  GNU_HASH             0x00000000000002f0
  STRTAB               0x0000000000041b20
  SYMTAB               0x000000000000c570
  STRSZ                0x00000000000a52e0
  SYMENT               0x0000000000000018
  PLTGOT               0x0000000000368000
  PLTRELSZ             0x0000000000010668
  PLTREL               0x0000000000000007
  JMPREL               0x00000000000efac8
  RELA                 0x00000000000eb5f8
  RELASZ               0x00000000000044d0
  RELAENT              0x0000000000000018
  FLAGS                0x0000000000000002
  VERNEED              0x00000000000eb528
  VERNEEDNUM           0x0000000000000004
  VERSYM               0x00000000000e6e00
  RELACOUNT            0x00000000000002d4

Version References:
  required from libgcc_s.so.1:
    0x0b792650 0x00 10 GCC_3.0
  required from libpthread.so.0:
    0x09691a75 0x00 05 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0bafd178 0x00 09 CXXABI_1.3.8
    0x056bafd3 0x00 06 CXXABI_1.3
    0x08922974 0x00 03 GLIBCXX_3.4
  required from libc.so.6:
    0x0d696914 0x00 08 GLIBC_2.4
    0x06969194 0x00 07 GLIBC_2.14
    0x09691974 0x00 04 GLIBC_2.3.4
    0x09691a75 0x00 02 GLIBC_2.2.5

Can you help with it and suggest something to fix it or do we have to use the "older" version til it is fixed if there is anything that should be fixed 😄

Funny thing is that integration tests and local run works fine on Mac M1 Pro (Sonoma 14.5 (23F79)) and Github Actions using Ubuntu 22.0.4 LTS.

Duplicate of #1379