aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2007-02-21 05:20:42 +0800
committerolgeni <olgeni@FreeBSD.org>2007-02-21 05:20:42 +0800
commit5ebf978f856b32b5c425cd4a676fc8e7d8de621a (patch)
treeefcf3ab4cd27608f434d4a3f1722f74d0990bece /lang
parent32ab28ad7c471d35b65b8f59dbde4162f4232688 (diff)
downloadfreebsd-ports-graphics-5ebf978f856b32b5c425cd4a676fc8e7d8de621a.tar.gz
freebsd-ports-graphics-5ebf978f856b32b5c425cd4a676fc8e7d8de621a.tar.zst
freebsd-ports-graphics-5ebf978f856b32b5c425cd4a676fc8e7d8de621a.zip
The Erlang runtime could occasionally segfault when writing erl_crash.dump
files, due to a fixed size buffer. Using encode_size_struct will fix it. Obtained from: Christopher Faulet <christopher.faulet(at)capflam.org>
Diffstat (limited to 'lang')
-rw-r--r--lang/erlang/Makefile2
-rw-r--r--lang/erlang/files/patch-erts_emulator_beam_erl__process__dump.c27
-rw-r--r--lang/erlang14/Makefile2
-rw-r--r--lang/erlang14/files/patch-erts_emulator_beam_erl__process__dump.c27
4 files changed, 56 insertions, 2 deletions
diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile
index 5c9f53bbd8f..5065c6f9790 100644
--- a/lang/erlang/Makefile
+++ b/lang/erlang/Makefile
@@ -7,7 +7,7 @@
PORTNAME= erlang
PORTVERSION= r11b3
-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_erl__process__dump.c b/lang/erlang/files/patch-erts_emulator_beam_erl__process__dump.c
new file mode 100644
index 00000000000..cdccf8671ff
--- /dev/null
+++ b/lang/erlang/files/patch-erts_emulator_beam_erl__process__dump.c
@@ -0,0 +1,27 @@
+
+$FreeBSD$
+
+--- erts/emulator/beam/erl_process_dump.c.orig
++++ erts/emulator/beam/erl_process_dump.c
+@@ -399,9 +399,11 @@
+ static void
+ dump_externally(int to, void *to_arg, Eterm term)
+ {
+- byte sbuf[1024]; /* encode and hope for the best ... */
+- byte* s;
+- byte* p;
++ byte *sbuf, *s, *p;
++ unsigned size;
++
++ size = encode_size_struct(term, TERM_TO_BINARY_DFLAGS);
++ sbuf = (byte *) erts_alloc(ERTS_ALC_T_TMP, size);
+
+ s = p = sbuf;
+ erts_to_external_format(NULL, term, &p, NULL, NULL);
+@@ -409,4 +411,6 @@
+ while (s < p) {
+ erts_print(to, to_arg, "%02X", *s++);
+ }
++
++ erts_free(ERTS_ALC_T_TMP, (void *) sbuf);
+ }
diff --git a/lang/erlang14/Makefile b/lang/erlang14/Makefile
index 5c9f53bbd8f..5065c6f9790 100644
--- a/lang/erlang14/Makefile
+++ b/lang/erlang14/Makefile
@@ -7,7 +7,7 @@
PORTNAME= erlang
PORTVERSION= r11b3
-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_erl__process__dump.c b/lang/erlang14/files/patch-erts_emulator_beam_erl__process__dump.c
new file mode 100644
index 00000000000..cdccf8671ff
--- /dev/null
+++ b/lang/erlang14/files/patch-erts_emulator_beam_erl__process__dump.c
@@ -0,0 +1,27 @@
+
+$FreeBSD$
+
+--- erts/emulator/beam/erl_process_dump.c.orig
++++ erts/emulator/beam/erl_process_dump.c
+@@ -399,9 +399,11 @@
+ static void
+ dump_externally(int to, void *to_arg, Eterm term)
+ {
+- byte sbuf[1024]; /* encode and hope for the best ... */
+- byte* s;
+- byte* p;
++ byte *sbuf, *s, *p;
++ unsigned size;
++
++ size = encode_size_struct(term, TERM_TO_BINARY_DFLAGS);
++ sbuf = (byte *) erts_alloc(ERTS_ALC_T_TMP, size);
+
+ s = p = sbuf;
+ erts_to_external_format(NULL, term, &p, NULL, NULL);
+@@ -409,4 +411,6 @@
+ while (s < p) {
+ erts_print(to, to_arg, "%02X", *s++);
+ }
++
++ erts_free(ERTS_ALC_T_TMP, (void *) sbuf);
+ }