From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KFGNA2Ro0GdVSQwAWB0awg (envelope-from ) for ; Tue, 11 Mar 2025 12:44:20 -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=SmKofkpO; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0A02F1E105; Tue, 11 Mar 2025 12:44:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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.0 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 7EEF41E08E for ; Tue, 11 Mar 2025 12:44:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A15E385783B for ; Tue, 11 Mar 2025 16:44:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A15E385783B 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=SmKofkpO 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 EF8023858435 for ; Tue, 11 Mar 2025 16:43:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF8023858435 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 EF8023858435 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741711427; cv=none; b=U1+iyiLMwJUkY24JXvCWdPZt6TEcBoD0v144UNjDbxLM9kGZ6jDAxKnoP+4BS1xBg6hW7oHDBNz5IsF8tjDzTOM12oClDWy6MNZjBD7d2NmyC+jUvLPQOBuw2R50h1iB7kYR9WY26YsqBS7+k0xS+dKsDgeJm+QIiAabV2wb2/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741711427; c=relaxed/simple; bh=gncjv4J9aRbqtyfhAOAeQXq+8EDAb1JGc7/54ZSjBao=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=VsISRVsDMA7qFHyToFhYH5jQc7BNg+ayOnnN1P/JKHy5XAz8lHUzo6RMm+k+yMYGhG0+Wol8AG11PlUPFgrTEirixph2xbvCwIS1pscLcfeqGAsqvvDQMcAw0yU//HYVg+HcInE6UL3iuDQqbdd7QOpIbDUBBsNHjbjqEb3/Cdg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF8023858435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741711426; 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=cwMhYfmyWNLyYApezYtnZqLq0r2f4zpODtuQAGry7j0=; b=SmKofkpOT5kUBRswM2Bb6bvjDFVJszAaWMowy0vYEzgMcB4Zx23iUr9CmztTPwWyuNf9c2 cl4aM1iORakyDqpWh6RbHr7XE2JFzchm/qINj/MP/JvDa4DIww4iIrcXXp+M2tzCf670Sa JwrRp/jGe+z+5wWFpyDJAQqSdvOhd+c= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-202-5inrnX-DP3G2gh0y8Vdmhg-1; Tue, 11 Mar 2025 12:43:45 -0400 X-MC-Unique: 5inrnX-DP3G2gh0y8Vdmhg-1 X-Mimecast-MFC-AGG-ID: 5inrnX-DP3G2gh0y8Vdmhg_1741711424 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2240a96112fso174069445ad.2 for ; Tue, 11 Mar 2025 09:43:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741711424; x=1742316224; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cwMhYfmyWNLyYApezYtnZqLq0r2f4zpODtuQAGry7j0=; b=KWfG8HOomOSuP9cEpkxgQsBfq/EFedD5evGBsm1KU9EwWCn0uFswWicgXNosaSC7B8 VwZgIy/KFTIYHskjNpg4jsds+mXVrM7XCBpQgcrRiDI6D0ugdQMLa17iHtt2V//MfgLY +BOnYMaovKCKXWW9uZoBieYz2AgOK6a9G95X6hkJjF84DRAI1u52DzMh9U6mN7+ok+9Y ssywRROIVLvQSCF93Jw1Hz6UshEf+ccFzSUZcyCtBpEAAqPNVzftwgfC1qyIMOIwl5kJ Spdey3TUJs562AgK3Fu4Py7vQF4Gx8CSPXmwbf++OZt61k8/ttMcx5JHJMx4z7LsevdY zhdw== X-Forwarded-Encrypted: i=1; AJvYcCXhcIonoPt0An++tLbNOr7J4EANprYO8g/iajrXdh+t8HgbKXjBRR1t/orz8VcXQ90hA7187RTbm4U9aw==@sourceware.org X-Gm-Message-State: AOJu0YxlsI2XHIhPyHdpClNaYaelMektzzCye4pG8DM5Bd8P2OmLir4Z DQwZsYNxBSEw/rJ5GrpMzGSh31jYggcDdDU/nBVP76HlLK7Ba19ocLh48qtQjLcvHopq2t79snf A+TmkXS2QikMfilOtc0A/kQgQbR16l5pde5MFysYEFwJ9+KGk5al+2nt23VXwK+N89QQ= X-Gm-Gg: ASbGnct0e7JaW8WDGbdZEw5qGm0R6TxSUMOju8jQDOr5K1yXXaJrbBw1N4yB0xotMIE ymslxbuSKEznWs/Ncnw9iglH2OmpVuD5G3UGOze6jvLfQwh7rjUX91KNe0LYSfl3u07ivJ2nHCt 7ppxEPVCv7OxBw23uZpDnwA0DpUEz/Lq8MgzDjm/AABhM8uo7mYXAM1Bi0vVj8H+4HqRbt1Ip6S UkEE43ZfjhDCRQcu8Ke0wLZgY3/NgNuUTAmYtWdeIlX+WQAMsCBeoYoK/2SKwOkYiOjp+a2edqF pxwuUtHNnkLj2E81+3ZPIDHr3YI= X-Received: by 2002:a17:902:ce0a:b0:216:2bd7:1c4a with SMTP id d9443c01a7336-224289945b0mr290186755ad.26.1741711423919; Tue, 11 Mar 2025 09:43:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaRLg5fVEFQmVLpXLPP8cjd8JcfXs8FPfd/uKT7WiOMSDa9g/jt2CXvQsznFPFyozdTUGKgw== X-Received: by 2002:a17:902:ce0a:b0:216:2bd7:1c4a with SMTP id d9443c01a7336-224289945b0mr290186545ad.26.1741711423611; Tue, 11 Mar 2025 09:43:43 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:9a69::1000? ([2804:14d:8084:9a69::1000]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddfbcsm100460125ad.21.2025.03.11.09.43.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Mar 2025 09:43:43 -0700 (PDT) Message-ID: <104a6c3d-8ab0-4e0b-a897-5d1ef7b2d562@redhat.com> Date: Tue, 11 Mar 2025 13:43:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] gdb/testsuite: add test for memory requirements of gcore To: Simon Marchi , gdb-patches@sourceware.org References: <20250225134544.2129276-1-guinevere@redhat.com> <20250226175058.3060581-2-guinevere@redhat.com> <52f3a732-7866-45e8-9070-8f2aa143c5e7@simark.ca> From: Guinevere Larsen In-Reply-To: <52f3a732-7866-45e8-9070-8f2aa143c5e7@simark.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: SBnhCxO6g0ZLF58WtglvQcgkym2DGk__iBpZAOuqGlo_1741711424 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 3/11/25 1:14 PM, Simon Marchi wrote: > On 2/26/25 12:50 PM, Guinevere Larsen wrote: >> For a long time, Fedora has been carrying an out-of-tree patch with a >> similar test to the one proposed in this patch, that ensures that the >> memory requirements don't grow with the inferior's memory. It's been >> so long that the context for why this test exists has been lost, but >> it looked like it could be interesting for upstream. >> >> The test runs twice, once with the inferior allocating 4Mb of memory, >> and the other allocating 64Mb. My plan was to find the rate at which >> things increase based on inferior size, and have that tested to ensure >> we're not growing that requirement accidentally, but my testing >> actually showed memory requirements going down as the inferior increases, >> so instead I just hardcoded that we need less than 2Mb for the command, >> and it can be tweaked later if necessary. >> --- >> >> Linaro flagged an issue in v2, where GDB couldn't set a breakpoint in >> line 51 (where i was incremented). That sounds like a gcc issue, >> optimizing i away because it was unused, but to avoid having this come >> and go as GCC changes, I changed to set a bp directly on the sleep line. >> This should work now. > On my CI, I see: > > The gcore command used 2 Mb (3004 Kb) > FAIL: gdb.base/gcore-memory-usage.exp: 4 Mb: gdb did not use too much memory > > The gcore command used 2 Mb (3004 Kb) > FAIL: gdb.base/gcore-memory-usage.exp: 64 Mb: gdb did not use too much memory > > Locally if I try to build with the same configuration, I get: > > The gcore command used 1 Mb (1640 Kb) > PASS: gdb.base/gcore-memory-usage.exp: 64 Mb: gdb did not use too much memory > > I don't know why there's a difference. It's not the same distribution > or tool versions, it could be a lot of things. > > Note that I build with Asan, UBSan and -D_GLIBCXX_DEBUG=1, all of which > can raise the memory usage. Also, on the CI, the workers are > containers, so perhaps it does something to the reported stats. > > I don't really know if I should investigate that further or just bump > the threshold for "too much memory". > > Simon > The original test just hardcoded 4 Mbs of memory for the 64Mb case (and only had that case). I tried to make it more useful by analyzing the growth of memory usage instead, but there seems to be no growth in memory... So I think it's fine to just bump it up. -- Cheers, Guinevere Larsen She/Her/Hers