From aaecaac6a392eb8bc6362d1a523858846ac8d670 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas.larsson@erlang-solutions.com>
Date: Wed, 16 Mar 2016 15:35:44 +0100
Subject: erts: Create erl_crash.dump when out of memory

This was accidentally removed in commit cd6903be0740db
---
 erts/emulator/beam/erl_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'erts')

diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index 0877c24404..5f8cd2bbf7 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -1923,7 +1923,7 @@ erts_alc_fatal_error(int error, int func, ErtsAlcType_t n, ...)
 	va_start(argp, n);
 	size = va_arg(argp, Uint);
 	va_end(argp);
-	erts_exit(1,
+	erts_exit(ERTS_DUMP_EXIT,
 		 "%s: Cannot %s %lu bytes of memory (of type \"%s\").\n",
 		 allctr_str, op, size, t_str);
 	break;
-- 
cgit v1.2.3


From 0fe04b07b4d15c9671d6665ac5304bffd0f63d23 Mon Sep 17 00:00:00 2001
From: Rickard Green <rickard@erlang.org>
Date: Wed, 16 Mar 2016 13:42:04 +0100
Subject: Unbreak process_info(Pid,last_calls)

---
 erts/emulator/beam/erl_bif_info.c       |  2 +-
 erts/emulator/test/save_calls_SUITE.erl | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

(limited to 'erts')

diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 2c232c6c03..ac7a70c642 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -1534,7 +1534,7 @@ process_info_aux(Process *BIF_P,
     }
 
     case am_last_calls: {
-	struct saved_calls *scb = ERTS_PROC_GET_SAVED_CALLS_BUF(BIF_P);
+	struct saved_calls *scb = ERTS_PROC_GET_SAVED_CALLS_BUF(rp);
 	if (!scb) {
 	    hp = HAlloc(BIF_P, 3);
 	    res = am_false;
diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl
index 544d841f16..4e50fdc898 100644
--- a/erts/emulator/test/save_calls_SUITE.erl
+++ b/erts/emulator/test/save_calls_SUITE.erl
@@ -156,8 +156,19 @@ save_calls_1() ->
 
     ?line erlang:process_flag(self(), save_calls, 10),
     ?line {last_calls, L3} = process_info(self(), last_calls),
+    true = (L3 /= false),
     ?line L31 = lists:filter(fun is_local_function/1, L3),
     ?line [] = L31,
+    erlang:process_flag(self(), save_calls, 0),
+
+    %% Also check that it works on another process ...
+    Pid = spawn(fun () -> receive after infinity -> ok end end),
+    erlang:process_flag(Pid, save_calls, 10),
+    {last_calls, L4} = process_info(Pid, last_calls),
+    true = (L4 /= false),
+    L41 = lists:filter(fun is_local_function/1, L4),
+    [] = L41,
+    exit(Pid,kill),
     ok.
 
 do_bipp() ->
-- 
cgit v1.2.3


From c17eec673d8e7761712e3a4bfc520e9aea5e74c8 Mon Sep 17 00:00:00 2001
From: Rickard Green <rickard@erlang.org>
Date: Wed, 16 Mar 2016 17:17:11 +0100
Subject: Fix premature timeouts for ethread events on Linux

---
 erts/lib_src/pthread/ethr_event.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'erts')

diff --git a/erts/lib_src/pthread/ethr_event.c b/erts/lib_src/pthread/ethr_event.c
index 0629b4dfcd..69e7be342c 100644
--- a/erts/lib_src/pthread/ethr_event.c
+++ b/erts/lib_src/pthread/ethr_event.c
@@ -94,6 +94,9 @@ wait__(ethr_event *e, int spincount, ethr_sint64_t timeout)
 	tsp = NULL;
     }
     else {
+#ifdef ETHR_HAVE_ETHR_GET_MONOTONIC_TIME
+	start = ethr_get_monotonic_time();
+#endif
 	tsp = &ts;
 	time = timeout;
 	if (spincount == 0) {
@@ -102,9 +105,6 @@ wait__(ethr_event *e, int spincount, ethr_sint64_t timeout)
 		goto return_event_on;
 	    goto set_timeout;
 	}
-#ifdef ETHR_HAVE_ETHR_GET_MONOTONIC_TIME
-	start = ethr_get_monotonic_time();
-#endif
     }
 
     while (1) {
-- 
cgit v1.2.3


From c048886458ce68280ba32647a93a04902c929988 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Fri, 1 Apr 2016 20:11:34 +0200
Subject: erts: Fix race for process_flag(trap_exit,true)

and a concurrent exit signal.

We now actually guarantee that the process will not die
from exit signal *after* the call to process_flag(trap_exit,true)
has returned.

The race is narrow and probably quite hard to observe even if you
manage to provoke it. Has only been confirmed with the help of
return trace and a sleep in send_exit_signal().

Solution:
Seize status lock to prevent send_exit_signal() from reading
an old status (without TRAP_EXIT) and then writing PENDING_EXIT
after TRAP_EXIT has been set by process_flag_2().
---
 erts/emulator/beam/bif.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'erts')

diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index b43137597e..11c694233f 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -1566,14 +1566,17 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2)
 	*       true. For more info, see implementation of
 	*       erts_send_exit_signal().
 	*/
