aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/dist.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-12-03 15:34:14 +0100
committerSverker Eriksson <[email protected]>2015-12-07 18:02:52 +0100
commitce8279d6a48d41f9de577825844f499bb3084b96 (patch)
tree094be4e1fabf2eb19c9a747e687b49e79337f263 /erts/emulator/beam/dist.c
parent75ef9b7cae7533fb9be7953ac72f743b055d2a7a (diff)
downloadotp-ce8279d6a48d41f9de577825844f499bb3084b96.tar.gz
otp-ce8279d6a48d41f9de577825844f499bb3084b96.tar.bz2
otp-ce8279d6a48d41f9de577825844f499bb3084b96.zip
erts: Fix bug for remote control message containing fat maps
that could cause the static factory to overflow Fix: Introduce a new factory mode FACTORY_TMP
Diffstat (limited to 'erts/emulator/beam/dist.c')
-rw-r--r--erts/emulator/beam/dist.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index 4846133aa6..170690ca89 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -1153,7 +1153,6 @@ int erts_net_message(Port *prt,
Process* rp;
DeclareTmpHeapNoproc(ctl_default,DIST_CTL_DEFAULT_SIZE);
Eterm* ctl = ctl_default;
- ErlOffHeap off_heap;
ErtsHeapFactory factory;
Eterm* hp;
Sint type;
@@ -1168,9 +1167,6 @@ int erts_net_message(Port *prt,
#endif
UseTmpHeapNoproc(DIST_CTL_DEFAULT_SIZE);
- /* Thanks to Luke Gorrie */
- off_heap.first = NULL;
- off_heap.overhead = 0;
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -1231,7 +1227,7 @@ int erts_net_message(Port *prt,
}
hp = ctl;
- erts_factory_static_init(&factory, ctl, ctl_len, &off_heap);
+ erts_factory_tmp_init(&factory, ctl, ctl_len, ERTS_ALC_T_DCTRL_BUF);
arg = erts_decode_dist_ext(&factory, &ede);
if (is_non_value(arg)) {
#ifdef ERTS_DIST_MSG_DBG
@@ -1719,7 +1715,7 @@ int erts_net_message(Port *prt,
goto invalid_message;
}
- erts_cleanup_offheap(&off_heap);
+ erts_factory_close(&factory);
if (ctl != ctl_default) {
erts_free(ERTS_ALC_T_DCTRL_BUF, (void *) ctl);
}
@@ -1734,7 +1730,7 @@ int erts_net_message(Port *prt,
}
data_error:
PURIFY_MSG("data error");
- erts_cleanup_offheap(&off_heap);
+ erts_factory_close(&factory);
if (ctl != ctl_default) {
erts_free(ERTS_ALC_T_DCTRL_BUF, (void *) ctl);
}