[libbluray-devel] JRE for Android part 2

Vitor Dall'Acqua veggav at gmail.com
Thu Jan 28 22:00:04 UTC 2021


Path is correct now we are a few inches from this starting to work...

My python addon extracts the files and list everything, all is good.
Now check this out:
This is from my listing:
DEBUG <general>:
/mnt/expand/cab01563-bcca-48fa-a0bf-0fbddaf9b192/user/0/org.xbmc.kodi19DV/cache/apk/assets/j2re-image/lib/aarch64/libnet.so
DEBUG <general>:
/mnt/expand/cab01563-bcca-48fa-a0bf-0fbddaf9b192/user/0/org.xbmc.kodi19DV/cache/apk/assets/j2re-image/lib/aarch64/libnio.so

and this is the result:
2021-01-28 19:51:08.734 T:12529   DEBUG <general>: CBlurayCallback::Logger
- BDJActionQueue.java:org.videolan.BDJActionQueue.run:93: action failed:
java.lang.UnsatisfiedLinkError:
/mnt/expand/cab01563-bcca-48fa-a0bf-0fbddaf9b192/user/0/org.xbmc.kodi19DV/cache/apk/assets/j2re-image/lib/aarch64/libnio.so:
dlopen failed: library "libnet.so" not found

if I would have to guess it is looking for libnet.so at the root of the
library directories.
Those are now moved and should respect the correct path.


On Thu, Jan 28, 2021 at 5:48 PM Vitor Dall'Acqua <veggav at gmail.com> wrote:

