DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 528B8VOS1422842 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 528B8VOS1422842 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=MfJTym6a X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20067385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1741432111; bh=NFdcdEXLVVb+YdNeWIKQ7ePQp/08Wph8TzwTX+iyo6s=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MfJTym6alax6JawJwGWZBPDhE2A5wZFgaMgh7rz/bS9iz4/VZMj6g4FteexyIjDEW gsGuAAvf99kgSJLYZcsemJ4fzEYhr0ZIvWqUdiUOfgvKm8V8W2AKcmTOhZmJZvyeTa L2wyPDJNqhdjMC3OU3Z6033Utdau/IsJsZm5WyX4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E8A33858D1E ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2E8A33858D1E ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741432054; cv=none; b=LER5jzcudC7TSIkwKvdito5CknBoI4THnHrXAIWL7Axxc+QAZZfpcQRB0L9LXeAzarbs/wpMEDyWwitiEMNbBRXDC+39zTJLqTyfeW/zEUUvSIWPnvUOp2I5FfeMZwcP7zGNvTvBsbEXCdoUZk1McoWic//C4HEe9rp0XHA3A/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741432054; c=relaxed/simple; bh=R6aRTjqEaZgl6I8OlhnPPIv0H+sUnML4kQNQ6HkJZ8M=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=K2JO+wCD+Lfc1cSZKuvBQXvE8nnxBhmzQCFFSwRX3Mp4ovC4QFR7S9cuorD0/3qznNh5UNfbzttIa0l0hFl/0naug5YmsfBKLCZvvvuybPV1f8cSFBe9OJ59KqNFB+TEFfhZs7l0Tuy9nZ3D5+iVLjQjHTrpCdZr5npQ6TIUIv8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E8A33858D1E Subject: Re: cygwin 3.6.0: No signals received after swapcontext() is used To: cygwin AT cygwin DOT com References: Message-ID: Date: Sat, 8 Mar 2025 12:07:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 SeaMonkey/2.53.20 MIME-Version: 1.0 In-Reply-To: X-TOI-EXPURGATEID: 150726::1741432051-8DFF89EA-703EBD22/0/0 CLEAN NORMAL X-TOI-MSGID: 9e543458-ce03-4801-a0e9-70bc4d43ee47 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christian Franke via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Christian Franke Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 528B8VOS1422842 Corinna Vinschen via Cygwin wrote: > On Mar 6 13:24, Christian Franke via Cygwin wrote: >> Found because 'stress-ng --context 1 ...' always hangs. >> >> The attached testcase uses the example from Linux swapcontext(3) to call the >> context functions. > Just tested with 3.5.3 and it doesn't work there, either. > > So yeah, it's a bug, but it's not a 3.6 regression and of minor > importance. We can look into that for 3.7. > This is possibly a regression introduced in 3.0.6. A comparison of strace outputs of signal handling before and after the swapcontext() calls reveals that 'incyg' is incorrectly set after swapcontext(). A revert of   https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=c5f9eed1 fixes both the testcase and 'stress-ng --context ...'. No patch provided because I'm not sure how to handle the (at least) two other use cases of setcontext() correctly: - the call from _cygtls::call_signal_handler(), and - a call from a signal handler. -- Regards, Christian -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple