skip to main content
10.1145/1596638.1596654acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Finding the needle: stack traces for GHC

Published:03 September 2009Publication History

ABSTRACT

Even Haskell programs can occasionally go wrong. Programs calling head on an empty list, and incomplete patterns in function definitions can cause program crashes, reporting little more than the precise location where error was ultimately called. Being told that one application of the head function in your program went wrong, without knowing which use of head went wrong can be infuriating. We present our work on adding the ability to get stack traces out of GHC, for example that our crashing head was used during the evaluation of foo, which was called during the evaluation of bar, during the evaluation of main. We provide a transformation that converts GHC Core programs into ones that pass a stack around, and a stack library that ensures bounded heap usage despite the highly recursive nature of Haskell. We call our extension to GHC StackTrace.

Skip Supplemental Material Section

Supplemental Material

findingtheneedle.mp4

mp4

105.7 MB

References

  1. T. Allwood, S. P. Jones, and S. Eisenbach. Explicit call stack paper resources. http://code.haskell.org/explicitCallStackPaper/.Google ScholarGoogle Scholar
  2. A. Gill and C. Runciman. Haskell program coverage. In G. Keller, editor, Haskell, pages 1--12. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. U. Guide. The ghci debugger. http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-debugger.h%tml.Google ScholarGoogle Scholar
  4. S. P. Jones and P. Wadler. A static semantics for haskell. Draft paper, Glasgow, 91.Google ScholarGoogle Scholar
  5. S. Marlow, J. Iborra, B. Pope, and A. Gill. A lightweight interactive debugger for haskell. In G. Keller, editor, Haskell, pages 13--24. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Meacham. Jhc. http://repetae.net/computer/jhc/jhc.shtml.Google ScholarGoogle Scholar
  7. W. Partain. The nofib benchmark suite of haskell programs. In J. Launchbury and P. M. Sansom, editors, Functional Programming, Workshops in Computing, pages 195--202. Springer, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Sansom and S. Peyton Jones. Formally based profiling for higher-order functional languages. ACM Transactions on Programming Langauges and Systems, 19(1), 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Sulzmann, M. M. T. Chakravarty, S. L. P. Jones, and K. Donnelly. System F with type equality coercions. In F. Pottier and G. C. Necula, editors, TLDI, pages 53--66. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Trac. Annotations. http://hackage.haskell.org/trac/ghc/wiki/Annotations.Google ScholarGoogle Scholar
  11. M. Wallace, O. Chitil, T. Brehm, and C. Runciman. Multiple-view tracing for Haskell: a new Hat. In R. Hinze, editor, Preliminary Proceedings of the 2001 ACM SIGPLAN Haskell Workshop, pages 151--170, Firenze, Italy, Sept. 2001. Universiteit Utrecht UU-CS-2001-23. Final proceedings to appear in ENTCS 59(2).Google ScholarGoogle Scholar

Index Terms

  1. Finding the needle: stack traces for GHC

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      Haskell '09: Proceedings of the 2nd ACM SIGPLAN symposium on Haskell
      September 2009
      148 pages
      ISBN:9781605585086
      DOI:10.1145/1596638

      Copyright © 2009 ACM

      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]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 3 September 2009

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate57of143submissions,40%

      Upcoming Conference

      ICFP '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader