diff options
author | olgeni <olgeni@FreeBSD.org> | 2007-02-21 05:20:42 +0800 |
---|---|---|
committer | olgeni <olgeni@FreeBSD.org> | 2007-02-21 05:20:42 +0800 |
commit | 5ebf978f856b32b5c425cd4a676fc8e7d8de621a (patch) | |
tree | efcf3ab4cd27608f434d4a3f1722f74d0990bece /lang/erlang14 | |
parent | 32ab28ad7c471d35b65b8f59dbde4162f4232688 (diff) | |
download | freebsd-ports-gnome-5ebf978f856b32b5c425cd4a676fc8e7d8de621a.tar.gz freebsd-ports-gnome-5ebf978f856b32b5c425cd4a676fc8e7d8de621a.tar.zst freebsd-ports-gnome-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/erlang14')
-rw-r--r-- | lang/erlang14/Makefile | 2 | ||||
-rw-r--r-- | lang/erlang14/files/patch-erts_emulator_beam_erl__process__dump.c | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/lang/erlang14/Makefile b/lang/erlang14/Makefile index 5c9f53bbd8f0..5065c6f97900 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 000000000000..cdccf8671ff6 --- /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); + } |