Abstract
Programs written in multiple languages are known as polyglot programs. In part due to the proliferation of new and productive high-level programming languages, these programs are becoming more common in environments that must interoperate with existing systems. Polyglot programs must manage resource lifetimes across language boundaries. Resource lifetime management bugs can lead to leaks and crashes, which are more difficult to debug in polyglot programs than monoglot programs.
We present analyses to automatically infer the ownership semantics of C libraries. The results of these analyses can be used to generate bindings to C libraries that intelligently manage resources, to check the correctness of polyglot programs, and to document the interfaces of C libraries. While these analyses are unsound and incomplete, we demonstrate that they significantly reduce the manual annotation burden for a suite of fifteen open source libraries.
- C. Boyapati, B. Liskov, and L. Shrira. Ownership types for object encapsulation. In A. Aiken and G. Morrisett, editors, POPL, pages 213--223. ACM, 2003. ISBN 1-58113-628-5. Google Scholar
Digital Library
- B.-C. Cheng and W. W. Hwu. Modular interprocedural pointer analysis using access paths: design, implementation, and evaluation. In M. S. Lam, editor, PLDI, pages 57--69. ACM, 2000. ISBN 1-58113-199-2. Google Scholar
Digital Library
- J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Stack allocation and synchronization optimizations for Java using escape analysis. ACM Trans. Program. Lang. Syst., 25 (6): 876--910, 2003. Google Scholar
Digital Library
- M. Emmi, R. Jhala, E. Kohler, and R. Majumdar. Verifying reference counting implementations. In S. Kowalewski and A. Philippou, editors, TACAS, volume 5505 of Lecture Notes in Computer Science, pages 352--367. Springer, 2009. ISBN 978-3-642-00767-5. Google Scholar
Digital Library
- R. P. Gabriel, D. F. Bacon, C. V. Lopes, and G. L. S. Jr., editors. Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2007, October 21-25, 2007, Montreal, Quebec, Canada, 2007. ACM. ISBN 978-1-59593-786-5. Google Scholar
- D. L. Heine and M. S. Lam. A practical flow-sensitive and contextsensitive C and C++ memory leak detector. In PLDI, pages 168--181. ACM, 2003. ISBN 1-58113-662-5. Google Scholar
Digital Library
- U. P. Khedker, A. Sanyal, and A. Karkare. Heap reference analysis using access graphs. ACM Trans. Program. Lang. Syst., 30 (1), 2007. Google Scholar
Digital Library
- C. Lattner and V. S. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In CGO, pages 75--88. IEEE Computer Society, 2004. ISBN 0-7695-2102-9. Google Scholar
Digital Library
- L. Li, C. Cifuentes, and N. Keynes. Boosting the performance of flow-sensitive points-to analysis using value flow. In T. Gyimóthy and A. Zeller, editors, SIGSOFT FSE, pages 343--353. ACM, 2011. ISBN 978-1-4503-0443--6. Google Scholar
Digital Library
- K.-K. Ma and J. S. Foster. Inferring aliasing and encapsulation properties for Java. IncitetDBLP:conf/oopsla/2007, pages 423--440. ISBN 978-1-59593-786-5. Google Scholar
Digital Library
- I. Matosevic and T. S. Abdelrahman. Efficient bottom-up heap analysis for symbolic path-based data access summaries. In C. Eidt, A. M. Holler, U. Srinivasan, and S. P. Amarasinghe, editors, CGO, pages 252--263. ACM, 2012. ISBN 978-1-4503-1206-6. Google Scholar
Digital Library
- P. Müller and A. Rudich. Ownership transfer in universe types. IncitetDBLP:conf/oopsla/2007, pages 461--478. ISBN 978-1-59593-786-5. Google Scholar
Digital Library
- S. Negara, R. K. Karmani, and G. A. Agha. Inferring ownership transfer for efficient message passing. In C. Cascaval and P.-C. Yew, editors, PPOPP, pages 81--90. ACM, 2011. ISBN 978-1-4503-0119-0. Google Scholar
Digital Library
- T. E. Oliphant. Python for scientific computing. Computing in Science and Engineering, 9 (3): 10--20, 2007. Google Scholar
Digital Library
- D. J. Pearce, P. H. J. Kelly, and C. Hankin. Efficient field-sensitive pointer analysis of c. ACM Trans. Program. Lang. Syst., 30 (1), 2007. Google Scholar
Digital Library
- T. Ravitch, S. Jackson, E. Aderhold, and B. Liblit. Automatic Generation of Library Bindings using Static Analysis. In M. Hind and A. Diwan, editors, PLDI, pages 352--362. ACM, 2009. ISBN 978-1-60558-392-1. Google Scholar
Digital Library
- D. Rayside and L. Mendel. Object ownership profiling: a technique for finding and fixing memory leaks. In R. E. K. Stirewalt, A. Egyed, and B. Fischer, editors, ASE, pages 194--203. ACM, 2007. ISBN 978-1-59593-882-4. Google Scholar
Digital Library
- S. Sagiv, T. W. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. ACM Trans. Program. Lang. Syst., 24 (3): 217--298, 2002. Google Scholar
Digital Library
- A. Salcianu and M. C. Rinard. Pointer and escape analysis for multithreaded programs. In M. T. Heath and A. Lumsdaine, editors, PPOPP, pages 12--23. ACM, 2001. ISBN 1-5811--346-4. Google Scholar
Digital Library
- M. Wegiel and C. Krintz. Cross-language, Type-safe, and Transparent Object Sharing for co-Located Managed Runtimes. In W. R. Cook, S. Clarke, and M. C. Rinard, editors, OOPSLA, pages 223--240. ACM, 2010. ISBN 978-1-4503-0203-6. Google Scholar
Digital Library
- J. Whaley and M. C. Rinard. Compositional pointer and escape analysis for Java programs. In B. Hailpern, L. M. Northrop, and A. M. Berman, editors, OOPSLA, pages 187--206. ACM, 1999. ISBN 1-58113-238-7. Google Scholar
Digital Library
Index Terms
Analyzing memory ownership patterns in C libraries
Recommendations
Automatic generation of library bindings using static analysis
PLDI '09: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and ImplementationHigh-level languages are growing in popularity. However, decades of C software development have produced large libraries of fast, time-tested, meritorious code that are impractical to recreate from scratch. Cross-language bindings can expose low-level C ...
Analyzing memory ownership patterns in C libraries
ISMM '13: Proceedings of the 2013 international symposium on memory managementPrograms written in multiple languages are known as polyglot programs. In part due to the proliferation of new and productive high-level programming languages, these programs are becoming more common in environments that must interoperate with existing ...
Analyzing memory ownership patterns in C libraries
ISMM '13: Proceedings of the 2013 international symposium on memory managementPrograms written in multiple languages are known as polyglot programs. In part due to the proliferation of new and productive high-level programming languages, these programs are becoming more common in environments that must interoperate with existing ...







Comments