From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KfnaMMagFGqyHxoAWB0awg (envelope-from ) for ; Mon, 25 May 2026 15:19:34 -0400 Received: by simark.ca (Postfix, from userid 112) id C5D1B1E0A3; Mon, 25 May 2026 15:19:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6AC801E024 for ; Mon, 25 May 2026 15:19:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3940B4BA23FF for ; Mon, 25 May 2026 19:19:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3940B4BA23FF Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id BABDF4BA79A7 for ; Mon, 25 May 2026 19:18:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BABDF4BA79A7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BABDF4BA79A7 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779736720; cv=none; b=bnyWFib/hSApOPiHYnCkzP9RxSdp5y8K4P2ujwouodOPwBfH/8USCgq1NWaeh/oFUef3ugOBIl3Wgknt86ZnB1PXtcEuAiWfGNgq2sgmu1Bf7kI/vHY8iU5GajTJNoAjQdSl3WTu26DFM0Xl6lbNxiuMo04m025mJa/g9nVxcDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779736720; c=relaxed/simple; bh=JkQBqua09L3/oD0ArLq6+j2hsbfYSrv0LB0qGT3+vhY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=W5o+V4UQh9uL9GBgnSN5nYBNK0LtS1MZH1juC/gXpQXWxgyCMMDidrXzyEb+0S20ivzvoMWdExZNiwyzLyjLhUIO9JIS6xpo9Ehhab9LCWO/yljvWHW7i4gR7c2Z4Ei3Y3eAjk5goVdC5lAZXC1w505ubj1Nc7QC46bbhWS3XLE= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BABDF4BA79A7 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso83239565e9.0 for ; Mon, 25 May 2026 12:18:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779736720; x=1780341520; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=AFs82120LrTgeK7dqja1srAiqsB4Eb0fXbQpF+IC4tk=; b=gpZfUeoQGG9t5Rmc69XoD/e05epRbdTaSkGadM6OTHynhHc9XIMM++CAZ6qvVUGv1x //jOCFFVDemGUx/PKN5CP8HjIaQP8333Io56vvBLgaFnAD2PDuoygNrlpLLqSBd5o30L bk888z2xcUwbXA8II08MJ3YwT8QKa6ZwZMz62K9PXkOV42Yhl5rSzhE6kISXEyYom3Rt aCoWOfaGrq/TJxmex8f4I7XCwVhcW5Mkl7AuA6XAXhT0TYb5e50ulKm1+17Cz17gUeov bl+RK785K4yBMJIAcN2BO7iuSMmbEaAQa+E7+WU5D16gR96mUNAicw5XwiyrbTgHZxwP joow== X-Gm-Message-State: AOJu0Yz4+bL7hMBJ9vB7FMPbyt1f9i/svfYat1zC0ZDXBO2KQDE72oXo LkVmWyce7nAXEC72wacjuzVqgLywst5H4d+zp1cKUXK/hQU1IuE4tzOnQq+tmA== X-Gm-Gg: Acq92OGUUbMeRE6BKO3MmAhNYTfxXtkXSGzHq+2ek6ddwiVKHk3iduPx9iOZz43b+nJ ZzgAzuyGgE8vrnZ/7fMjjdMpjmE6YlLbEL1FYZNyAJP0JfbS9P69iuIFMe+LObjZMQueHBzjMkY bl+SgMNpLIfahcKO828r8pLMOK6KYnL823xcngURF0wYKrVKZRJ4bUm9/LxSOAgiISCcfD8zUNP ImaRnA00fjoPMrSE8uqiE/AKMRcFjYLXM9gXCTs+YvH8U772w0MRn2YQPV7kWrt+MTjxrcvgPRW PuLU5X5Qyo2nryknu9N5boI/2NiE1HoYpGZuSaXXl44wZJ14PgVCvZzM1o52BKl1KSnMWbInhfy 2crnMkstihZPy0p5YARukUlHBNc+ESu03zBAQxavuedv+sr55Yt7rufqZy+mL9SEO4NP37aAhnu O8UKuIa6dyGhy5U2zSrfi0UA== X-Received: by 2002:a05:600c:1392:b0:490:46bf:17ab with SMTP id 5b1f17b1804b1-49046ce6026mr243647965e9.29.1779736719341; Mon, 25 May 2026 12:18:39 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:2600:dc16:ec0f:632c:5ba7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-490428ee444sm93772685e9.24.2026.05.25.12.18.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 May 2026 12:18:39 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 02/11] Adjust gdb.base/exitsignal.exp for MinGW, second-chance SIGSEGV Date: Mon, 25 May 2026 20:18:20 +0100 Message-ID: <20260525191829.984105-3-pedro@palves.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260525191829.984105-1-pedro@palves.net> References: <20260525191829.984105-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On native Windows a segmentation fault is delivered as a SEH exception, so GDB stops twice: once for the first-chance exception, and -- if no SEH handler in the inferior catches it -- again for the second-chance exception, after which the process dies. The testcase currently continues only once, resulting in: ... continue Continuing. Thread 1 received signal SIGSEGV, Segmentation fault. 0x00007ff765ac1469 in main (argc=1, argv=0x9f2640) at C:/rocgdb/src.cascais-rsync/gdb/testsuite/gdb.base/segv.c:24 24 *(volatile int *) 0; (gdb) PASS: gdb.base/exitsignal.exp: trigger SIGSEGV continue Continuing. Thread 1 received signal SIGSEGV, Segmentation fault. 0x00007ff765ac1469 in main (argc=1, argv=0x9f2640) at C:/rocgdb/src.cascais-rsync/gdb/testsuite/gdb.base/segv.c:24 24 *(volatile int *) 0; (gdb) FAIL: gdb.base/exitsignal.exp: program terminated with SIGSEGV ... Add a second continue on MinGW to step past the second-chance stop. With this, gdb.base/exitsignal.exp passes cleanly on MinGW: -FAIL: gdb.base/exitsignal.exp: program terminated with SIGSEGV +PASS: gdb.base/exitsignal.exp: trigger SIGSEGV, second-chance +PASS: gdb.base/exitsignal.exp: program terminated with SIGSEGV Change-Id: Ibda1540a602b62c26a5b218d930402eccc3ba98f commit-id: 385755c8 --- gdb/testsuite/gdb.base/exitsignal.exp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/exitsignal.exp b/gdb/testsuite/gdb.base/exitsignal.exp index 5099ae1a1d6..341197cf0c8 100644 --- a/gdb/testsuite/gdb.base/exitsignal.exp +++ b/gdb/testsuite/gdb.base/exitsignal.exp @@ -53,7 +53,13 @@ gdb_test "print \$_exitcode" " = void" \ gdb_test "continue" "(Thread .*|Program) received signal SIGSEGV.*" \ "trigger SIGSEGV" -if {[istarget "*-*-cygwin*"]} { +if {[istarget "*-*-mingw*"]} { + # We're debugging a pure Win32 program with no SEH handler. The + # previous continue caught the first-chance exception. Now we + # catch the second-chance. + gdb_test "continue" "Thread .* received signal SIGSEGV.*" \ + "trigger SIGSEGV, second-chance" +} elseif {[istarget "*-*-cygwin*"]} { # Cygwin calls DebugBreak before it lets the process exit. gdb_test "continue" "Thread .* received signal SIGTRAP.*" \ "trigger try_to_debug SIGTRAP" -- 2.53.0