Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2491894.2464162acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
research-article

Analyzing memory ownership patterns in C libraries

Published: 20 June 2013 Publication History

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.

References

[1]
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.
[2]
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.
[3]
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.
[4]
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.
[5]
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.
[6]
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.
[7]
U. P. Khedker, A. Sanyal, and A. Karkare. Heap reference analysis using access graphs. ACM Trans. Program. Lang. Syst., 30 (1), 2007.
[8]
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.
[9]
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.
[10]
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.
[11]
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.
[12]
P. Müller and A. Rudich. Ownership transfer in universe types. IncitetDBLP:conf/oopsla/2007, pages 461--478. ISBN 978-1-59593-786-5.
[13]
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.
[14]
T. E. Oliphant. Python for scientific computing. Computing in Science and Engineering, 9 (3): 10--20, 2007.
[15]
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.
[16]
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.
[17]
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.
[18]
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.
[19]
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.
[20]
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.
[21]
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.

Cited By

View all
  • (2019)Towards seamless interfacing between dynamic languages and native codeProceedings of the 11th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages10.1145/3358504.3361230(38-47)Online publication date: 22-Oct-2019
  • (2016)Array length inference for C library bindingsProceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering10.1145/2970276.2970310(461-471)Online publication date: 25-Aug-2016
  • (2015)Automatic array property detection via static analysisCompanion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity10.1145/2814189.2815367(69-70)Online publication date: 25-Oct-2015
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ISMM '13: Proceedings of the 2013 international symposium on memory management
June 2013
140 pages
ISBN:9781450321006
DOI:10.1145/2491894
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 June 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. allocators
  2. bindings
  3. dataflow analysis
  4. escape analysis
  5. finalizers
  6. foreign function interfaces (ffis)
  7. interoperability
  8. interprocedural static program analysis
  9. libraries
  10. memory allocation
  11. ownership transfer
  12. polyglot programming
  13. reference counting
  14. resource lifetime management
  15. sharing

Qualifiers

  • Research-article

Conference

ISMM '13
Sponsor:
ISMM '13: International Symposium on Memory Management
June 20 - 21, 2013
Washington, Seattle, USA

Acceptance Rates

ISMM '13 Paper Acceptance Rate 11 of 22 submissions, 50%;
Overall Acceptance Rate 72 of 156 submissions, 46%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Towards seamless interfacing between dynamic languages and native codeProceedings of the 11th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages10.1145/3358504.3361230(38-47)Online publication date: 22-Oct-2019
  • (2016)Array length inference for C library bindingsProceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering10.1145/2970276.2970310(461-471)Online publication date: 25-Aug-2016
  • (2015)Automatic array property detection via static analysisCompanion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity10.1145/2814189.2815367(69-70)Online publication date: 25-Oct-2015
  • (2015)Mutation-based fault localization for real-world multilingual programsProceedings of the 30th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2015.14(464-475)Online publication date: 9-Nov-2015

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media