[Info-vax] JNI problem on I64

Arne Vajhøj arne at vajhoej.dk
Sat Jan 29 19:19:35 EST 2022


On 1/26/2022 11:53 AM, hb wrote:
> On 1/26/22 14:24, Arne Vajhøj wrote:
>> On 1/26/2022 4:50 AM, hb wrote:
>>> On 1/26/22 01:39, Arne Vajhøj wrote:
>>>> Code outline:
>>>>
>>>> ... (JNIEnv *cntx, jobject baobj)
>>>> ...
>>>> signed char *buf;
>>>> ...
>>>> buf = (*cntx)->GetByteArrayElements(cntx, baobj, NULL);
>>>> ...
>>>> ...
>>>> ...
>>>> (*cntx)->ReleaseByteArrayElements(cntx, baobj, buf, 0);
>>>>
>>>> VMS Alpha 8.4 with Java 1.5 : works fine
>>>>
>>>> VMS I64 8.4 with Java 8 : crashes (the output is attached below)
>>>> ...
>>>
>>> Just to make sure it isn't a 32-/64-bit problem: how do you compile? 
>>> Java 8 on VMS requires JNIs to use 64-bit pointers.
>>
>> I do use /pointer=64.
> 
> Although I never tried it from an JNI, I would add a 
> lib$signal(ss$_debug); and try to debug the JNI code.
> 
> The other option to debug a JNI is to find where and when Java "loads" 
> it. In Java 6 there was a Java$dlopen routine. In the debugger you could 
> set a break point at that routine and then watch for your JNI to be 
> "loaded". Once it is "loaded", you can do a "set image <your-jni>" and 
> set break points in your code.

Using the debugger is a lot more flexible than printf's.

But I am already printf'ing all the variable that I would
like to examine.

But cool trick.

Arne




More information about the Info-vax mailing list