Serviceeinschränkungen vom 12.-22.02.2026 - weitere Infos auf der UB-Homepage

Treffer: Checking Type Safety of Foreign Function Calls

Title:
Checking Type Safety of Foreign Function Calls
Source:
ACM transactions on programming languages and systems. 30(4)
Publisher Information:
New York, NY: Association for Computing Machinery, 2008.
Publication Year:
2008
Physical Description:
print, 1 p.1/2
Original Material:
INIST-CNRS
Subject Terms:
Computer science, Informatique, Sciences exactes et technologie, Exact sciences and technology, Sciences appliquees, Applied sciences, Informatique; automatique theorique; systemes, Computer science; control theory; systems, Logiciel, Software, Langages de programmation, Programming languages, Organisation des mémoires. Traitement des données, Memory organisation. Data processing, Gestion des mémoires et des fichiers (y compris la protection et la sécurité des fichiers), Memory and file management (including protection and security), Accès contenu, Content access, Acceso contenido, Chaîne caractère, Character string, Cadena carácter, Concordance forme, Pattern matching, Empaqueteur, Wrapper, Envolvero, Estimation erreur, Error estimation, Estimación error, Flux donnée, Data flow, Flujo datos, Gestion mémoire, Storage management, Gestión memoria, Inférence, Inference, Inferencia, Langage JAVA, JAVA language, Lenguaje JAVA, Langage OCaml, OCaml language, Lenguaje OCaml, Langage programmation, Programming language, Lenguaje programación, Modélisation, Modeling, Modelización, Multilinguisme, Multilingualism, Multilingüismo, Pointeur, Pointer, Marcador, Polymorphisme, Polymorphism, Polimorfismo, Ramasse-miettes, Garbage collector, Recogemigas, Ramification, Branching, Ramificación, Sécurité, Safety, Seguridad, Théorie type, Type theory, Unification, Unificación, Vérification programme, Program verification, Verificación programa, FFI, JNI, Java Native Interface, Java, Languages, OCaml, Verification Foreign function interface, dataflow analysis, flow-sensitive type system, foreign function calls, multilingual type inference, multilingual type system, representational type
Document Type:
Fachzeitschrift Article
File Description:
text
Language:
English
Author Affiliations:
University of Maryland, College Park, United States
ISSN:
0164-0925
Rights:
Copyright 2009 INIST-CNRS
CC BY 4.0
Sauf mention contraire ci-dessus, le contenu de cette notice bibliographique peut être utilisé dans le cadre d’une licence CC BY 4.0 Inist-CNRS / Unless otherwise stated above, the content of this bibliographic record may be used under a CC BY 4.0 licence by Inist-CNRS / A menos que se haya señalado antes, el contenido de este registro bibliográfico puede ser utilizado al amparo de una licencia CC BY 4.0 Inist-CNRS
Notes:
Computer science; theoretical automation; systems
Accession Number:
edscal.20625520
Database:
PASCAL Archive

Weitere Informationen

Foreign function interfaces (FFIs) allow components in different languages to communicate directly with each other. While FFIs are useful, they often require writing tricky low-level code and include little or no static safety checking, thus providing a rich source of hard-to-find programming errors. In this article, we study the problem of enforcing type safety across the OCaml-to-C FFI and the Java Native Interface (JNI). We present O-Saffire and J-Saffire, a pair of multilingual type inference systems that ensure C code that uses these FFIs accesses high-level data safely. Our inference systems use representational types to model C's low-level view of OCaml and Java values, and singleton types to track integers, strings, memory offsets, and type tags through C. J-Saffire, our Java system, uses a polymorphic flow-insensitive, unification-based analysis. Polymorphism is important because it allows us to precisely model user-defined wrapper functions and the more than 200 JNI functions. O-Saffire, our OCaml system, uses a monomorphic flow-sensitive analysis because, while polymorphism is much less important for the OCaml FFI flow-sensitivity is critical to track conditional branches, which are used when pattern matching OCaml data in C. O-Saffire also tracks garbage collection information to ensure that local C pointers to the OCaml heap are registered properly, which is not necessary for the JNI. We have applied O-Saffire and J-Saffire to a set of benchmarks and found many bugs and questionable coding practices. These results suggest that static checking of FFIs can be a valuable tool in writing correct multilingual software.