From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ua7gJsIgcGp8QQEAWB0awg (envelope-from ) for ; Mon, 03 Aug 2026 01:01:54 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=xL/cwlv0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9B15A1E09E; Mon, 03 Aug 2026 01:01:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 [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 496D81E033 for ; Mon, 03 Aug 2026 01:01:54 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 801204BB1C06 for ; Mon, 3 Aug 2026 05:01:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 801204BB1C06 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=xL/cwlv0 Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by sourceware.org (Postfix) with ESMTPS id CBFE04BAE7F0 for ; Mon, 3 Aug 2026 05:01:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBFE04BAE7F0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CBFE04BAE7F0 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::931 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785733284; cv=none; b=LV6ieh4+ciekzbPTh+8xfitFcJnpThHT0hPq92LFCgsuHwHuqlFyoi7KljCFFC+dhd7QLDSmwwyLxpEBL26aHoLfS/oNRUl3nfK/hyNrLOYogwq9yBk9NgMvDAzh8I/5aAkjbCZ4rgTtk6g/0K7s4UTsB96SmOFJay2I+0inG9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785733284; c=relaxed/simple; bh=YSrCpvfpOzB3hQkZ8itq9Fwzujw1Fqho3RtmeQ9ROwY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JtTGy3V6iIt9uYr/mlZlYu7FmJ9fTPofedAQFOTLuzk9tu9l5KA6m65/49Ns7SFIiJe+HdzdGtc7HSo26MC7W/Lm+N1Y3yqsmyBCtl5H/bf4U3C4NbxUYIq6yjtQZfjm1CyVo603cNWSBxAslsXutgHU+Zy8eAkw3d6kOr0jj9c= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=xL/cwlv0 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBFE04BAE7F0 Received: by mail-ua1-x931.google.com with SMTP id a1e0cc1a2514c-963a722ed59so631922241.1 for ; Sun, 02 Aug 2026 22:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1785733284; x=1786338084; darn=sourceware.org; h=content-type:mime-version:message-id:date:user-agent:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=sS7AbHb6S6nqRkF89p1rvnWd7B9P3x4cVXlH+L+yhRs=; b=xL/cwlv0frLfmzYksj7X3EkJR21s0oF7bJUgd+9DAWEI8PeCvYZt5R+xX/L8gihsUo YGekmAKXSMGucVjA47qOL5RqxyFq7imuqrxFOP0kZS3vbVvvjcrLRIFTxBVjmB4V4ioo kOs5PY7OGxcoE74PnvVRnrOflRT4lDfnq7B+JH2N7uiYy3V2ZdyYeidLL+yAGtk0o5dx V1XhL2AH7524vtnDP4vlCbLQQXqQNlitKmIND54yteZjOOYsDsNyvOixcfrO6xM0zIqJ F3UBbsKOIprBRW8d78g6Uabpv5yIylO+vePRpH+Jq8z+k7rLVoNRF4/BYxv25hnjSvXa 3Bnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733284; x=1786338084; h=content-type:mime-version:message-id:date:user-agent:references :in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=sS7AbHb6S6nqRkF89p1rvnWd7B9P3x4cVXlH+L+yhRs=; b=LdBnaKpbshuM55zy926VWkBt5l32of4RQikH32BnJ4qbFoL1NcFIvFYT5jGYxSR1MF iE8fFd4WG3XEJJ8YwDfxTq7amPsV9K+JgA0H75bNi3pcMMOcuEV3qzPu84TqjQ1Kjtmy X3P0Yfv1zDruqFYDsMCeOvKQ2GmA44EtX4k5iprMVfqV3+5lk52psgTxBcB7bfGgAlYQ FaTSjUharmBxCfs2Mqqf8hsiNqLIpR2cfgR7i0913a//ViGp4ZJkl8RsqpZNUbRVPfzv OCuG77Sz/udpf74OPst8AtZmuSqodqeRe051gCv0tQlyRhPc2GLF/jTsLT6Nzged6b/K Xm5g== X-Gm-Message-State: AOJu0Yyygn5gFX0eYLfuuQIiKkQoXIu6qcpDIwYI/b0CKgdL1zagQwIE MnVArcFdCRxwttupKhaYbAISUiLbP1b/ct42C/NF4Sco8v/1YijIFzLu/zJLcyBk3Ks= X-Gm-Gg: AR+sD12EweaHsk7l5dvWmXIyVCGVBpewO7Y/oY8jVOQzxHYo2062SJglmUtwgAQ04gX JDoXSeEiRga08W1kqQC1YEcFhrZomjloBtO4HlGT8c1YgsdgifLzqIwk9UgcdMSjbo6Yv3W3D1W db46JKjXEt7vijhVHiX8nvJMxMA/j7VvkdgANDl/37hiirsC8ibsqEM6J9ZyfvTLrj02BkYHjCK gS1MHj04NS9XktSfH6bRNgWZo6ZwEOH0g8Y9QcH+duTlEXcLTi+hrIzLisBX/2aCt5jYFLELsMX BUvhNhwsEw1zfDWbBzQc1ITeFYAT5GRe1ysNSDoyiOa6W7MTP3nhNUoiF7FAlCLwUog3xL5M0H/ 5NTchf671GnLLjdhgOudgouSr8HLgtym22ARyJtzS3J3UKAF6rjFRX7rgAexsgNL/WPIVnopP2c RqlSos+s7eigZJUuGaj/67zutIMhbbs5TpcYSojDX2jDLvYwsIRynS+mMRq9z+H70JoNqXsv8= X-Received: by 2002:a05:6102:50a8:b0:739:71ef:d772 with SMTP id ada2fe7eead31-75b22064adfmr6102163137.4.1785733284249; Sun, 02 Aug 2026 22:01:24 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-977e6a40a5csm5771931241.10.2026.08.02.22.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:01:23 -0700 (PDT) From: Thiago Jung Bauermann To: Matthieu Longo Cc: , Luis Machado , Luis Machado , Simon Marchi , "Kevin Buettner" , Christina Schimpe , Christina Joos Subject: Re: [PATCH v1 5/6] gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t In-Reply-To: <20260728151700.253720-6-matthieu.longo@arm.com> (Matthieu Longo's message of "Tue, 28 Jul 2026 16:16:59 +0100") References: <20260728151700.253720-1-matthieu.longo@arm.com> <20260728151700.253720-6-matthieu.longo@arm.com> User-Agent: mu4e 1.14.2; emacs 30.2 Date: Mon, 03 Aug 2026 05:01:21 +0000 Message-ID: <87cxvz3ihq.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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 Matthieu Longo writes: > The previous implementation of linux_find_memory_regions_full could > still return success even when none of the /proc/PID/[s]maps files > existed, or all reads returned 0 bytes (this last case can happen on > Linux when the thread-group leader has exited). > As a result, the function could incorrectly succeed, allowing core > dump generation via the gcore command. > This logical defect was allowing, by chance, the function to return > success and hence, allowing fortuitously the coredump generation via > gcore command (see gcore-stale-thread test for more details). > > A previous patch in this patch series fixed this issue by using the > first LWP ID of the current inferior instead of relying on the PID. > This patch adapts the code to use file_reader_t and makes the function > return an error if reading any of the procfs files fails. > --- > gdb/linux-tdep.c | 23 ++++++++++------------- > 1 file changed, 10 insertions(+), 13 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago (he/him)