TY - GEN
T1 - Finding reference-counting errors in Python/C programs with affine analysis
AU - Li, Siliang
AU - Tan, Gang
PY - 2014
Y1 - 2014
N2 - Python is a popular programming language that uses reference counting to manage heap objects. Python also has a Foreign Function Interface (FFI) that allows Python extension modules to be written in native code such as C and C++. Native code, however, is outside Python's system of memory management; therefore extension programmers are responsible for making sure these objects are reference counted correctly. This is an error prone process when code becomes complex. In this paper, we propose Pungi, a system that statically checks whether Python objects' reference counts are adjusted correctly in Python/C interface code. Pungi transforms Python/C interface code into affine programs with respect to our proposed abstractions of reference counts. Our system performs static analysis on transformed affine programs and reports possible reference counting errors. Our prototype implementation found over 150 errors in a set of Python/C programs.
AB - Python is a popular programming language that uses reference counting to manage heap objects. Python also has a Foreign Function Interface (FFI) that allows Python extension modules to be written in native code such as C and C++. Native code, however, is outside Python's system of memory management; therefore extension programmers are responsible for making sure these objects are reference counted correctly. This is an error prone process when code becomes complex. In this paper, we propose Pungi, a system that statically checks whether Python objects' reference counts are adjusted correctly in Python/C interface code. Pungi transforms Python/C interface code into affine programs with respect to our proposed abstractions of reference counts. Our system performs static analysis on transformed affine programs and reports possible reference counting errors. Our prototype implementation found over 150 errors in a set of Python/C programs.
UR - http://www.scopus.com/inward/record.url?scp=84905407178&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84905407178&partnerID=8YFLogxK
U2 - 10.1007/978-3-662-44202-9_4
DO - 10.1007/978-3-662-44202-9_4
M3 - Conference contribution
AN - SCOPUS:84905407178
SN - 9783662442012
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 80
EP - 104
BT - ECOOP 2014 - Object-Oriented Programming
PB - Springer Verlag
T2 - 28th European Conference on Object-Oriented Programming, ECOOP 2014
Y2 - 28 July 2014 through 1 August 2014
ER -