[libbluray-devel] JRE for Android part 2

Vitor Dall'Acqua veggav at gmail.com
Thu Jan 28 18:14:34 UTC 2021


This is a problem because of relative paths, since we can't set JAVA_HOME
to the same place for everyone.

If I managed to put the entire folder of JRE inside the lib/aarch64/

It would be like so:

lib/aarch64/jre
lib/aarch64/jre/lib...
lib/aarch64/jre/bin...

So what would need is that to change the code in bdj.c in that if
(!java_home) statement

If it's not set open it one level up.
dl_dlopen without any additional instructions opens:
lib/aarch64/ the way it is now.

So, it needs to go a few folders deeper and go into
lib/aarch64/jre/lib/aarch64/server/ and libjvm.so will be here.

IF I managed to insert the entire folder inside libs.



On Thu, Jan 28, 2021, 3:04 PM Petri Hintukainen <
phintuka at users.sourceforge.net> wrote:

> to, 2021-01-28 kello 14:38 -0300, Vitor Dall'Acqua kirjoitti:
> > #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.
>
> It doesn't use JAVA_HOME value at this point, it just checks it is
> defined.
> Adding
>   setenv("JAVA_HOME", JDK_HOME, 0);
> before creating JVM should fix this.
>
> And, looking at the code, it really expects "normal" JRE directory
> structure. Java home directory is set based on libjvm.so location (by
> removing lib/<arch>/server/libjvm.so from the full path).
>
> Libraries are loaded two levels up (by removing /server/libjvm.so from
> the full path). That's why I didn't need to preload those (JVM was able
> to find those from expected location).
>
> > 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/intermediates/sy
> > > mb
> > > > ols -i ~/android-tools/tombstone_09
> > > > ********** Crash dump: **********
> > > > Build fingerprint:
> > > >
> > > 'NVIDIA/mdarcy/mdarcy:9/PPR1.180610.011/4079208_2513.0256:user/rele
> > > as
> > > > 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/c8768752/attachment-0001.html>


More information about the libbluray-devel mailing list