From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail231.csoft.net (mail231.csoft.net [66.216.5.135]) by sourceware.org (Postfix) with ESMTPS id 03D573858D1E for ; Wed, 22 May 2024 01:01:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03D573858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=jdrake.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jdrake.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 03D573858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=66.216.5.135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716339687; cv=none; b=JH6VX3lsf3+YwvuQI3XbQ6QyTdl7KBeWa6EHlXi1WQ1ah2tKYuL0kuL1dA65+WoC15E6J2p19K1MKG518dbrHSWpU8ehSPIRVtIMYMmKYdS2Zz3ngAc2eQGUOdLoQstJYGclS+uj2IC2NlYG+sYCz4KAvirvJGgBqiHZc/VvoSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716339687; c=relaxed/simple; bh=R2UV5TmlzMzOBQbREhAhsVb/176VDSRzaNlKn6ungYk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=EuwzhuMgkV92TeFEzaEp0OQ20ZiGHQFmlE7xgYLbWxasU6wcu+jDmf0SDP5kAWejCHqSUe5hSALFG4Dx6+VWFzNLhQW/TZbXaxxue8qxMHdQxuXTeoom1cfwfdGAXqCRFlVTsGwptynamOSpf6r30bVvnHe0KjUqMs8xPXRnJLA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail231.csoft.net (localhost [127.0.0.1]) by mail231.csoft.net (Postfix) with ESMTP id F34A345A86; Tue, 21 May 2024 21:01:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jdrake.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=csoft; bh=K+niTL4lKGy3d/2pnR8OhYdL7s8=; b=onn0Y E7hn+VMxMlYReRzHnG2lARw0JJ5WTnbqbmmA5WgEPlT916oCsC5amTTdLbkcnNtC JD0TAzl/IVgns2tB+bZhO4BXTSfdwDk4X6GRbbRGyXuYWx6kem/lwrWEdBka4O9k 5aR/w/BjF6WQBwYRLHrkyRzWhNxasCS8TmKraU= Received: from mail231 (mail231 [66.216.5.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA512) (No client certificate requested) (Authenticated sender: jeremyd) by mail231.csoft.net (Postfix) with ESMTPSA id ECD2D45A6D; Tue, 21 May 2024 21:01:21 -0400 (EDT) Date: Tue, 21 May 2024 18:01:21 -0700 (PDT) From: Jeremy Drake X-X-Sender: jeremyd@resin.csoft.net To: cygwin-developers@cygwin.com cc: Johannes.Schindelin@gmx.de Subject: Re: double-fork issue on Windows on ARM64 In-Reply-To: <23f23b0a-e60e-e3ff-4c1e-295599fdc813@jdrake.com> Message-ID: <0b48aa79-8579-882e-a40b-724267936788@jdrake.com> References: <78f294de-4c94-242a-722e-fd98e51edff9@jdrake.com> <23f23b0a-e60e-e3ff-4c1e-295599fdc813@jdrake.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 20 May 2024, Jeremy Drake wrote: > Today, I was attempting to look at the TerminateThread situation. The > call in question comes from the attempt to terminate the wait_thread of a > chld_procs entry. I noticed elsewhere in cygwin code (flock.cc) that > CancelSynchronousIo was being called, and that stood out to me because > chances are that the wait thread (if running) is going to be blocked in > ReadFile. I am testing with the following hack, and so far have not seen > a hang I left my reproducer running with this hack, and I did eventually get an error exit from the intermediate subprocess, which seems to have been a signal 11 (if I'm reading the status from waitpid correctly). What I noticed today is that in pinfo.cc, near the end of proc_waiter, it sets vchild.wait_thread = NULL;. If my reading of this is correct, that does nothing useful, because vchild is a stack variable there and the function returns soon after. I that what that *intended* to do was to NULL out the wait_thread pointer that would be checked in proc_terminate, but there's no guarantee that the entry in chld_procs is in the same place at the end of proc_waiter as it was at the start (so arg may point to some other pinfo entirely). Does any of this make any sense, or am I barking up the wrong tree here?