<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
We will not include this patch as it conflict with how Erlang
normally behaves when working with dead processes.<br>
<br>
Thank you for the contribution.<br>
<br>
On 12/28/2011 08:56 AM, Jovi Zhang wrote:
<blockquote
cite="mid:CACV3sbJ9QDW0RHze0YfAbA2JjToXK9Ur4Y0E8pppRWts8Y0fOA@mail.gmail.com"
type="cite">
<pre wrap="">>From 18612f43f0c8a6f217806c22c9f9bec8b0de4b26 Mon Sep 17 00:00:00 2001
From: Jovi Zhang <a class="moz-txt-link-rfc2396E" href="mailto:bookjovi@gmail.com"><bookjovi@gmail.com></a>
Date: Wed, 21 Dec 2011 03:26:03 +0800
Subject: [PATCH] erts: fix error handling in bif erlang:start_timer/3
See below, When recevier pid is non-exist, start_timer/3 return a
valid internal Ref, this is wrong, erlang should return badarg instead.
Eshell V5.9 (abort with ^G)
1> A = erlang:start_timer(100*1000, pid(0, 9999, 0), {none}).
Ref<0.0.0.29>
2> erlang:read_timer(A).
false
3>
---
erts/emulator/beam/erl_bif_timer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/erts/emulator/beam/erl_bif_timer.c
b/erts/emulator/beam/erl_bif_timer.c
index a922a33..7bd2b8e 100644
--- a/erts/emulator/beam/erl_bif_timer.c
+++ b/erts/emulator/beam/erl_bif_timer.c
@@ -414,7 +414,7 @@ setup_bif_timer(Uint32 xflags,
rp = erts_pid2proc(c_p, ERTS_PROC_LOCK_MAIN,
receiver, ERTS_PROC_LOCK_MSGQ);
if (!rp)
- return ref;
+ return THE_NON_VALUE;
}
if (timeout < ERTS_ALC_MIN_LONG_LIVED_TIME) {
--
1.7.2.3</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-patches mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/listinfo/erlang-patches</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
/Henrik Nord Erlang/OTP</pre>
</body>
</html>