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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16429 invoked from network); 27 Jun 2022 07:44:29 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Jun 2022 07:44:29 -0000 Received: (qmail 14162 invoked by uid 550); 27 Jun 2022 07:44:25 -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 14136 invoked from network); 27 Jun 2022 07:44:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656315852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=79+JdA8bEZh+UbETBNTQXnlmtBVHnVmMOxtiIDKiyfE=; b=LBBzI3U2msvJLJWEIiVLDkekkILvfn6/LqcvUfwI2pakDZ/3jpIZ4D/KKcioKamUG63/Vy dGbTsIu+fNxR9U8qotNLHJuG5+S4D2Yx71f2OVs9PDKWybVW6OGXMAsz2287pRtbp41RdH KT6qT31frngLGWlabzNuS9tioz4xwzI= X-MC-Unique: hXMO9PG1N4Cy3gqERfGJBg-1 From: Florian Weimer To: "Alex Xu (Hello71)" Cc: musl@lists.openwall.com References: <1656161421.nztip0vma0.none@localhost> Date: Mon, 27 Jun 2022 09:44:07 +0200 In-Reply-To: <1656161421.nztip0vma0.none@localhost> (Alex Xu's message of "Sat, 25 Jun 2022 08:56:46 -0400") Message-ID: <87fsjqeek8.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=fweimer@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Subject: Re: [musl] BUG: Calling readdir/dirfd after vfork will cause deadlock. * Alex Xu: > Excerpts from Nick Peng's message of June 24, 2022 11:40 pm: >> Description: After vfork, calling functions such as readdir/dirfd may >> cause deadlock. GNU C is OK. > > This is not a bug. TFM: > > DESCRIPTION > Standard description > (From POSIX.1) The vfork() function has the same effect as > fork(2), except that the behavior is undefined if the process > created by vfork() either modifies any data other than a variable > of type pid_t used to store the return value from vfork(), or > returns from the function in which vfork() was called, or calls > any other function before successfully calling _exit(2) or one of > the exec(3) family of functions. > > It may happen to appear to work in some cases on some libcs, or kernels, > or architectures, or it may deadlock, corrupt data, or cause demons to > fly out your nose. Do not use vfork in this manner. Avoid using fork in > this manner either; that may work in musl 1.2.2+, and appear to work in > glibc (but sometimes randomly corrupt data), but is not portable to > other libcs. Could you describe the memory corruption you have seen with opendir/readdir on glibc? Thanks, Florian