+       erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCKS_XSIG_SEND);
        if (trap_exit)
 	   state = erts_smp_atomic32_read_bor_mb(&BIF_P->state,
 						 ERTS_PSFLG_TRAP_EXIT);
        else
 	   state = erts_smp_atomic32_read_band_mb(&BIF_P->state,
 						  ~ERTS_PSFLG_TRAP_EXIT);
+       erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCKS_XSIG_SEND);
+
 #ifdef ERTS_SMP
-       if (ERTS_PROC_PENDING_EXIT(BIF_P)) {
+       if (state & ERTS_PSFLG_PENDING_EXIT) {
 	   erts_handle_pending_exit(BIF_P, ERTS_PROC_LOCK_MAIN);
 	   ERTS_BIF_EXITED(BIF_P);
        }
-- 
cgit v1.2.3


From 7765727317721d5de5949a5f39e0211f3b920da7 Mon Sep 17 00:00:00 2001
From: Erlang/OTP <otp@erlang.org>
Date: Fri, 1 Apr 2016 20:19:12 +0200
Subject: Prepare release

---
 erts/doc/src/notes.xml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
 erts/vsn.mk            |  2 +-
 2 files changed, 66 insertions(+), 1 deletion(-)

(limited to 'erts')

diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml
index acd816a81c..7ccddf4ff0 100644
--- a/erts/doc/src/notes.xml
+++ b/erts/doc/src/notes.xml
@@ -32,6 +32,71 @@
   <p>This document describes the changes made to the ERTS application.</p>
 
 
+<section><title>Erts 7.3.1</title>
+
+    <section><title>Fixed Bugs and Malfunctions</title>
+      <list>
+        <item>
+          <p>
+	    <c>process_info(Pid, last_calls)</c> did not work for
+	    <c>Pid /= self()</c>.</p>
+          <p>
+	    Own Id: OTP-13418</p>
+        </item>
+        <item>
+          <p>
+	    Make sure to create a crash dump when running out of
+	    memory. This was accidentally removed in the erts-7.3
+	    release.</p>
+          <p>
+	    Own Id: OTP-13419</p>
+        </item>
+        <item>
+          <p>
+	    Schedulers could be woken by a premature timeout on
+	    Linux. This premature wakeup was however harmless.</p>
+          <p>
+	    Own Id: OTP-13420</p>
+        </item>
+        <item>
+          <p>
+	    A process communicating with a port via one of the
+	    <c>erlang:port_*</c> BIFs could potentially end up in an
+	    inconsistent state if the port terminated during the
+	    communication. When this occurred the process could later
+	    block in a <c>receive</c> even though it had messages
+	    matching in its message queue.</p>
+          <p>
+	    This bug was introduced in erts version 5.10 (OTP R16A).</p>
+          <p>
+	    Own Id: OTP-13424 Aux Id: OTP-10336 </p>
+        </item>
+        <item>
+          <p>
+	    The reference count of a process structure could under
+	    rare circumstances be erroneously managed. When this
+	    happened invalid memory accesses occurred.</p>
+          <p>
+	    Own Id: OTP-13446</p>
+        </item>
+        <item>
+          <p>
+	    Fix race between <c>process_flag(trap_exit,true)</c> and
+	    a received exit signal.</p>
+          <p>
+	    A process could terminate due to exit signal even though
+	    <c>process_flag(trap_exit,true)</c> had returned. A very
+	    specific timing between call to <c>process_flag/2</c> and
+	    exit signal from another scheduler was required for this
+	    to happen.</p>
+          <p>
+	    Own Id: OTP-13452</p>
+        </item>
+      </list>
+    </section>
+
+</section>
+
 <section><title>Erts 7.3</title>
 
     <section><title>Fixed Bugs and Malfunctions</title>
diff --git a/erts/vsn.mk b/erts/vsn.mk
index a42b7d758e..89c3ab8edb 100644
--- a/erts/vsn.mk
+++ b/erts/vsn.mk
@@ -18,7 +18,7 @@
 # %CopyrightEnd%
 # 
 
-VSN = 7.3
+VSN = 7.3.1
 
 # Port number 4365 in 4.2
 # Port number 4366 in 4.3
-- 
cgit v1.2.3