diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2018-11-19 11:34:13 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2018-11-19 11:34:27 +0000 |
commit | 7e570676bd0a57f8a77e5577d9f27e2d3159193e (patch) | |
tree | 6591386b2ec8f473a40a2925b28ea17675d89435 | |
parent | 348ea161a9a5957f30eb3dc61726850ecf00134d (diff) | |
download | haskell-7e570676bd0a57f8a77e5577d9f27e2d3159193e.tar.gz |
eventlog: Log the current stack size when stack overflows
Reviewers: maoe, bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, carter, sjorn3
Differential Revision: https://phabricator.haskell.org/D5287
-rw-r--r-- | rts/Schedule.c | 6 | ||||
-rw-r--r-- | rts/Trace.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index 54ebb43eef..eb9203f783 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -492,7 +492,11 @@ run_thread: traceEventStopThread(cap, t, t->why_blocked + 6, 0); } } else { - traceEventStopThread(cap, t, ret, 0); + if (ret == StackOverflow) { + traceEventStopThread(cap, t, ret, t->tot_stack_size); + } else { + traceEventStopThread(cap, t, ret, 0); + } } ASSERT_FULL_CAPABILITY_INVARIANTS(cap,task); diff --git a/rts/Trace.c b/rts/Trace.c index 5abd1d9596..4475054509 100644 --- a/rts/Trace.c +++ b/rts/Trace.c @@ -218,6 +218,11 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag, if (info1 == 6 + BlockedOnBlackHole) { debugBelch("cap %d: thread %" FMT_Word " stopped (blocked on black hole owned by thread %lu)\n", cap->no, (W_)tso->id, (long)info2); + } else if (info1 == StackOverflow) { + debugBelch("cap %d: thead %" FMT_Word + " stopped (stack overflow, size %lu)\n", + cap->no, (W_)tso->id, (long)info2); + } else { debugBelch("cap %d: thread %" FMT_Word " stopped (%s)\n", cap->no, (W_)tso->id, thread_stop_reasons[info1]); |