Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/330908.331884acmconferencesArticle/Chapter ViewAbstractPublication PagessigcseConference Proceedingsconference-collections
Article
Free access

Checkmate: cornering C++ dynamic memory errors with checked pointers

Published: 01 March 2000 Publication History

Abstract

Pointer errors are stumbling blocks for student and veteran programmers alike. Although languages such as Java use references to protect programmers from pointer pitfalls, the use of garbage collection dictates that languages like C++ will still be used for real-time mission-critical applications. Pointers will stay in the classroom as long as they're used in industry, so as educators, we must find better ways to teach them. This paper presents checked pointers, a simple wrapper for C++ pointers that prevents pointer arithmetic and other common sources of pointer errors, and detects all dereferencing and deallocation errors, including memory leaks. The syntax of checked pointers is highly faithful to raw C++ pointers, but provides run-time error detection and debugging information. After debugging, changing one #include is all that is required to substitute a non-checking implementation that is as fast as raw C++.

References

[1]
Edwards, S.H., Shakir, G., Sitaraman, M., Weide, B.W., and Hollingsworth, J.E. A framework for detecting interface violations in component-based software. In Proc. 5th Intl. Conf. on Software Reuse, IEEE, June 1998, 46-55.
[2]
Evans, D. Static detection of dynamic memory errors. In Proc. PLDI '96, ACM, 1996, 44-53.
[3]
Ginter, A. Cooperative Garbage Collectors Using Smart Pointers in the C++ Programming Language. Technical report 1991-461-45, Department of Computer Science, University of Calgary, 1991.
[4]
Harms, D E., and Weide, B W. Copying and swapping: influences on the design of reusable software components. IEEE Transactions on Software Engineering 17, 5 (May 1991), 424-435.
[5]
Hastings, R. and Joyce, R. Purify: fast detection of memory leaks and access errors. In Proc. Winter Usenix Conf., Usenix Association, 1992.
[6]
Java JDK License Agreement (http://java.sun.com/products/jdk/1.1/LICENSE), downloaded 10 Sep 1999.
[7]
Lowrey, F. Examining the WIN32 debug API. Dr. Dobb's Journal, Nov. 1998, 58-64.
[8]
Stroustrup, B. The C++ Programming Language. Addison-Wesley, third edition, 1997.
[9]
Toronto Globe and Mail, 12 Apr 1997 (hUp://www.globeandmail.ca/) (Referenced from http://catless.ncl.ac.uk/Risks/19.09.html#subj 1.1).
[10]
Wall Street Journal, 17 Jun 1998 (Referenced from http:llcatless.ncl.ac.ukIRisksl19.82.html#subj2.1).

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
SIGCSE '00: Proceedings of the thirty-first SIGCSE technical symposium on Computer science education
May 2000
429 pages
ISBN:1581132131
DOI:10.1145/330908
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: 01 March 2000

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

SIGCSE00
Sponsor:

Acceptance Rates

SIGCSE '00 Paper Acceptance Rate 78 of 220 submissions, 35%;
Overall Acceptance Rate 1,595 of 4,542 submissions, 35%

Upcoming Conference

SIGCSE TS 2025
The 56th ACM Technical Symposium on Computer Science Education
February 26 - March 1, 2025
Pittsburgh , PA , USA

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)68
  • Downloads (Last 6 weeks)10
Reflects downloads up to 14 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Common C++ Pointer Misconceptions: Essence and TreatmentJournal of Computing Sciences in Colleges10.5555/3636988.363700739:3(76-85)Online publication date: 1-Oct-2023
  • (2023)An Object Tuple Model for Understanding Pointer and Array in C LanguageIEEE Transactions on Education10.1109/TE.2023.323602766:4(318-329)Online publication date: Aug-2023
  • (2014)DerefereeSoftware—Practice & Experience10.1002/spe.218444:8(973-997)Online publication date: 1-Aug-2014
  • (2009)Precise garbage collection for CProceedings of the 2009 international symposium on Memory management10.1145/1542431.1542438(39-48)Online publication date: 19-Jun-2009
  • (2009)DerefereeACM SIGCSE Bulletin10.1145/1539024.150892841:1(173-177)Online publication date: 4-Mar-2009
  • (2009)DerefereeProceedings of the 40th ACM technical symposium on Computer science education10.1145/1508865.1508928(173-177)Online publication date: 4-Mar-2009
  • (2007)Which pointer errors do students make?ACM SIGCSE Bulletin10.1145/1227504.122731739:1(9-13)Online publication date: 7-Mar-2007
  • (2007)Which pointer errors do students make?Proceedings of the 38th SIGCSE technical symposium on Computer science education10.1145/1227310.1227317(9-13)Online publication date: 7-Mar-2007
  • (2007)Abstracting Pointers for a Verifying Compiler31st IEEE Software Engineering Workshop (SEW 2007)10.1109/SEW.2007.89(204-213)Online publication date: Mar-2007
  • (2005)A specification-based approach to reasoning about pointersProceedings of the 2005 conference on Specification and verification of component-based systems10.1145/1123058.1123066(7-es)Online publication date: 5-Sep-2005
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media