From b26a227173e8e9b91be14f06ee781c6e214e50ff Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 1 May 2018 19:35:28 +0200 Subject: core,w32: Avoid recursive use of npth_unprotect. * src/w32-estream.c (reader): Use standard free. (writer): Ditto. -- There are two errors: The minor one is that we allocated with calloc but released with _gpgrt_free. The major one is the recursive use of npth_unprotect due to the syscall_clamp mechanism: 1. Around the call to _gpgrt_w32_poll 2. By gpgrt_lock_lock on behalf of a the custom allocation handler in the worker threads at their _gpgrt_free. This problem was exhibited by GnuPG's dirmngr component. GnuPG-bug-id: 3937 Signed-off-by: Werner Koch --- src/init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/init.c') diff --git a/src/init.c b/src/init.c index 7b3eda3..81ebd0f 100644 --- a/src/init.c +++ b/src/init.c @@ -300,7 +300,11 @@ _gpg_err_set_errno (int err) /* Internal tracing functions. Except for TRACE_FP we use flockfile - * and funlockfile to protect their use. */ + * and funlockfile to protect their use. + * + * Warning: Take care with the trace functions - they may not use any + * of our services, in particular not the syscall clamp mechanism for + * reasons explained in w32-stream.c:create_reader. */ static FILE *trace_fp; static int trace_save_errno; static int trace_with_errno; -- cgit v1.2.3