Fortifying the Seams Between C/C++ and Rust: Characterizing Bugs in Interop Tools

Rust has become increasingly popular in recent years due to its safety and high performance. Despite these advantages, Rust projects rarely start from scratch in practice, and many Rust-based systems instead use hybrid programming, where Rust interoperates with existing C/C++ code. To reduce the manual effort involved in this interoperation (interop) process, several interop tools have been proposed to facilitate hybrid programming between Rust and C/C++. However, the challenges and limitations of these tools remain largely unexplored, leaving developers unclear about the future directions and users unclear about the appropriate usage scenarios. To fill the gap, we mined 320 bugs in the popular interop tools, i.e., Bindgen , Cbindgen , and CXX . We observe that the main obstacle is not tool crashes or performance issues, but the inability to generate correct and functional code. The leading types of the failures are generating code that is unfaithful to the original code's intent and generating incomplete code. Memory layout mismatch is the most common cause with Bindgen . Input with complex struct is the biggest challenge across tools, followed by the usage with specific tool configuration options for customized binding generation. Even input with primitive data types can be problematic. We also observe a common fix pattern that updates the control flow and condition. Based on our findings, we propose a series of suggestions to developers, users, and future researchers. For example, we suggest the developers validate configuration combinations, provide clearer documentation, and implement default-safe mechanisms to prevent failures related to unexpected tool configuration options.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-02-03
DOI
https://doi.org/10.1145/3795532
Primary Topic
Logic, programming, and type systems
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fortifying the Seams Between C/C++ and Rust: Characterizing Bugs in Interop Tools

Lingxiao Jiang, Xuemeng Cai, Jiakun Liu, Cunyang Liu et al.
ACM Transactions on Software Engineering and Methodology
Logic, programming, and type systems
article

Fortifying the Seams Between C/C++ and Rust: Characterizing Bugs in Interop Tools

Lingxiao Jiang, Xuemeng Cai, Jiakun Liu, Cunyang Liu, Yijun Yu, Lingfeng Bao
article en

Abstract

Rust has become increasingly popular in recent years due to its safety and high performance. Despite these advantages, Rust projects rarely start from scratch in practice, and many Rust-based systems instead use hybrid programming, where Rust interoperates with existing C/C++ code. To reduce the manual effort involved in this interoperation (interop) process, several interop tools have been proposed to facilitate hybrid programming between Rust and C/C++. However, the challenges and limitations of these tools remain largely unexplored, leaving developers unclear about the future directions and users unclear about the appropriate usage scenarios. To fill the gap, we mined 320 bugs in the popular interop tools, i.e., Bindgen , Cbindgen , and CXX . We observe that the main obstacle is not tool crashes or performance issues, but the inability to generate correct and functional code. The leading types of the failures are generating code that is unfaithful to the original code's intent and generating incomplete code. Memory layout mismatch is the most common cause with Bindgen . Input with complex struct is the biggest challenge across tools, followed by the usage with specific tool configuration options for customized binding generation. Even input with primitive data types can be problematic. We also observe a common fix pattern that updates the control flow and condition. Based on our findings, we propose a series of suggestions to developers, users, and future researchers. For example, we suggest the developers validate configuration combinations, provide clearer documentation, and implement default-safe mechanisms to prevent failures related to unexpected tool configuration options.

ACM Transactions on Software Engineering and Methodology
The Open University (GB), Harbin Institute of Technology (CN), Zhejiang University (CN), Singapore Management University (SG)
Openalex Percentile: Top 70%
Logic, programming, and type systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.