×

JNI light: an operational model for the core JNI. (English) Zbl 1361.68068

Summary: 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.

MSC:

68N30 Mathematical aspects of software engineering (specification, verification, metrics, requirements, etc.)
68N15 Theory of programming languages
Full Text: DOI

References:

[1] ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) pp 331– (2002)
[2] DOI: 10.1145/503502.503505 · doi:10.1145/503502.503505
[3] ACM Transactions on Programming Languages and Systems 30 pp 1– (2008)
[4] DOI: 10.1145/514188.514189 · doi:10.1145/514188.514189
[5] Securing Java: Getting Down to Business with Mobile Code (1999)
[6] 32nd ACM Symposium on Principles of Programming Languages (POPL) pp 378– (2005)
[7] DOI: 10.1023/A:1025011624925 · Zbl 1031.68039 · doi:10.1023/A:1025011624925
[8] The Java Virtual Machine Specification (1999)
[9] Formal Syntax and Semantics of Java pp 241– (1999)
[10] Java Native Interface: Programmer’s Guide and Reference (1999)
[11] Formal Syntax and Semantics of Java pp 41– (1999)
[12] DOI: 10.1007/s10817-008-9099-0 · Zbl 1154.68039 · doi:10.1007/s10817-008-9099-0
[13] ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) pp 50– (2004)
[14] DOI: 10.1145/1390630.1390645 · doi:10.1145/1390630.1390645
[15] DOI: 10.1145/1146809.1146811 · doi:10.1145/1146809.1146811
[16] Journal of Functional Programming 12 pp 43– (2002)
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.