aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2007-01-01 07:27:18 +0800
committerolgeni <olgeni@FreeBSD.org>2007-01-01 07:27:18 +0800
commite300f15328f26d221aa1dfd53f57de2ebd098dc9 (patch)
tree0232356c6db40957d861b06690407627e2f0c775 /lang
parentc005d361cd39079d8f4f3be9f0fa624838da9472 (diff)
downloadfreebsd-ports-gnome-e300f15328f26d221aa1dfd53f57de2ebd098dc9.tar.gz
freebsd-ports-gnome-e300f15328f26d221aa1dfd53f57de2ebd098dc9.tar.zst
freebsd-ports-gnome-e300f15328f26d221aa1dfd53f57de2ebd098dc9.zip
Fix R11B-2 SMP timer race condition bug.
Obtained from: Rickard Green <rickard.s.green(at)ericsson.com>
Diffstat (limited to 'lang')
-rw-r--r--lang/erlang/Makefile2
-rw-r--r--lang/erlang/files/patch-erts_emulator_beam_utils.c36
-rw-r--r--lang/erlang14/Makefile2
-rw-r--r--lang/erlang14/files/patch-erts_emulator_beam_utils.c36
4 files changed, 74 insertions, 2 deletions
diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile
index 785021b672aa..252635012826 100644
--- a/lang/erlang/Makefile
+++ b/lang/erlang/Makefile
@@ -7,7 +7,7 @@
PORTNAME= erlang
PORTVERSION= r11b2
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= lang parallel
MASTER_SITES= http://www.erlang.org/download/ \
diff --git a/lang/erlang/files/patch-erts_emulator_beam_utils.c b/lang/erlang/files/patch-erts_emulator_beam_utils.c
new file mode 100644
index 000000000000..58e675168a85
--- /dev/null
+++ b/lang/erlang/files/patch-erts_emulator_beam_utils.c
@@ -0,0 +1,36 @@
+
+$FreeBSD$
+
+--- erts/emulator/beam/utils.c.orig
++++ erts/emulator/beam/utils.c
+@@ -2999,15 +2999,16 @@
+ static void
+ ptimer_timeout(ErtsSmpPTimer *ptimer)
+ {
+- if (!(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
+ if (is_internal_pid(ptimer->timer.id)) {
+ Process *p;
+- p = erts_pid2proc(NULL,
+- 0,
+- ptimer->timer.id,
+- ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
++ p = erts_pid2proc_opt(NULL,
++ 0,
++ ptimer->timer.id,
++ ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS,
++ ERTS_P2P_FLG_ALLOW_OTHER_X);
+ if (p) {
+- if (!(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
++ if (!p->is_exiting
++ && !(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
+ ASSERT(*ptimer->timer.timer_ref == ptimer);
+ *ptimer->timer.timer_ref = NULL;
+ (*ptimer->timer.timeout_func)(p);
+@@ -3028,7 +3029,6 @@
+ erts_smp_io_unlock();
+ }
+ }
+- }
+ free_ptimer(ptimer);
+ }
+
diff --git a/lang/erlang14/Makefile b/lang/erlang14/Makefile
index 785021b672aa..252635012826 100644
--- a/lang/erlang14/Makefile
+++ b/lang/erlang14/Makefile
@@ -7,7 +7,7 @@
PORTNAME= erlang
PORTVERSION= r11b2
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= lang parallel
MASTER_SITES= http://www.erlang.org/download/ \
diff --git a/lang/erlang14/files/patch-erts_emulator_beam_utils.c b/lang/erlang14/files/patch-erts_emulator_beam_utils.c
new file mode 100644
index 000000000000..58e675168a85
--- /dev/null
+++ b/lang/erlang14/files/patch-erts_emulator_beam_utils.c
@@ -0,0 +1,36 @@
+
+$FreeBSD$
+
+--- erts/emulator/beam/utils.c.orig
++++ erts/emulator/beam/utils.c
+@@ -2999,15 +2999,16 @@
+ static void
+ ptimer_timeout(ErtsSmpPTimer *ptimer)
+ {
+- if (!(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
+ if (is_internal_pid(ptimer->timer.id)) {
+ Process *p;
+- p = erts_pid2proc(NULL,
+- 0,
+- ptimer->timer.id,
+- ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
++ p = erts_pid2proc_opt(NULL,
++ 0,
++ ptimer->timer.id,
++ ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS,
++ ERTS_P2P_FLG_ALLOW_OTHER_X);
+ if (p) {
+- if (!(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
++ if (!p->is_exiting
++ && !(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
+ ASSERT(*ptimer->timer.timer_ref == ptimer);
+ *ptimer->timer.timer_ref = NULL;
+ (*ptimer->timer.timeout_func)(p);
+@@ -3028,7 +3029,6 @@
+ erts_smp_io_unlock();
+ }
+ }
+- }
+ free_ptimer(ptimer);
+ }
+