<div dir="auto">This is a problem because of relative paths, since we can't set JAVA_HOME to the same place for everyone.<div dir="auto"><br></div><div dir="auto">If I managed to put the entire folder of JRE inside the lib/aarch64/</div><div dir="auto"><br></div><div dir="auto">It would be like so:</div><div dir="auto"><br></div><div dir="auto">lib/aarch64/jre</div><div dir="auto">lib/aarch64/jre/lib... </div><div dir="auto">lib/aarch64/jre/bin...</div><div dir="auto"><br></div><div dir="auto">So what would need is that to change the code in bdj.c in that if (!java_home) statement</div><div dir="auto"><br></div><div dir="auto">If it's not set open it one level up.</div><div dir="auto">dl_dlopen without any additional instructions opens:</div><div dir="auto">lib/aarch64/ the way it is now.</div><div dir="auto"><br></div><div dir="auto">So, it needs to go a few folders deeper and go into</div><div dir="auto">lib/aarch64/jre/lib/aarch64/server/ and libjvm.so will be here.</div><div dir="auto"><br></div><div dir="auto">IF I managed to insert the entire folder inside libs.</div><div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 28, 2021, 3:04 PM Petri Hintukainen <<a href="mailto:phintuka@users.sourceforge.net">phintuka@users.sourceforge.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">to, 2021-01-28 kello 14:38 -0300, Vitor Dall'Acqua kirjoitti:<br>
> #undef JAVA_HOME<br>
> #define JAVA_HOME "/storage/emulated/0/JAVAC/"<br>
> #undef JDK_HOME<br>
> #define JDK_HOME "/storage/emulated/0/JAVAC"<br>
> <br>
> the folder doesn't exist. <br>
> At first test the result was the same. <br>
> <br>
> I'm compiling again, sometimes libbluray doesn't update with kodi.<br>
> <br>
> I got <br>
> DEBUG <general>: CBlurayCallback::Logger - bdj.c:536: JAVA_HOME not<br>
> set, trying default locations<br>
> <br>
> that should be expected as the folder doesn't exist.<br>
<br>
It doesn't use JAVA_HOME value at this point, it just checks it is<br>
defined.<br>
Adding <br>
setenv("JAVA_HOME", JDK_HOME, 0);<br>
before creating JVM should fix this.<br>
<br>
And, looking at the code, it really expects "normal" JRE directory<br>
structure. Java home directory is set based on libjvm.so location (by<br>
removing lib/<arch>/server/libjvm.so from the full path).<br>
<br>
Libraries are loaded two levels up (by removing /server/libjvm.so from<br>
the full path). That's why I didn't need to preload those (JVM was able<br>
to find those from expected location).<br>
<br>
> On Thu, Jan 28, 2021 at 2:01 PM Petri Hintukainen <<br>
> <a href="mailto:phintuka@users.sourceforge.net" target="_blank" rel="noreferrer">phintuka@users.sourceforge.net</a>> wrote:<br>
> > to, 2021-01-28 kello 13:12 -0300, Vitor Dall'Acqua kirjoitti:<br>
> > > Ok, moving forward.. crash -> bug report -> adb pull tombstone<br>
> > > now:<br>
> > > bahamut@pop-os:~/android-tools/android-ndk-r20$ ./ndk-stack --sym<br>
> > > <br>
> > ~/KodiDV2/build/tools/android/packaging/xbmc/build/intermediates/sy<br>
> > mb<br>
> > > ols -i ~/android-tools/tombstone_09 <br>
> > > ********** Crash dump: **********<br>
> > > Build fingerprint:<br>
> > > <br>
> > 'NVIDIA/mdarcy/mdarcy:9/PPR1.180610.011/4079208_2513.0256:user/rele<br>
> > as<br>
> > > e-keys'<br>
> > > #00 0x00000000008a823c /mnt/expand/cab01563-bcca-48fa-a0bf-<br>
> > > 0fbddaf9b192/app/org.xbmc.kodi19DV-<br>
> > > sUyRHaWlGB5SdxJV2JDSdg==/lib/arm64/libjvm.so<br>
> > > Crash dump is completed<br>
> > > <br>
> > > and yes my pc is called Bahamut :)<br>
> > > <br>
> > > next...<br>
> > > bahamut@pop-os:~/android-tools$ ./android-ndk-<br>
> > r20/toolchains/aarch64-<br>
> > > linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-<br>
> > android-<br>
> > > addr2line -f -C -i -a 8a823c -e<br>
> > > ~/Documents/petri/jre/lib/aarch64/server/libjvm.so <br>
> > > 0x00000000008a823c<br>
> > > os::init_system_properties_values()<br>
> > > ??:?<br>
> > > <br>
> > > it is still showing as ??:? it might have something to do with<br>
> > the<br>
> > > ELF value in memory that needs to be subtracted.. but if I<br>
> > understand<br>
> > > this properly.. <br>
> > > Petri, you will need to compile another libjvm with a few<br>
> > changes.<br>
> > <br>
> > Looking at the code at this address, it seems to be caused by unset<br>
> > JAVA_HOME environment variable.<br>
> > <br>
> > I can fix this in the source (it is an issue with Android port),<br>
> > but it<br>
> > takes some time to rebuild the libraries => it is probably faster<br>
> > to<br>
> > test if setting JAVA_HOME gets us further. You can set it to<br>
> > anything<br>
> > at this point (it is not used in this function, it just needs to be<br>
> > defined).<br>
> > <br>
> > > On Thu, Jan 28, 2021 at 9:22 AM Vitor Dall'Acqua<br>
> > <<a href="mailto:veggav@gmail.com" target="_blank" rel="noreferrer">veggav@gmail.com</a>><br>
> > > wrote:<br>
> > > > Good morning everyone,<br>
> > > > Figured out why it's crashing but I still don't know how to fix<br>
> > it<br>
> > > > <br>
> > > > 01-28 10:13:31.191 19223 19330 F libc : Fatal signal 11<br>
> > > > (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 19330<br>
> > > > (Thread-3), pid 19223 (g.xbmc.kodi19DV)<br>
> > > > 01-28 10:13:31.191 19223 19243 D Kodi : OpenJDK 64-Bit<br>
> > Server VM<br>
> > > > warning: No monotonic clock was available - timed services may<br>
> > be<br>
> > > > adversely affected if the time-of-da<br>
> > > > 01-28 10:13:31.191 19223 19243 D Kodi : y clock changes<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : *** *** *** *** ***<br>
> > ***<br>
> > > > *** *** *** *** *** *** *** *** *** ***<br>
> > > > 01-28 10:13:31.475 19353 19353 W crash_dump64: type=1400<br>
> > > > audit(0.0:5353): avc: denied { search } for name="/"<br>
> > dev="tmpfs"<br>
> > > > ino=1336 scontext=u:r:crash_dump:s0:c132,c256,c512,c768<br>
> > > > tcontext=u:object_r:tmpfs:s0 tclass=dir permissive=0<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : Build fingerprint:<br>
> > > > <br>
> > 'NVIDIA/mdarcy/mdarcy:9/PPR1.180610.011/4079208_2513.0256:user/rele<br>
> > <br>
> > > > ase-keys'<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : Revision: '0'<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : ABI: 'arm64'<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : pid: 19223, tid:<br>
> > 19330,<br>
> > > > name: Thread-3 >>> org.xbmc.kodi19DV <<<<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : signal 11 (SIGSEGV),<br>
> > > > code 1 (SEGV_MAPERR), fault addr 0x0<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : Cause: null pointer<br>
> > > > dereference<br>
> > > > 01-28 10:13:31.478 19353 19353 F DEBUG : x0<br>
> > 0000000000000000<br>
> > > > x1 000000000000002f x2 fffffffffffffffe x3<br>
> > 0000000000000010<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x4<br>
> > 000000287a1b1222<br>
> > > > x5 000000007fffffff x6 0000000000000002 x7<br>
> > 0000000000000030<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x8<br>
> > 0000000000000000<br>
> > > > x9 0000000000000000 x10 0000000000000009 x11<br>
> > 00000000fffffff7<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x12<br>
> > 000000000000004c<br>
> > > > x13 00000000fffffff7 x14 0000002985757cb8 x15<br>
> > 000000000000004a<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x16<br>
> > 000000287a1af1d8<br>
> > > > x17 000000287a106fc8 x18 0000000000000001 x19<br>
> > 00000029220be800<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x20<br>
> > 0000002934ef7638<br>
> > > > x21 0000002985826000 x22 000000298583e914 x23<br>
> > 0000002985896000<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x24<br>
> > 9fb1c16ed01cfd15<br>
> > > > x25 0000002934ef78d8 x26 0000000000000007 x27<br>
> > 0000002934ef78d8<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : x28<br>
> > 00000029228e7c00<br>
> > > > x29 0000002934ef75d0<br>
> > > > 01-28 10:13:31.479 19353 19353 F DEBUG : sp<br>
> > 0000002934ef75d0<br>
> > > > lr 00000029854b423c pc 00000029854b423c<br>
> > > > 01-28 10:13:31.480 19353 19353 I unwind : Malformed section<br>
> > header<br>
> > > > found, ignoring...<br>
> > > > 01-28 10:13:31.480 19353 19353 F DEBUG : <br>
> > > > 01-28 10:13:31.480 19353 19353 F DEBUG : backtrace:<br>
> > > > 01-28 10:13:31.480 19353 19353 F DEBUG : #00 pc<br>
> > > > 00000000008a823c /mnt/expand/cab01563-bcca-48fa-a0bf-<br>
> > > > 0fbddaf9b192/app/org.xbmc.kodi19DV-<br>
> > > > TFUZwtqXJYBSjv0vIb1V4g==/lib/arm64/libjvm.so<br>
> > > > 01-28 10:13:31.499 6592 6600 W System : A resource failed to<br>
> > > > call release. <br>
> > > > <br>
> > > > Permission issue?<br>
> > > > <br>
> > > > On Wed, Jan 27, 2021 at 7:56 PM Petri Hintukainen < <br>
> > > > <a href="mailto:phintuka@users.sourceforge.net" target="_blank" rel="noreferrer">phintuka@users.sourceforge.net</a>> wrote:<br>
> > > > > ke, 2021-01-27 kello 19:43 -0300, Vitor Dall'Acqua kirjoitti:<br>
> > > > > > Ok I'm doing the stupid way of doing things because other<br>
> > way<br>
> > > > > every<br>
> > > > > > time I touch the code it fails.<br>
> > > > > > can you tell me why it's only loading the first entry?<br>
> > > > > > static const char all_libs[] = {"libawt",<br>
> > > > > <br>
> > > > > static const char * all_libs[] = {"libawt",<br>
> > > > > <br>
> > > > > > "libawt_headless",<br>
> > > > > > "libawt_xawt",<br>
> > > > > > "libdt_socket",<br>
> > > > > > "libfontmanager",<br>
> > > > > > "libhprof",<br>
> > > > > > "libinstrument",<br>
> > > > > > "libj2gss",<br>
> > > > > > "libj2pcsc",<br>
> > > > > > "libj2pkcs11",<br>
> > > > > > "libjaas_unix",<br>
> > > > > > "libjava",<br>
> > > > > > "libjava_crw_demo",<br>
> > > > > > "libjawt",<br>
> > > > > > "libjdwp",<br>
> > > > > > "libjli",<br>
> > > > > > "libjpeg",<br>
> > > > > > "libjsdt",<br>
> > > > > > "libjsig",<br>
> > > > > > "libjsound",<br>
> > > > > > "liblcms",<br>
> > > > > > "libmanagement",<br>
> > > > > > "libmlib_image",<br>
> > > > > > "libnet",<br>
> > > > > > "libnio",<br>
> > > > > > "libnpt",<br>
> > > > > > "libsctp",<br>
> > > > > > "libsunec",<br>
> > > > > > "libtinyiconv",<br>
> > > > > > "libunpack",<br>
> > > > > > "libverify",<br>
> > > > > > "ibzip",};<br>
> > > > > <br>
> > > > > "libzip" (?)<br>
> > > > > <br>
> > > > > > <br>
> > > > > > <br>
> > > > > > dl_dlopen(all_libs, NULL);<br>
> > > > > <br>
> > > > > dl_dlopen() opens only single library, you need to iterate<br>
> > over<br>
> > > > > all<br>
> > > > > libraries:<br>
> > > > > <br>
> > > > > for (size_t i = 0; i < sizeof(all_libs) /<br>
> > > > > sizeof(all_libs[0]); i++)<br>
> > > > > dl_dlopen(all_libs[i], NULL);<br>
> > > > > <br>
> > > > > > <br>
> > > > > > result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args);<br>
> > > > > <br>
> > > > > <br>
> > > > > _______________________________________________<br>
> > > > > libbluray-devel mailing list<br>
> > > > > <a href="mailto:libbluray-devel@videolan.org" target="_blank" rel="noreferrer">libbluray-devel@videolan.org</a><br>
> > > > > <a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer noreferrer" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
> > > _______________________________________________<br>
> > > libbluray-devel mailing list<br>
> > > <a href="mailto:libbluray-devel@videolan.org" target="_blank" rel="noreferrer">libbluray-devel@videolan.org</a><br>
> > > <a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer noreferrer" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
> > <br>
> > <br>
> > _______________________________________________<br>
> > libbluray-devel mailing list<br>
> > <a href="mailto:libbluray-devel@videolan.org" target="_blank" rel="noreferrer">libbluray-devel@videolan.org</a><br>
> > <a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer noreferrer" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
> _______________________________________________<br>
> libbluray-devel mailing list<br>
> <a href="mailto:libbluray-devel@videolan.org" target="_blank" rel="noreferrer">libbluray-devel@videolan.org</a><br>
> <a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer noreferrer" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
<br>
<br>
_______________________________________________<br>
libbluray-devel mailing list<br>
<a href="mailto:libbluray-devel@videolan.org" target="_blank" rel="noreferrer">libbluray-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer noreferrer" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
</blockquote></div>