summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/RtsMessages.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/rts/RtsMessages.c b/rts/RtsMessages.c
index 507d007484..d760bd233c 100644
--- a/rts/RtsMessages.c
+++ b/rts/RtsMessages.c
@@ -186,7 +186,12 @@ rtsFatalInternalErrorFn(const char *s, va_list ap)
#endif
#if defined(TRACING)
- if (RtsFlags.TraceFlags.tracing == TRACE_EVENTLOG) endEventLogging();
+ if (RtsFlags.TraceFlags.tracing == TRACE_EVENTLOG) {
+ // Use flushAllCapsEventsBufs rather than endEventLogging here since
+ // the latter insists on acquiring all capabilities to flush the eventlog;
+ // this would deadlock if we barfed during a GC.
+ flushAllCapsEventsBufs();
+ }
#endif
abort();