Skip to content

void dumpHeap(String, boolean) is called via CallObjectMethodA and not CallVoidMethodAΒ #18

@schmelter-sap

Description

@schmelter-sap

Hi,

I'm currently investigating a case where the heap dump was not written by the jvmkill agent. The problem is that the dumpHeap() method fails and I get an error of the form:

HeapDump action failed: JNI call failed: call to method_id 0x0... on object 0x0... with variable arguments "<path>", 1 failed

First I though that this would be caused by an exception during the call to dumpHeap(), but then there should be the exception message included too. But as I inspected the code more closely, I found that the void method dumpHeap() is called via CallObjectMethodA, which is reserved for method which return objects:

jni_env.call_object_method_with_cstring_jboolean(hotspot_diagnostic_mxbean, dump_heap_method_id, resolved_heap_dump_path_cstring.clone(), ::jvmti::JNI_TRUE as u8)?;

And since you check if the 'result' of the CallObjectMethodA call is null (and treat that as an error), the error may be just caused by the random value in the register used to return values?

Best regards,
Ralf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions