Java Silent Fail
Sparse Way
support at sparseway.com
Tue Feb 26 21:50:05 UTC 2019
Nothing changes using -fPIE -pie flags, still the process's output stream is empty.
Snippet used to make process:
ProcessBuilder pb = new ProcessBuilder("./java", "-Djava.home=" + jre, "-version");
Map<String, String> env = pb.environment();
env.put("LD_LIBRARY_PATH", jre + "/lib/jli:" + jre
+ "/lib:" + jre + "/lib/server:$LD_LIBRARY_PATH");
pb.directory(new File(jre + "/bin"));
Process process = pb.start();
process.waitFor();
________________________________
From: Sparse Way
Sent: Tuesday, February 26, 2019 10:33 PM
To: Bob Vandette; gary.adams at oracle.com
Cc: mobile-dev at openjdk.java.net
Subject: Re: Java Silent Fail
Testing on api 22 device, build minimum api is 19.
________________________________
From: Sparse Way
Sent: Tuesday, February 26, 2019 10:30 PM
To: Bob Vandette; gary.adams at oracle.com
Cc: mobile-dev at openjdk.java.net
Subject: Re: Java Silent Fail
Already set paths after they were reported missing.
When invoking ./java from process within the application, it ignores any arguments returning 6 as an exit value.
I've missed the CFLAG -fPIE -pie, maybe that's the issue.
________________________________
From: Bob Vandette <bob.vandette at oracle.com>
Sent: Tuesday, February 26, 2019 9:57 PM
To: gary.adams at oracle.com
Cc: Sparse Way; mobile-dev at openjdk.java.net
Subject: Re: Java Silent Fail
To run on the command line, I used to have to set the LD_LIBRARY_PATH environment
variable to the paths containing the shared libraries.
export LD_LIBRARY_PATH=/data/app/jre/lib/arm:/data/app/jre/lib/arm/jli:/data/app/jre/lib/arm/{minimal or client}
Bob.
> On Feb 26, 2019, at 2:50 PM, Gary Adams <gary.adams at oracle.com> wrote:
>
> Don't worry about the "unused DT entry" warnings.
> Those are just VERNEED entries in the libraries,
> that are not used on android.
>
> I presume the executable and libraries are installed OK,
> since the warnings below indicate they were found.
>
> I assume the target android api is compatible with the
> runtime device or emulator you are using.
>
> Note that the use of java on the command line (adb shell)
> is just a smoke test that the build was complete.
> The real test of the libraries is when they've been
> incorporated in an apk and installed as an app.
>
>
> On 2/26/19, 2:27 PM, Sparse Way wrote:
>> Hello,
>>
>> ./java -Djava.home=/data/app/jre -version
>>
>> Running this on android armv7a doesn't produce any output, the arguments are ignored as replacing them with invalid ones will make no difference.
>> The process exits with value 6, the input stream (process's stdout) is empty.
>>
>> It would be nice to have debug flag or maybe a debug build variant.
>>
>> Error stream buffer:
>> WARNING: linker: ./java: unused DT entry: type 0x6ffffffe arg 0x3a8
>> WARNING: linker: ./java: unused DT entry: type 0x6fffffff arg 0x2
>> WARNING: linker: libjli.so: unused DT entry: type 0x6ffffffe arg 0xf00
>> WARNING: linker: libjli.so: unused DT entry: type 0x6fffffff arg 0x2
>> WARNING: linker: ./java: unused DT entry: type 0x6ffffffe arg 0x3a8
>> WARNING: linker: ./java: unused DT entry: type 0x6fffffff arg 0x2
>> WARNING: linker: libjli.so: unused DT entry: type 0x6ffffffe arg 0xf00
>> WARNING: linker: libjli.so: unused DT entry: type 0x6fffffff arg 0x2
>> WARNING: linker: libjvm.so: unused DT entry: type 0x6ffffffe arg 0x472c
>> WARNING: linker: libjvm.so: unused DT entry: type 0x6fffffff arg 0x3
>>
>> Back bash configure produced warning which I ignored:
>>
>> The following warnings were produced. Repeated here for convenience:
>> WARNING: using cross tools not prefixed with host triplet
>> WARNING: Unknown autoconf target triplet ABI: "androideabi"
>>
>> Plus I am not sure if using arm-linux-gnueabihf for arm build is obligatory so didn't use it.
>
More information about the mobile-dev
mailing list