From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kaK8GlDoBWoLRToAWB0awg (envelope-from ) for ; Thu, 14 May 2026 11:20:48 -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=Y9W4DSJK; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 68C881E067; Thu, 14 May 2026 11:20:48 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE, 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 CA01D1E067 for ; Thu, 14 May 2026 11:20:47 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9C254BC7EE6 for ; Thu, 14 May 2026 15:20:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9C254BC7EE6 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=Y9W4DSJK Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 1CA754BB8F7A for ; Thu, 14 May 2026 15:20:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CA754BB8F7A 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 1CA754BB8F7A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778772020; cv=none; b=yGL1IEzzWns7m3ZTnp9sdB/gelejEL6se8MUlzYAozG9cBLQNXlCA6FEZyCFsVGgUKlPSH4uyiHapBhqJQwSeMHzBp0BjaCaCTPbSzgm0z01R8Ib2nSa9OZRKY8y7+WhFUhkMsAHbPwUOWU01y2zyWmpupzVEg+VKlNsS8VdtRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778772020; c=relaxed/simple; bh=Q+QAbUvCsWVn0ZUvJR9U820NSD9Aaqq0InbnBH+AZ/U=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=IGPWjJrXLLSl7+6/Leb5xh+8jeLv9wEssfb98Bl/lBlTTFtQiqzPq+rp13+zfNJg7MJmroikNqBNRxmVYSsHoF3qw03oXWskg/bBHF5bUzqByi91SqlODYMDsmMwUS0U+nVqzJyUYrDm76W1c2XwwZ4NHll/a5QPXvsKEWKFwkI= 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=Y9W4DSJK DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CA754BB8F7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778772019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OikubVEpryZCC3ikv+5rzSf7GDxQOV372zS2ryEYXC0=; b=Y9W4DSJK/kkir5lGft5auf/5cqu0U+jP6yl3GRGGpyoAtT3RBH77mW/uI7nFsei5U2gBin uQzTXaFeR7fM5JR29lnfoG+VfAfb7IQJ3dOV8fkGfdFjWv59q9jmnZGHhaJWAc5O4tu5AK ehQDlzbpmC87Sd2nZg9cl6PAxA2l5UQ= Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-zRh6kfhePZ-3ajo43fmUKA-1; Thu, 14 May 2026 11:20:16 -0400 X-MC-Unique: zRh6kfhePZ-3ajo43fmUKA-1 X-Mimecast-MFC-AGG-ID: zRh6kfhePZ-3ajo43fmUKA_1778772015 Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-30230e64087so1801836eec.0 for ; Thu, 14 May 2026 08:20:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778772015; x=1779376815; h=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=OikubVEpryZCC3ikv+5rzSf7GDxQOV372zS2ryEYXC0=; b=cCHvRGnGrJizfYhB1/3jdEJXA3Vb4ZHPlFov6lAo5ttmifNJqA7Ko/LI/lKlTkbhW9 9jAGfeN1UBNw4XQsgThaPBf0V3vTRQRwr8cDWKSrNrPtfjExcL2BDjGUgvCiDwN0r9p+ h4WVg+4Tiael/5ESGdiVhFrsvk93PPHRej90JgDjBDpWSZTlkLkHHBsrHcv6+yL9Njgr S7AtAttVzwNuQ/CDGSpO+T6RsI4MarmDIklAKugS+qdbXL64x0KdbsghYP60Lrnlw+TO gG5Hj5pX20FyVos/afvHi5ALtbbi8x/94W6urDX+azZxGb6nUYFj8i8P2+lgONhpJ+dQ 9pow== X-Forwarded-Encrypted: i=1; AFNElJ/jnYpZR/yD/YAqDpEGqPq5juK80iYxgiI5AfSRp8E/bWODrfUi4/B3/4NrwjmA/YAuFqGnEQJPEleaKQ==@sourceware.org X-Gm-Message-State: AOJu0Yxq2yO4hH9L1e6OuXwOoZiZLsulp7U//WmkRjKXfudoz0m6Dx+0 Ht+1baUpa/0l8/EIaJqlOGImwqAIb/SCk48rdIrydBLDBfzagRZnXdEYWbarjZiOE9bkLmHEN1K faWdjWmgb2gUoq9Y4YnWBK6Z7Xo6UYgA3OEgbSWUOs7dg3NcuA+zXMzzRh94p/I4= X-Gm-Gg: Acq92OH9zihjg4IFs6VWVl1b0bvP4/On4dY43kBXzA+TvNi75BXn4c75GD6jEA26vHI Y4on5coD5Rmd7VrgsnaO6pyJqrycWWwwGx57zrknISJ0iBX6Togx3GXfzUsbhMFbrumx2d7JOOf DAHvZfhkmQx3PBpIxrRsTDgPLjpiCOG96HCwzgMqfMvdOl94G1n/zHFlFgE5zcrAYcTJfFVfFP/ Pp/f7WUFifm10qiYlZEX7pG+q+OWOs85lK+SphgvBKtWjwB/EFS0+OOVJNpQ+Pc+J1CBw8DV4OP 7MOZWyFmBwe5jxcvqudKpp0N+vrCCYbxP9OOOSe2VuQI4cBZWThxiaSDfZmFnyeFQIdmd7VPj9q aOdC9DNhj/HvTVWr6u3RBkuBv4YBCFbGkLxQjyapPkCZdNZrf4QcQvLBTeZWtfn+cVji2VNzwvB Enog4= X-Received: by 2002:a05:7300:dc86:b0:2d9:f0b3:1d98 with SMTP id 5a478bee46e88-30153cd0d7emr4304850eec.7.1778772015230; Thu, 14 May 2026 08:20:15 -0700 (PDT) X-Received: by 2002:a05:7300:dc86:b0:2d9:f0b3:1d98 with SMTP id 5a478bee46e88-30153cd0d7emr4304829eec.7.1778772014574; Thu, 14 May 2026 08:20:14 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:993e:2d5d:7adb:2b6:a50e? ([2804:14d:8084:993e:2d5d:7adb:2b6:a50e]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30293e2e3c0sm3788165eec.3.2026.05.14.08.20.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2026 08:20:14 -0700 (PDT) Message-ID: <4c825e40-13af-4ce7-9169-de2737643ab8@redhat.com> Date: Thu, 14 May 2026 12:20:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/6] gdb/record: Refactor record history To: "Schimpe, Christina" , "gdb-patches@sourceware.org" References: <20260423152604.171356-1-guinevere@redhat.com> <20260423152604.171356-2-guinevere@redhat.com> <9de15785-0595-417b-b14d-fe5820738231@redhat.com> <23236510-ef59-4396-91eb-5763725f01cc@redhat.com> From: Guinevere Larsen In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4_xAnQw_GVODXHbeCAIKUt-Wf7kXgUhEYXjN-VTNSJI_1778772015 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="------------9GXWl0x0wlLKo0DHJTavhBRm" Content-Language: en-US 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 This is a multi-part message in MIME format. --------------9GXWl0x0wlLKo0DHJTavhBRm Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/13/26 4:54 AM, Schimpe, Christina wrote: >>>>>> + record_full_incomplete_instruction.effects.shrink_to_fit (); >>>>>> + record_full_list.push_back (record_full_incomplete_instruction); >>> I think this line will at some point call the default copy constructor of >> record_full_mem_entry >>> and record_full_reg_entry, which have those buffers: >>> >>> gdb_byte buf[sizeof (gdb_byte *)]; >>> >>> IIUC you'll only have a shallow copy. Should we use a std::move instead >> here? >> Might be worth, yeah... >>> I further wonder if this problem might be related to the double free issues >> you >>> describe in patch #3. Would you mind checking? >> I did check it! When I was working on patch #3, I disabled copy >> construction, only allowed move constructor/assignment because I >> specifically thought that the vector push_back was the reason for the >> double frees, but it still happened. > That's weird, it would have perfectly explained it. > So with std::move we still have this problem? > Would you mind sharing some backtrace of this double free error ? Huh... I guess I must have done something wrong when I tried this the last time I just redid the changes to make the cleanup function into the destructors and now things just worked. I'll polish it a bit and send a v3 with that update! Thanks for getting me to try it again :) -- Cheers, Guinevere Larsen It/she --------------9GXWl0x0wlLKo0DHJTavhBRm Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 5/13/26 4:54 AM, Schimpe, Christina wrote:
+  record_full_incomplete_instruction.effects.shrink_to_fit ();
+  record_full_list.push_back (record_full_incomplete_instruction);
I think this line will at some point call the default copy constructor of
record_full_mem_entry
and record_full_reg_entry, which have those buffers:

gdb_byte buf[sizeof (gdb_byte *)];

IIUC you'll only have a shallow copy. Should we use a std::move instead
here?
Might be worth, yeah...
I further wonder if this problem might be related to the double free issues
you
describe in patch #3. Would you mind checking?
I did check it! When I was working on patch #3, I disabled copy
construction, only allowed move constructor/assignment because I
specifically thought that the vector push_back was the reason for the
double frees, but it still happened.
That's weird, it would have perfectly explained it.
So with std::move we still have this problem?
Would you mind sharing some backtrace of this double free error ?

Huh... I guess I must have done something wrong when I tried this the last time

I just redid the changes to make the cleanup function into the destructors and now things just worked. I'll polish it a bit and send a v3 with that update! Thanks for getting me to try it again :)

-- 
Cheers,
Guinevere Larsen
It/she
--------------9GXWl0x0wlLKo0DHJTavhBRm--