From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id s7aANVyCdGbygQEAWB0awg (envelope-from ) for ; Thu, 20 Jun 2024 15:26:20 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=D3VmD+z1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CCF431E0C1; Thu, 20 Jun 2024 15:26:20 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 BAF541E092 for ; Thu, 20 Jun 2024 15:26:18 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 457B93893651 for ; Thu, 20 Jun 2024 19:26:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 457B93893651 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1718911578; bh=ruPgHiaTi30ap/J+xH7JxdxQ1vwCGKqCt1ZrFnCyWOQ=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=D3VmD+z1WzVZ4Uicz/DWJqT7RQSYcgZIn7+lgMIB+ZFMrMhF63oilTMPO0mYT1mu5 9aES3Hu0OqUAKjShR2ur8ZegCFN+yvdm6WsCq8lct8/vsCuJwXMHvhsHbiNbCVOm2o na0zLs3muhFAW5J7q1Tpqy9T0a4lRSZrgjoAmhVg= Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id DCBDE3890431 for ; Thu, 20 Jun 2024 19:25:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCBDE3890431 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DCBDE3890431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718911537; cv=none; b=nXli9nPvVq6IZuyhTmyknUsSL9dgRNLfbDOrFsUcr83cqf3o7oKTC6aHd35P4JHL+ZfZ9ACo1rM+gv9IVy9ye724mppK9leS+wnLeXA0sQDieMsAkHHs/BEa06FmybxEO9Eo/RxYEsiE0f0EFgIe1q+VBdy23fAwuVoF7XYx3tE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718911537; c=relaxed/simple; bh=ruPgHiaTi30ap/J+xH7JxdxQ1vwCGKqCt1ZrFnCyWOQ=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=iJaJbmPchXRjr1eNshtxHYMQtdzsOMxSMrWhK6pdMw3efCa6VEMxOVj6F0vl8dn+eh6V7QFV5RbJhqRwrFlBYEQ13qTIEw1vpk/3rbQNzrO9yKT37xMuILe4f2KJ42bRTzZ+Ts2ydKjLCALCBt3gNPY1kg77AnW8wK0bJCP/H1M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-52c85a7f834so1647603e87.0 for ; Thu, 20 Jun 2024 12:25:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718911533; x=1719516333; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ruPgHiaTi30ap/J+xH7JxdxQ1vwCGKqCt1ZrFnCyWOQ=; b=B/l8pxkvSk57G0TkUAYywzoTcqer1I//veGJSOJPdGF3501IaDurIvVI1Yfh41X9Cz hNgHg3FXV+bq+dJSGq/e6iKRmhqxWhQiylZIxOioK1vLvLPXbACN2PZFpHBxWpPumI7C LLZuk4Bn5tqf6AN42ORmTMYFktepCSBRdUZNALzMpHe5sn50pfNv28w5sH3O2IE9BJiT NMbAPNU4sva7+uptVPVz5jNyv7aAumHAWfDyxt4xTklBdLEPISshMlAXZ3Kn3wHNlUv1 EtOigxAdhGSVr0lucT7hCugxr+8WfjyhVPUWJPXvRmObxmy/VfTsai8VUh07jIwiXnvo 5ZSA== X-Gm-Message-State: AOJu0YwnhyAKVPY5orE4BvUSSL7emjrK7NfgaSv0KqPkzxYqDnMidWzT B14YJBIwm8p3e4DNS88U9rmqadtcKM54pvWxZcxZjdxFt5mzUbqi1BBkSBL/td4q6+W4DcBR1GL mBYoTxbIF+5C7y9wffgz/3WpJfE7CjpfxfTc= X-Google-Smtp-Source: AGHT+IFVxOQ+wIqqAfD4W210/GVM78AbF8CwCzjOKX9QYkWVI7o1NT+U4Y2KBqbKkTyce7eBBvf+JWVnFP5GNaBoB08= X-Received: by 2002:a05:6512:3c9e:b0:52b:82d5:8fd2 with SMTP id 2adb3069b0e04-52ccaa97444mr4762921e87.47.1718911533365; Thu, 20 Jun 2024 12:25:33 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 20 Jun 2024 12:25:21 -0700 Message-ID: Subject: `sys.exit` from Python no longer exits the GDB process To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Gulshan Singh via Gdb Reply-To: Gulshan Singh Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" I'm using GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git on Ubuntu 24.04, and I'm observing different behavior with `sys.exit` in Python then when I was using GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1 on Ubuntu 22.04. In GDB 12.1, `sys.exit(1)` in Python would exit the GDB process with an exit code of 1. In GDB 15.0, I'm seeing that there's an exception message instead, and GDB does not exit: ``` Python Exception : 1 Error occurred in Python: 1 ``` Is this a bug or intentional behavior? I work on an open source Python GDB plugin that has some unit tests that get run inside GDB. When an exception occurs, it's caught and we exit with `sys.exit` so we can check the return code from our test running scripts. But with the latest GDB this no longer happens, eventually we run the `quit` command, and the exit code is zero. If this is intended behavior, is there any alternative we can use to quit GDB with a non-zero exit code from Python?