From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cRL8JjLGO2rcOhYAWB0awg (envelope-from ) for ; Wed, 24 Jun 2026 07:57:38 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gTuWjqgJ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 958451E024; Wed, 24 Jun 2026 07:57:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 0F7221E024 for ; Wed, 24 Jun 2026 07:57:38 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E4A134BA2E05 for ; Wed, 24 Jun 2026 11:57:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4A134BA2E05 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gTuWjqgJ Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id EF7EE4BA2E04 for ; Wed, 24 Jun 2026 11:57:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF7EE4BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EF7EE4BA2E04 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782302232; cv=none; b=HqFGVgiJ4ASgHPkK1mtyyDH0nJQZSZsRG4kbrUgcgQCfbh9WEt2RyG1CDvI5/9xuGWDriMdkfskGSJewGBEVkWnkicvqx0nF5kRGPyJdBwL03dnbdXkjEVkuR4FcOgWrwILV0mkEreYwEbary9nQJxbv/hG+n4IQl0/glpy9N8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782302232; c=relaxed/simple; bh=TAqYGVHgeWJv612if2JVLLsE7VvBmz0f8jNAu1hujoo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=j+gUdJwptGTP8MBz7g0rIxMf8+5zXozjrMU1QdTkrG+SSqHQBEJWBzuKivkzzO8lparjjGZ3VLZLClhnZOMYTmMY7tcYzkBbdqJbUtFSbZoIfKMROKmImMXmGNG36tcHgVe73cSFRwreAYdO7xTzAbD9+EcctUShu9s5vgbOYd8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gTuWjqgJ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF7EE4BA2E04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782302231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mn5sb4MDqSGpFiiy9u0MkW2nti/R2vdeZ16yC4rcXTs=; b=gTuWjqgJc+UHWzsudXPnNMxbNhYkUY5NiQx6q+74jXP0n56PIevbjeEocNB1bpbSwg8ErV ItJ3bkAPWKhkWz9tXQ0TaU4xQ+y7Qbt7xzzHcoNijK0xkb7bwuTht4y6xPlWB16tiksWol rgqOJUpyusqw7O7opydAyyC14tnVV1c= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-KnntqWNAPc2w2WaV_ORAKQ-1; Wed, 24 Jun 2026 07:57:10 -0400 X-MC-Unique: KnntqWNAPc2w2WaV_ORAKQ-1 X-Mimecast-MFC-AGG-ID: KnntqWNAPc2w2WaV_ORAKQ_1782302229 Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-726d05f883cso376401137.1 for ; Wed, 24 Jun 2026 04:57:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782302229; x=1782907029; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Mn5sb4MDqSGpFiiy9u0MkW2nti/R2vdeZ16yC4rcXTs=; b=riZVmKwype48lnS9/e8b6QVkgBP5bMaIoleUu86SYzHTAu69RmNByXd1LzapRKsg/h Gia+O98vhM1/vGs3wbahJ061uSZDtVlUawcM3bO6CX6bIqR8YHiT92N/KI4B7cEog1Fo 8H2DRNNurUo1inUSuP5OULBGZrzFFRz0wa2ExJukSHYkrv10TD1XWwLugvXF1g3w4czw BH9t3/Usxu2/8lT9qyB9OxtK5eGIFQYkbfomFAhKx2lEcydn1YroNigfvosgEPILmG+F IoEEEHttBO+JIIKuEPA9Vq5GVR9LvDQnHeTw6F7kzUAJrO1bl7aaSixjh9zqyIqfGabu wlXg== X-Forwarded-Encrypted: i=1; AFNElJ+tzwE9ixVTKcnfmsjvPlmZTL4jo/7/TBpPalp+0qdKdr09pZuZPhGNIWD5IzZnmuLMbK+x/Yc3JzbpzQ==@sourceware.org X-Gm-Message-State: AOJu0Yy4Yhd1X7JdQDwGSg0g9V24Qg69s/e77v9JqzruDXoeWHRi/8S7 J4bcmWBNxLAvtWnl1+Jhr1Bucvbcga417DdzTJsmuoMsKHYPxTtqy7FStO8V1uXxInrQmi2L1Oa 1VXa14qChgnchfsNjdd8YvcJrltcqTFqUQRYnHRs+aD7yOlUakhiA74oC7o1aT2hcaHyHblQ= X-Gm-Gg: AfdE7cmSsp/8OEcVUBhzFFl5qq3Q4raaT9gZr9rNhQCOcK/N6AaBlyz8+erH7LHpO4o 9YyuW7Arf13ivxkZ0IDCT3qKzPMRSr2Nw1luheLeStWswgqwXO3YQXRJNe9BHOeCzpC0oaTL4CZ SJ8OVXrvQQcgYXcUu1Q6X35+FvYnHiJR/LvRDXyWjLFm8yqpQ17CiPItxoegbkQMU1ecjAOrurP 2DnnrNcGdXlr0tJexm8CmoZZ3kMaTw+X0lIt9QyMg6KgsIZYnregX10WDYHsX1zu3PoVDDaUzUA /Fx0uAKgprSotiFmzP1VQMLmV5K8I19QwJiuWUpdTsiyk4dAklcayxQEQ+bgiwleV1v5Txh70DQ X1iGrWjZZJZoBRzsL/xnS X-Received: by 2002:a05:6102:8019:b0:726:cd42:d042 with SMTP id ada2fe7eead31-72b669d5d27mr10730493137.14.1782302229486; Wed, 24 Jun 2026 04:57:09 -0700 (PDT) X-Received: by 2002:a05:6102:8019:b0:726:cd42:d042 with SMTP id ada2fe7eead31-72b669d5d27mr10730481137.14.1782302228900; Wed, 24 Jun 2026 04:57:08 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:993e::75d? ([2804:14d:8084:993e::75d]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-72ba4f2926dsm9641608137.7.2026.06.24.04.57.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2026 04:57:08 -0700 (PDT) Message-ID: Date: Wed, 24 Jun 2026 08:57:05 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdbsupport: Remove some use after move instances To: Simon Marchi , gdb-patches@sourceware.org References: <20260623202153.2743258-2-guinevere@redhat.com> <9f13ec54-880e-436b-845d-05b914178e37@simark.ca> From: Guinevere Larsen In-Reply-To: <9f13ec54-880e-436b-845d-05b914178e37@simark.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: NpCIIxAXY2hQbTSkZ-lNSVTjkDl0jdiy4F-NtIREPIk_1782302229 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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 6/23/26 5:30 PM, Simon Marchi wrote: > > On 2026-06-23 16:21, Guinevere Larsen wrote: >> A static analysis tool was ran on GDB and pointed out some instances of >> "use after move" in GDB. The instances that could be easily removed >> are related to move constructors for exceptions, that were using the >> parameter's reason in an assert, when they could instead just use their >> own internal "reason" member. > I think it's useful to name the tool and if possible paste one example of > such warning. That can help if someone needs to dig into that change > later (or even when reviewing). Right, makes sense. For completeness on the mailing list, the tool was Coverity (I think), and the failure is the following: Error: USE_AFTER_MOVE (CWE-457): gdb-17.1/gdbsupport/common-exceptions.h:281:7: move: "ex" is moved (indicated by "std::move(ex)"). gdb-17.1/gdbsupport/common-exceptions.h:283:5: use_after_move: "ex" is used after it has been already moved. #  281|       : gdb_exception (std::move (ex)) #  282|     { #  283|->     gdb_assert (ex.reason == RETURN_ERROR); #  284|     } #  285|   }; > But otherwise this LGTM. > > Approved-By: Simon Marchi > > Simon > -- Cheers, Guinevere Larsen it/its she/her (deprecated)