Hostname: page-component-7b7567c8c-tnzcf Total loading time: 0 Render date: 2026-11-13T22:54:56.816Z Has data issue: false hasContentIssue false

JNI light: an operational model for the core JNI

Published online by Cambridge University Press:  10 November 2014

GANG TAN*
Affiliation:
Department of Computer Science and Engineering, Lehigh University, Bethlehem, Pennsylvania, U.S.A. Email: gtan@cse.lehigh.edu
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Through foreign function interfaces (FFIs), software components in different programming languages interact with each other in the same address space. Recent years have witnessed a number of systems that analyse FFIs for safety and reliability. However, lack of formal specifications of FFIs hampers progress in this endeavour. We present a formal operational model, Java Native Interface (JNI) light (JNIL), for a subset of a widely used FFI – the Java Native Interface (JNI). JNIL focuses on the core issues when a high-level garbage-collected language interacts with a low-level language. It proposes abstractions for handling a shared heap, cross-language method calls, cross-language exception handling, and garbage collection. JNIL can directly serve as a formal basis for JNI tools and systems. We demonstrate its utility by proving soundness of a system that checks native code in JNI programs for type-unsafe use of JNI functions. The abstractions in JNIL are also useful when modelling other FFIs, such as the Python/C interface and the OCaml/C interface.

Information

Type
Paper
Copyright
Copyright © Cambridge University Press 2014