From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 567 invoked from network); 30 Jun 2020 04:19:25 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 30 Jun 2020 04:19:25 -0000 Received: (qmail 17921 invoked by uid 550); 30 Jun 2020 04:19:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 17891 invoked from network); 30 Jun 2020 04:19:20 -0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yqxmail.com; s=dkim; t=1593490748; bh=HgJR2Hcz6ENmeaF7Vw3I/U4H1eA56c2S3leyooyGWr8=; h=Date:From:To:Subject:From; b=RHvxekYmeOD1ZN0U5vRqb7ph1ucGpBS+BwXavV0mwQLOIfFJ5bw4VxYr0vYUj7SMq mxUyOp4A4Vk6jnEFyxS5k78jHxChSLILtuVGzO40dxfnhD1U5nlMskmPNNkRCinUzB jZl35HVYEsjBTtHphF44Q4OoKl4ofl/8OmdOvw2HGc89aA/952DkE73WLd/Zi+0W6x kooKCnK5UPmGjBwWrv2aeM8iAzugQws4kAqgMoCNp7E8GhCAuve6Ub/R3qJTX3Gp9f 5lIepW1H4HXuGc+Z4MCcDLos/PVVR1T+6MHSgqD7YohTKQOVXJNEVnO6/7WlSaAVKm D0v5Yxit8RZHQ== Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 29 Jun 2020 21:19:08 -0700 From: Hydro Flask To: musl@lists.openwall.com Message-ID: <0217b8838100175725993b0ed0114ee7@thelig.ht> X-Sender: hydroflask@yqxmail.com User-Agent: Roundcube Webmail/1.1.4 Subject: [musl] Potential deadlock in pthread_kill() Hello all, Noticed something while reading some code today. pthread_kill() is specified by POSIX to be async signal safe but I noticed that in musl's implementation if a signal occurs while the "killlock" is held and the signal handler calls pthread_kill() on the same target thread, a deadlock will occur. Is this intentional? int pthread_kill(pthread_t t, int sig) { int r; LOCK(t->killlock); r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) : (sig+0U >= _NSIG ? EINVAL : 0); UNLOCK(t->killlock); return r; } Thank you for your attention. Hydro