delorie.com/archives/browse.cgi | search |
DMARC-Filter: | OpenDMARC Filter v1.4.2 delorie.com 54GG0dxx4076599 |
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 54GG0dxx4076599 |
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=wur46pKs | |
X-Recipient: | archive-cygwin AT delorie DOT com |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org 755BC385F01D |
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
s=default; t=1747411237; | |
bh=mHKxNYPavNGx66ybcAEz/SyQVU8bwLOHqgapYLDwQUs=; | |
h=Date:To:Cc:Subject:In-Reply-To:References:List-Id: | |
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: | |
From:Reply-To:From; | |
b=wur46pKsRxwGTedQx421X2ekePfR/+EWr+NC+Z1t0MExk7vL1yYZvdC9OID8x5eKL | |
TVc/36HHJiiUfKeqBBaFy0zCk0zUMVbQT0cpt/ya94lJdd+Y0tfm6+azIXnrHZ8PSk | |
uaT+QW4a36ORODNZ9dL+qlVDa30+wh0BTCCJfD5I= | |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org D7C48385C412 |
ARC-Filter: | OpenARC Filter v1.0.0 sourceware.org D7C48385C412 |
ARC-Seal: | i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747410227; cv=none; |
b=DqQP/33LAaZJJPL9zocqj4twFkbqUMUa/Gz17duQsppnOW6XuXSc2UUM/Zd8sKgy9HvX5Cup0HZJUn1M1OxaJgnjLSCdaXfwch8EQONjn+9dGk5rtjK10a6PBM/sffILHoshk+mjbQSnGvBcnS5CZibtytCqM1RzIZMYhZAGeMo= | |
ARC-Message-Signature: | i=1; a=rsa-sha256; d=sourceware.org; s=key; |
t=1747410227; c=relaxed/simple; | |
bh=JziIfQUVu9x+7vT3WWdbAEjs6Ez78i1qWg/wZUStyiU=; | |
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature; | |
b=Hxdb+XhJ8nA/bW47G2aKQ9/+S6bxD/hKcAuwl/MI3h10XOa2+Av2rCf8MTdui1uUnwAd2k/W8xY6rRdya0treNevlEbDAWe+JRIPu9PY461dvaPevNKIiQUBbkVNUnGfGXMMi7wwbiwFmW3iDHhlPcmNsPrAhbtVCNEfq0p0fgE= | |
ARC-Authentication-Results: | i=1; server2.sourceware.org |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org D7C48385C412 |
Date: | Sat, 17 May 2025 00:43:42 +0900 |
To: | cygwin AT cygwin DOT com |
Cc: | Jon Turney <jon DOT turney AT dronecode DOT org DOT uk> |
Subject: | Re: strace: infinite exception c0000005 loop on segmentation fault |
Message-Id: | <20250517004342.bb5af58ef1498179b3e91206@nifty.ne.jp> |
In-Reply-To: | <20250516211400.84e5ff3351f557a313618ee7@nifty.ne.jp> |
References: | <320ee4eb-a06d-150d-ef12-3dc501bbd60b AT t-online DOT de> |
<20250516211400 DOT 84e5ff3351f557a313618ee7 AT nifty DOT ne DOT jp> | |
X-Mailer: | Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) |
Mime-Version: | 1.0 |
X-BeenThere: | cygwin AT cygwin DOT com |
X-Mailman-Version: | 2.1.30 |
List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
List-Unsubscribe: | <https://cygwin.com/mailman/options/cygwin>, |
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe> | |
List-Archive: | <https://cygwin.com/pipermail/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-request AT cygwin DOT com?subject=help> |
List-Subscribe: | <https://cygwin.com/mailman/listinfo/cygwin>, |
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe> | |
From: | Takashi Yano via Cygwin <cygwin AT cygwin DOT com> |
Reply-To: | Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp> |
Errors-To: | cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com |
Sender: | "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com> |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id 54GG0dxx4076599 |
Hi Jon, On Fri, 16 May 2025 21:14:00 +0900 Takashi Yano via Cygwin <cygwin AT cygwin DOT com> wrote: > On Fri, 16 May 2025 13:46:21 +0200 > Christian Franke wrote: > > Testcase: > > > > $ uname -r # Also occurs with 3.6.1-1.x86_64 > > 3.7.0-0.95.g854150fda310.x86_64 > > > > $ cat sigsegv.c > > int main() > > { > > Â *(volatile char *)0 = 0; > > Â return 42; // NOTREACHED > > } > > > > $ gcc -o sigsegv sigsegv.c > > > > $ ./sigsegv # OK > > Segmentation fault > > > > $ echo $? > > 139 > > > > $ (sleep 5; taskkill /f /im strace.exe) & strace ./sigsegv # Infinite loop > > ... > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000100401092 > > --- Process 11224 (pid: 2162), exception c0000005 at 0000000 > > SUCCESS: ... (localized message from taskkill) > > > > > > The problem also occurs if a SIGSEGV handler is present. The handler > > code is not executed if strace is used but works as expected without strace. > > I could reproduce that. And also found cygwin 3.4.10 does not have this > issue. I'll look into this. I could bisect the issue and found the next commit triggered the issue. commit 91457377d6c9f89a08b1b70e45cbae87ef467119 Author: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk> Date: Thu Jan 11 20:00:14 2024 +0000 Cygwin: Make 'ulimit -c' control writing a coredump Pre-format a command to be executed on a fatal error to run 'dumper' (using an absolute path). Factor out executing a pre-formatted command, so we can use that for invoking the JIT debugger in try_to_debug() (if error_start is present in the CYGWIN env var) and to invoke dumper when a fatal error occurs. On a fatal error, if the core file size limit is greater than 1MB, invoke dumper to write a core dump. Otherwise, if that limit is greater than 0, write a .stackdump file, as previously. Adjust and clarify the associated documentation. Also: Fix so that the error_start JIT debugger is now invoked, even when ulimit -c is zero. Also: Fix uses of console_printf() inside exec_prepared_command(). It's output is written via the Windows console device, so needs to use Windows-style line endings. Also: consistently return non-zero from try_to_debug() if we debugged. Future work: Truncate or remove the file written, if it exceeds the maximum size set by the ulimit. Future work: Using the words "fatal error" could probably be improved on. This means exiting on one of the "certain signals whose default action is to cause the process to terminate and produce a core dump file". I also found the following patch fixes the issue. I'm not sure this is the right thing, so could you please have a look? diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 9763a1b04..aea2821f6 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -597,7 +597,7 @@ try_to_debug () { extern void break_here (); break_here (); - return 1; + return 0; } /* Otherwise, invoke the JIT debugger, if set */ -- Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp> -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |