Skip to content

Missing field leads to JVM crash #84

@alamar

Description

@alamar

HawtJNI uses pattern of

SetStaticFooField(that, GetStaticFooFieldId("T", "FIELDNAME"))

In case of JNI library / Java class version mismatch, FIELDNAME might be absent in class being initialized. Then get field id method will return NULL and set static field method will crash JVM for good.

Jansi is notorious for being shaded without announcement (by JLine, etc) and presenting conflicting versions of code in classpath. This may cause JVM crashes very easily and depending on classpath ordering may not even be deterministic. Luckily it will usually happen on start, but when hawtjni is used for something else it will readily crash JVMs in-flight.

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