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.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23112 invoked from network); 27 Jun 2022 08:37:52 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Jun 2022 08:37:52 -0000 Received: (qmail 19737 invoked by uid 550); 27 Jun 2022 08:37:50 -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 19714 invoked from network); 27 Jun 2022 08:37:49 -0000 Date: Mon, 27 Jun 2022 10:37:37 +0200 From: Szabolcs Nagy To: Florian Weimer Cc: Nick Peng , musl@lists.openwall.com Message-ID: <20220627083737.GW1320090@port70.net> Mail-Followup-To: Florian Weimer , Nick Peng , musl@lists.openwall.com References: <20220625125110.GV1320090@port70.net> <87k092eem6.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k092eem6.fsf@oldenburg.str.redhat.com> Subject: Re: [musl] BUG: Calling readdir/dirfd after vfork will cause deadlock. * Florian Weimer [2022-06-27 09:42:57 +0200]: > * Szabolcs Nagy: > > > * Nick Peng [2022-06-25 11:40:17 +0800]: > >> Description: After vfork, calling functions such as readdir/dirfd may > >> cause deadlock. GNU C is OK. > > > > why do you think "GNU C is OK"? is this from some real software? > > glibc supports opendir/readdir/closedir after vfork as an extension. > The JVM depends on it. how does that work? i think glibc just calls vfork syscall (or clone(CLONE_VM|CLONE_VFORK)) from asm and opendir allocates. so i'd expect a deadlock where the parent waits for the child to exec while holding the malloc lock. > > Of course it's undefined, but I really see no way around keeping support > for it for the time being. > > Thanks, > Florian