aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-07-18 15:02:18 +0200
committerSverker Eriksson <[email protected]>2018-07-18 15:02:18 +0200
commit6a98a4b05ae77739d27f2a9fb018786906e6918c (patch)
tree3a4176c2ab12f22dd02dfa6e2c1ddab951bc721c /lib/erl_interface/src
parent42b2a4cbdf9dd7622f9503167556c79732d95d34 (diff)
parent2be45ea245e52e852a35fec9c5b53a1c55d546ff (diff)
downloadotp-6a98a4b05ae77739d27f2a9fb018786906e6918c.tar.gz
otp-6a98a4b05ae77739d27f2a9fb018786906e6918c.tar.bz2
otp-6a98a4b05ae77739d27f2a9fb018786906e6918c.zip
Merge branch 'sverker/erl_interface/valgrind/OTP-15171' into maint
* sverker/erl_interface/valgrind/OTP-15171: erl_interface: Fix bug in ei_*receive_msg* functions erl_interface: Seal test case memory leaks erl_interface: Initialize erl_errno to zero erts: Remove use of VALGRIND_PRINTF_XML erl_interface: Add valgrind ability for test port programs erts: Fix benign bug in cerl for valgrind erts: Fix buggy calls to erts_sys_explicit_8bit_getenv
Diffstat (limited to 'lib/erl_interface/src')
-rw-r--r--lib/erl_interface/src/connect/ei_connect.c2
-rw-r--r--lib/erl_interface/src/misc/ei_pthreads.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index 75b705a8fa..9df4fa3b6c 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -1022,7 +1022,7 @@ int ei_do_receive_msg(int fd, int staticbuffer_p,
erl_errno = EMSGSIZE;
return ERL_ERROR;
}
- x->index = x->buffsz;
+ x->index = msglen;
switch (msg->msgtype) { /* FIXME does not handle trace tokens and monitors */
case ERL_SEND:
case ERL_REG_SEND:
diff --git a/lib/erl_interface/src/misc/ei_pthreads.c b/lib/erl_interface/src/misc/ei_pthreads.c
index 25608edeec..8b34364659 100644
--- a/lib/erl_interface/src/misc/ei_pthreads.c
+++ b/lib/erl_interface/src/misc/ei_pthreads.c
@@ -206,6 +206,7 @@ volatile int *__erl_errno_place(void)
use_fallback = 1;
return &fallback_errno;
}
+ *erl_errno_p = 0;
if (pthread_setspecific(erl_errno_key, erl_errno_p) != 0 ||
(erl_errno_p = pthread_getspecific(erl_errno_key)) == NULL) {