File 2196-Print-heap-pointers-for-garbing-processes-during-cra.patch of Package erlang

From 43416d57174d93660aec1620eeef0b05271b43e6 Mon Sep 17 00:00:00 2001
From: Simon Cornish <7t9jna402@sneakemail.com>
Date: Mon, 25 Apr 2016 22:25:56 -0700
Subject: [PATCH] Print heap pointers for garbing processes during crashdump

In an SMP emulator, print_garb_info doesn't do anything because the
heap pointers could be invalid.

However, when crashdumping there are no schedulers running so it's ok
to print this additional information which could be useful when
examining a core file.
---
 erts/emulator/beam/break.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c
index 0ddf7f4..e0164c3 100644
--- a/erts/emulator/beam/break.c
+++ b/erts/emulator/beam/break.c
@@ -347,8 +347,11 @@ print_process_info(int to, void *to_arg, Process *p)
 static void
 print_garb_info(int to, void *to_arg, Process* p)
 {
+#ifdef ERTS_SMP
     /* ERTS_SMP: A scheduler is probably concurrently doing gc... */
-#ifndef ERTS_SMP
+    if (!ERTS_IS_CRASH_DUMPING)
+      return;
+#endif
     erts_print(to, to_arg, "New heap start: %bpX\n", p->heap);
     erts_print(to, to_arg, "New heap top: %bpX\n", p->htop);
     erts_print(to, to_arg, "Stack top: %bpX\n", p->stop);
@@ -356,7 +359,6 @@ print_garb_info(int to, void *to_arg, Process* p)
     erts_print(to, to_arg, "Old heap start: %bpX\n", OLD_HEAP(p));
     erts_print(to, to_arg, "Old heap top: %bpX\n", OLD_HTOP(p));
     erts_print(to, to_arg, "Old heap end: %bpX\n", OLD_HEND(p));
-#endif
 }
 
 void
-- 
2.1.4

openSUSE Build Service is sponsored by