Do not segfault if no common root can be found
authorMoritz Angermann <moritz.angermann@gmail.com>
Sun, 9 Oct 2016 22:17:46 +0000 (18:17 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 9 Oct 2016 22:17:51 +0000 (18:17 -0400)
commitbcd34451382e0d1b52ef82cb9d762e9d68bc0887
treea6fb65d1c1bb301df04a3f53afb63c4bbdff6006
parent7b060e12efbfed2f29136fd605f76e8d6ca79f85
Do not segfault if no common root can be found

When trying to profile a plugin, ghc mysteriously segfaulted.  Upon
closer examination the segfault happend due to a `->prevStack` lookup
on a NULL pointer.

A new CostCentre: Unknown is introduced that is set, if ccsapp and
ccsfn are of equal depth (e.g. 0), and do not have a common CostCentre
in their stacks.

Reviewers: bgamari, simonmar, austin, erikd

Reviewed By: simonmar

Subscribers: Phyx, thomie

Differential Revision: https://phabricator.haskell.org/D2551
rts/Linker.c