> Wait spoke too soon..
>
>  dlopen failed: library
> "/mnt/expand/cab01563-bcca-48fa-a0bf-0fbddaf9b192/app/org.xbmc.kodi19DV-Qz4JGWGzBPF04XzDgaumQg==/lib/l
> 01-28 18:39:07.895  9666  9713 D Kodi    : ibjava.so" not found
>
> as you mentioned we need the correct path.
>
> On Thu, Jan 28, 2021 at 5:45 PM Vitor Dall'Acqua <veggav at gmail.com> wrote:
>
>> nice! we are moving forward now and still crashing.
>>
>> Here's the interesting part of the log from logcat:
>> https://pastebin.com/UCyFXRGQ
>>
>> This is the extended loggin in the shield.
>>
>> But I believe the interesting part is:
>> *JNI DETECTED ERROR IN APPLICATION: java_object == null*
>>
>> On Thu, Jan 28, 2021 at 4:11 PM Petri Hintukainen <
>> phintuka at users.sourceforge.net> wrote:
>>
>>> to, 2021-01-28 kello 14:54 -0300, Vitor Dall'Acqua kirjoitti:
>>> > Yeah, same problem. No change.
>>>
>>> I added fixed libjvm.so to j2se_image.tar.bz2, maybe it helps.
>>>
>>> > But I'm not entirely sure about that address value based on this:
>>> >
>>> >
>>> https://stackoverflow.com/questions/56046062/linux-addr2line-command-returns-0
>>>
>>> The address looks good, the code at that address is
>>>
>>>   8a8238:       97e5040a        bl      1e9260 <strrchr at plt>
>>> ->8a823c:       3900001f        strb    wzr, [x0]
>>>   8a8240:       528005e1        mov     w1, #0x2f
>>>
>>> This is the store in os_linux.cpp:414:
>>>
>>>     *(strrchr(buf, '/')) = '\0'; // Get rid of /libjvm.so.
>>>
>>> And here buf is uninitialized if building for Android and JAVA_HOME is
>>> unset.
>>>
>>> > I have compiled the cpp code in that page but it doesn't result in
>>> > anything. Maybe I don't know how to use it.
>>> >
>>> > On Thu, Jan 28, 2021 at 2:44 PM Vitor Dall'Acqua <veggav at gmail.com>
>>> > wrote:
>>> > > I'm adding here the last memory dump from libjvm (removed the hex
>>> > > values)
>>> > > memory_max_usage_in_bytes: %ldJAVA_HOME SIG%d
>>> > > %s: SIG_DFL.SIG_IGN %s+0x%x.[%s]
>>> > > , sa_mask[0]= , sa_flags=
>>> > > , flags was changed from 0x%08x, consider using jsig library
>>> > > unlimited
>>> > > container memory
>>> > > limit %s: %ld,
>>> > > using host value
>>> > >
>>> > > So, might be that some flag changed or it's using too much memory
>>> > > (or needs more memory)
>>> > >
>>> > >
>>> > > On Thu, Jan 28, 2021 at 2:38 PM Vitor Dall'Acqua <veggav at gmail.com>
>>> > > wrote:
>>> > > > #undef JAVA_HOME
>>> > > > #define JAVA_HOME "/storage/emulated/0/JAVAC/"
>>> > > > #undef JDK_HOME
>>> > > > #define JDK_HOME "/storage/emulated/0/JAVAC"
>>> > > >
>>> > > > the folder doesn't exist.
>>> > > > At first test the result was the same.
>>> > > >
>>> > > > I'm compiling again, sometimes libbluray doesn't update with
>>> > > > kodi.
>>> > > >
>>> > > > I got
>>> > > > DEBUG <general>: CBlurayCallback::Logger - bdj.c:536: JAVA_HOME
>>> > > > not set, trying default locations
>>> > > >
>>> > > > that should be expected as the folder doesn't exist.
>>> > > >
>>> > > >
>>> > > > On Thu, Jan 28, 2021 at 2:01 PM Petri Hintukainen <
>>> > > > phintuka at users.sourceforge.net> wrote:
>>> > > > > to, 2021-01-28 kello 13:12 -0300, Vitor Dall'Acqua kirjoitti:
>>> > > > > > Ok, moving forward.. crash -> bug report -> adb pull
>>> > > > > tombstone
>>> > > > > > now:
>>> > > > > > bahamut at pop-os:~/android-tools/android-ndk-r20$ ./ndk-stack -
>>> > > > > -sym
>>> > > > > >
>>> > > > > ~/KodiDV2/build/tools/android/packaging/xbmc/build/intermediate
>>> > > > > s/symb
>>> > > > > > ols -i ~/android-tools/tombstone_09
>>> > > > > > ********** Crash dump: **********
>>> > > > > > Build fingerprint:
>>> > > > > >
>>> > > > > 'NVIDIA/mdarcy/mdarcy:9/PPR1.180610.011/4079208_2513.0256:user/
>>> > > > > releas
>>> > > > > > e-keys'
>>> > > > > > #00 0x00000000008a823c /mnt/expand/cab01563-bcca-48fa-a0bf-
>>> > > > > > 0fbddaf9b192/app/org.xbmc.kodi19DV-
>>> > > > > > sUyRHaWlGB5SdxJV2JDSdg==/lib/arm64/libjvm.so
>>> > > > > > Crash dump is completed
>>> > > > > >
>>> > > > > > and yes my pc is called Bahamut :)
>>> > > > > >
>>> > > > > > next...
>>> > > > > > bahamut at pop-os:~/android-tools$ ./android-ndk-
>>> > > > > r20/toolchains/aarch64-
>>> > > > > > linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-
>>> > > > > android-
>>> > > > > > addr2line -f -C -i -a 8a823c -e
>>> > > > > > ~/Documents/petri/jre/lib/aarch64/server/libjvm.so
>>> > > > > > 0x00000000008a823c
>>> > > > > > os::init_system_properties_values()
>>> > > > > > ??:?
>>> > > > > >
>>> > > > > > it is still showing as ??:? it might have something to do
>>> > > > > with the
>>> > > > > > ELF value in memory that needs to be subtracted.. but if I
>>> > > > > understand
>>> > > > > > this properly..
>>> > > > > > Petri, you will need to compile another libjvm with a few
>>> > > > > changes.
>>> > > > >
>>> > > > > Looking at the code at this address, it seems to be caused by
>>> > > > > unset
>>> > > > > JAVA_HOME environment variable.
>>> > > > >
>>> > > > > I can fix this in the source (it is an issue with Android
>>> > > > > port), but it
>>> > > > > takes some time to rebuild the libraries => it is probably
>>> > > > > faster to
>>> > > > > test if setting JAVA_HOME gets us further. You can set it to
>>> > > > > anything
>>> > > > > at this point (it is not used in this function, it just needs
>>> > > > > to be
>>> > > > > defined).
>>> > > > >
>>> > > > > > On Thu, Jan 28, 2021 at 9:22 AM Vitor Dall'Acqua
>>> > > > > <veggav at gmail.com>
>>> > > > > > wrote:
>>> > > > > > > Good morning everyone,
>>> > > > > > > Figured out why it's crashing but I still don't know how to
>>> > > > > fix it
>>> > > > > > >
>>> > > > > > > 01-28 10:13:31.191 19223 19330 F libc    : Fatal signal 11
>>> > > > > > > (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid
>>> > > > > 19330
>>> > > > > > > (Thread-3), pid 19223 (g.xbmc.kodi19DV)
>>> > > > > > > 01-28 10:13:31.191 19223 19243 D Kodi    : OpenJDK 64-Bit
>>> > > > > Server VM
>>> > > > > > > warning: No monotonic clock was available - timed services
>>> > > > > may be
>>> > > > > > > adversely affected if the time-of-da
>>> > > > > > > 01-28 10:13:31.191 19223 19243 D Kodi    : y clock changes
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : *** *** *** ***
>>> > > > > *** ***
>>> > > > > > > *** *** *** *** *** *** *** *** *** ***
>>> > > > > > > 01-28 10:13:31.475 19353 19353 W crash_dump64: type=1400
>>> > > > > > > audit(0.0:5353): avc: denied { search } for name="/"
>>> > > > > dev="tmpfs"
>>> > > > > > > ino=1336 scontext=u:r:crash_dump:s0:c132,c256,c512,c768
>>> > > > > > > tcontext=u:object_r:tmpfs:s0 tclass=dir permissive=0
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : Build
>>> > > > > fingerprint:
>>> > > > > > >
>>> > > > > 'NVIDIA/mdarcy/mdarcy:9/PPR1.180610.011/4079208_2513.0256:user/
>>> > > > > rele
>>> > > > > > > ase-keys'
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : Revision: '0'
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : ABI: 'arm64'
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : pid: 19223, tid:
>>> > > > > 19330,
>>> > > > > > > name: Thread-3  >>> org.xbmc.kodi19DV <<<
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : signal 11
>>> > > > > (SIGSEGV),
>>> > > > > > > code 1 (SEGV_MAPERR), fault addr 0x0
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   : Cause: null
>>> > > > > pointer
>>> > > > > > > dereference
>>> > > > > > > 01-28 10:13:31.478 19353 19353 F DEBUG   :     x0
>>> > > > >  0000000000000000
>>> > > > > > >  x1  000000000000002f  x2  fffffffffffffffe  x3
>>> > > > >  0000000000000010
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x4
>>> > > > >  000000287a1b1222
>>> > > > > > >  x5  000000007fffffff  x6  0000000000000002  x7
>>> > > > >  0000000000000030
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x8
>>> > > > >  0000000000000000
>>> > > > > > >  x9  0000000000000000  x10 0000000000000009  x11
>>> > > > > 00000000fffffff7
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x12
>>> > > > > 000000000000004c
>>> > > > > > >  x13 00000000fffffff7  x14 0000002985757cb8  x15
>>> > > > > 000000000000004a
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x16
>>> > > > > 000000287a1af1d8
>>> > > > > > >  x17 000000287a106fc8  x18 0000000000000001  x19
>>> > > > > 00000029220be800
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x20
>>> > > > > 0000002934ef7638
>>> > > > > > >  x21 0000002985826000  x22 000000298583e914  x23
>>> > > > > 0000002985896000
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x24
>>> > > > > 9fb1c16ed01cfd15
>>> > > > > > >  x25 0000002934ef78d8  x26 0000000000000007  x27
>>> > > > > 0000002934ef78d8
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     x28
>>> > > > > 00000029228e7c00
>>> > > > > > >  x29 0000002934ef75d0
>>> > > > > > > 01-28 10:13:31.479 19353 19353 F DEBUG   :     sp
>>> > > > >  0000002934ef75d0
>>> > > > > > >  lr  00000029854b423c  pc  00000029854b423c
>>> > > > > > > 01-28 10:13:31.480 19353 19353 I unwind  : Malformed
>>> > > > > section header
>>> > > > > > > found, ignoring...
>>> > > > > > > 01-28 10:13:31.480 19353 19353 F DEBUG   :
>>> > > > > > > 01-28 10:13:31.480 19353 19353 F DEBUG   : backtrace:
>>> > > > > > > 01-28 10:13:31.480 19353 19353 F DEBUG   :     #00 pc
>>> > > > > > > 00000000008a823c  /mnt/expand/cab01563-bcca-48fa-a0bf-
>>> > > > > > > 0fbddaf9b192/app/org.xbmc.kodi19DV-
>>> > > > > > > TFUZwtqXJYBSjv0vIb1V4g==/lib/arm64/libjvm.so
>>> > > > > > > 01-28 10:13:31.499  6592  6600 W System  : A resource
>>> > > > > failed to
>>> > > > > > > call release.
>>> > > > > > >
>>> > > > > > > Permission issue?
>>> > > > > > >
>>> > > > > > > On Wed, Jan 27, 2021 at 7:56 PM Petri Hintukainen <
>>> > > > > > > phintuka at users.sourceforge.net> wrote:
>>> > > > > > > > ke, 2021-01-27 kello 19:43 -0300, Vitor Dall'Acqua
>>> > > > > kirjoitti:
>>> > > > > > > > > Ok I'm doing the stupid way of doing things because
>>> > > > > other way
>>> > > > > > > > every
>>> > > > > > > > > time I touch the code it fails.
>>> > > > > > > > > can you tell me why it's only loading the first entry?
>>> > > > > > > > > static const char         all_libs[]  = {"libawt",
>>> > > > > > > >
>>> > > > > > > > static const char * all_libs[] = {"libawt",
>>> > > > > > > >
>>> > > > > > > > >
>>> > > > > "libawt_headless",
>>> > > > > > > > >                                         "libawt_xawt",
>>> > > > > > > > >                                         "libdt_socket",
>>> > > > > > > > >
>>> > > > > "libfontmanager",
>>> > > > > > > > >                                         "libhprof",
>>> > > > > > > > >
>>> > > > > "libinstrument",
>>> > > > > > > > >                                         "libj2gss",
>>> > > > > > > > >                                         "libj2pcsc",
>>> > > > > > > > >                                         "libj2pkcs11",
>>> > > > > > > > >                                         "libjaas_unix",
>>> > > > > > > > >                                         "libjava",
>>> > > > > > > > >
>>> > > > > "libjava_crw_demo",
>>> > > > > > > > >                                         "libjawt",
>>> > > > > > > > >                                         "libjdwp",
>>> > > > > > > > >                                         "libjli",
>>> > > > > > > > >                                         "libjpeg",
>>> > > > > > > > >                                         "libjsdt",
>>> > > > > > > > >                                         "libjsig",
>>> > > > > > > > >                                         "libjsound",
>>> > > > > > > > >                                         "liblcms",
>>> > > > > > > > >
>>> > > > > "libmanagement",
>>> > > > > > > > >
>>> > > > > "libmlib_image",
>>> > > > > > > > >                                         "libnet",
>>> > > > > > > > >                                         "libnio",
>>> > > > > > > > >                                         "libnpt",
>>> > > > > > > > >                                         "libsctp",
>>> > > > > > > > >                                         "libsunec",
>>> > > > > > > > >                                         "libtinyiconv",
>>> > > > > > > > >                                         "libunpack",
>>> > > > > > > > >                                         "libverify",
>>> > > > > > > > >                                         "ibzip",};
>>> > > > > > > >
>>> > > > > > > > "libzip" (?)
>>> > > > > > > >
>>> > > > > > > > >
>>> > > > > > > > >
>>> > > > > > > > >   dl_dlopen(all_libs, NULL);
>>> > > > > > > >
>>> > > > > > > > dl_dlopen() opens only single library, you need to
>>> > > > > iterate over
>>> > > > > > > > all
>>> > > > > > > > libraries:
>>> > > > > > > >
>>> > > > > > > >     for (size_t i = 0; i < sizeof(all_libs) /
>>> > > > > > > > sizeof(all_libs[0]); i++)
>>> > > > > > > >       dl_dlopen(all_libs[i], NULL);
>>> > > > > > > >
>>> > > > > > > > >
>>> > > > > > > > >     result = JNI_CreateJavaVM_fp(jvm, (void**) env,
>>> > > > > &args);
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > > > _______________________________________________
>>> > > > > > > > libbluray-devel mailing list
>>> > > > > > > > libbluray-devel at videolan.org
>>> > > > > > > > https://mailman.videolan.org/listinfo/libbluray-devel
>>> > > > > > _______________________________________________
>>> > > > > > libbluray-devel mailing list
>>> > > > > > libbluray-devel at videolan.org
>>> > > > > > https://mailman.videolan.org/listinfo/libbluray-devel
>>> > > > >
>>> > > > >
>>> > > > > _______________________________________________
>>> > > > > libbluray-devel mailing list
>>> > > > > libbluray-devel at videolan.org
>>> > > > > https://mailman.videolan.org/listinfo/libbluray-devel
>>> > _______________________________________________
>>> > libbluray-devel mailing list
>>> > libbluray-devel at videolan.org
>>> > https://mailman.videolan.org/listinfo/libbluray-devel
>>>
>>>
>>> _______________________________________________
>>> libbluray-devel mailing list
>>> libbluray-devel at videolan.org
>>> https://mailman.videolan.org/listinfo/libbluray-devel
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20210128/efbbb4d5/attachment-0001.html>


More information about the libbluray-devel mailing list