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>
Mon, 10 Oct 2016 13:59:45 +0000 (09:59 -0400)
commitec05551392aeb39b42d1a529fac32b1f795f29b0
tree85ccc0c3bb7c04ae83ca8ac5a386c49bb17e393d
parentb08ffec0aa9cf88ff47fd71d0c6e61d3a31d7b0d
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

(cherry picked from commit bcd34451382e0d1b52ef82cb9d762e9d68bc0887)
rts/Linker.c