[foreign-abi] RFR: 8256080: AArch64: fatal error with unexpected intrinsic id _linkToNative

Jorn Vernee jvernee at openjdk.java.net
Wed Nov 11 13:22:11 UTC 2020


On Wed, 11 Nov 2020 13:05:43 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> I've changed the target branch to `foreign-abi`.
>> 
>> @JornVernee the stack trace looks like this:
>> 
>> V  [libjvm.so+0xeed41c]  MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*, vmIntrinsics::ID)+0x290
>> V  [libjvm.so+0xee4edc]  MethodHandlesAdapterGenerator::generate()+0x68
>> V  [libjvm.so+0xee4e30]  MethodHandles::generate_adapters()+0x130
>> V  [libjvm.so+0xab6954]  init_globals()+0xe4
>> V  [libjvm.so+0x121b424]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x34c
>> V  [libjvm.so+0xbd1120]  JNI_CreateJavaVM_inner(JavaVM_**, void**, void*)+0x100
>> V  [libjvm.so+0xbd1408]  JNI_CreateJavaVM+0x2c
>> 
>> `MethodHandlesAdapterGenerator::generate()` calls `MethodHandles::generate_method_handle_interpreter_entry()` once for each intrinsic ID. (I think the second change in `methodHandles_aarch64.cpp` is perhaps not strictly necessary.)
>> 
>> @mcimadamore The C2 crash should be fixed with the extra commit I pushed just now. We need to call `C->record_failure(..)` if the native invoker is not implemented otherwise a C2 assertion fails later.
>> 
>> TestIntrinsics.java was crashing because the `CallNative` opcode is not implemented. I've restricted this test to just x86 for now.
>> 
>> The failure of TestUpcallHighArity.java seems unrelated to linkToNative and this PR - I'll look at that separately.
>
>>  (I think the second change in methodHandles_aarch64.cpp is perhaps not strictly necessary.)
> It would be needed for AArch64, since we actually use native method handles on that platform, they just don't get intrinsified currently.
> 
> For other platforms it should not be needed, since we don't have a CLinker implementation for those yet.
> 
> Thanks, I'll push that fix to other platforms as well.

With that test requirement, the test also gets disabled on Mac, which is not what we want. You can add Mac as well using:

    @requires (os.arch == "x86_64") | (os.arch == "amd64")

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/391


More information about the panama-dev mailing list