Opened 4 years ago

Closed 4 years ago

#10656 closed feature request (fixed)

Ability to get stack traces from Haskell code

Reported by: bgamari Owned by: Tarrasch
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #3693 Differential Rev(s): Phab:D963
Wiki Page:

Description (last modified by bgamari)

With the merge of Phab:D169 and Phab:D396 (included in GHC 7.10.1, see #3693 for details) GHC now has the ability to produce DWARF debugging information in compiled binaries.

It would be nice if Haskell programs could request stack backtraces from the RTS. Tarrasch has some work in this direction in Phab:D963 however there are a number of questions that remain outstanding,

  • do we want to rely on an external library for parsing DWARF information? If so, how do we address portability concerns?
  • What should the Haskell-land interfaces look like? Writing down some concrete use-cases would help here.

Change History (5)

comment:1 Changed 4 years ago by bgamari

Description: modified (diff)

comment:2 Changed 4 years ago by Tarrasch

Thanks for the rescoping @bgmari! Once we've merged something like Phab:D963. Then we can create new tickets for (i) getting it to use DWARF and a ticket for (ii) giving stack traces to Haskell land exception handlers.

Phab:D963 does actually not even use the DWARF stuff. See the abandoned patch Phab:D662 for an implementation using that. Phab:D662 got abandoned since it did too much at once.

comment:3 Changed 4 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:4 Changed 4 years ago by Ben Gamari <ben@…>

In a6a3dabc/ghc:

Libdw: Add libdw-based stack unwinding

This adds basic support to the RTS for DWARF-assisted unwinding of the
Haskell and C stack via libdw. This only adds the infrastructure;
consumers of this functionality will be introduced in future diffs.

Currently we are carrying the initial register collection code in
Libdw.c but this will eventually make its way upstream to libdw.

Test Plan: See future patches

Reviewers: Tarrasch, scpmw, austin, simonmar

Reviewed By: austin, simonmar

Subscribers: simonmar, thomie, erikd

Differential Revision: https://phabricator.haskell.org/D1196

GHC Trac Issues: #10656

comment:5 Changed 4 years ago by bgamari

Resolution: fixed
Status: newclosed

This has been addressed in Phab:D1196.

Note: See TracTickets for help on using tickets.