From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GQkiNYxBT2oeSy0AWB0awg (envelope-from ) for ; Thu, 09 Jul 2026 02:37:00 -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=titAiuQm; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D59631E098; Thu, 09 Jul 2026 02:37:00 -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=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 63E241E04F for ; Thu, 09 Jul 2026 02:37:00 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F165C4BA2E14 for ; Thu, 9 Jul 2026 06:36:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F165C4BA2E14 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=titAiuQm Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by sourceware.org (Postfix) with ESMTPS id 0265E4BA2E3E for ; Thu, 9 Jul 2026 06:36:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0265E4BA2E3E 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 0265E4BA2E3E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::112f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783578990; cv=none; b=atd0xRhXKVV3AYmGhB4UYDTVv9/g++FaL37s7WTHVou25cUvx/rMiEXYYQw5+iLhCxyRUtjnnlrAnY+w7trxputyf9CJ78xXQYEC//N+KgJHO1mMVAZ3LDZWv9rjCGRmGZZgjCY7c+WB79OQJjjRVhv3HuOLbYqeJamEltMFLpM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783578990; c=relaxed/simple; bh=KCZeV6nEAM/ZSRZEo/WzXJh+kdxaT7jHxHzTr1kp4Ng=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kUcFPMUQUlo0VeV//2ZbQMGSM9f82zCeOn6ytiAX5O8t18UH47/S4OiFGH+BWabrY6nAg7bcN1ot9kwGp/tkPewapbA/4ZkJpV1tdZL6wZdxWT2Giu/oiwxAsCi8SqHlBj5+1uq0Q0sUeYS9t/7E1R+xv7NOgpy5MrdknF0pSVo= 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=titAiuQm DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0265E4BA2E3E Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-81062fdeaf5so9726597b3.0 for ; Wed, 08 Jul 2026 23:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783578989; x=1784183789; darn=sourceware.org; h=content-transfer-encoding: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=XscEibaI12qJYp1MbnJphQXlyNITIwjUElzJmeKzBh4=; b=titAiuQmaMuGEg36OkgMY/HG5fLO8ZnM1Gq6jihAytdDBreKo3ZWVGuKtZWRZ2rQu4 TjVN2T1haEWRl8n3i8ssG1fuDmJPcJSX+5RVnC5yQ2Nu1onuRRcrlsRiqrMeqMPxnyib JEZj/8ib+6hUC9iz+bhmVvq5QkWlNG7m8GLEFMC/DUTv1zcEli4KDFr4UVYCAYlylvax 7bo8aytrmoKZ18WoC3JHKrxWfOWzGbnzoIbOFbEsSMg2x+xv2eOSFzZMjZq6vPCW752i yGvGI62ztMW/iH8x7QCyeA3g0iub/MpZ9NEpxZIJ2nDO1LwXzqVBxsV196RL8L1k6zA7 MuRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783578989; x=1784183789; h=content-transfer-encoding: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=XscEibaI12qJYp1MbnJphQXlyNITIwjUElzJmeKzBh4=; b=X4f1z82Q+iGjEZkPSN0JDOndHfx0IW8/rBRNdXCLU8PqsKRFHbXf/gbqGi5cGhg82v vxFTixHpA4AfQ24CZ+f+NNwnRxWkY4NsHKnPtVI5D5AA0M/rq9jcYaFtNvmB3RALpSUD wo/vMupmn8RK93iRs2MKlznSWbZnd9h9l1JPOcVWtzOon6eYk/VQRb0QMIUXKozt2beu 1IdNu5lQl/8YgP3JnZrHiyvSDAEebdk7utBV+MpvzdunPkwHqvfJmAdTwAn50GZ/ZSsL tw+n3bth+UVT1qfKBay3fYuUkrY36DYwEpl3aEwxkoF0Wr/Q5oHFcVkzn03aHlyOQzIR KCBQ== X-Gm-Message-State: AOJu0YwU8pMtDIL6I0zNnqJyx8D1xeB4h7BT/xggqO5Ae6qvCAcAz6Lh m1eVUY/Npjzc+/CGUID7c0d5O6fykAH+yffwnW2VPycBRfSrSK80Pd2gHp7LsgHPViM= X-Gm-Gg: AfdE7cn5RL4ZCGxRVJa+bvirbJH4BsAELweUe9p8aXWl9jXkpyg4hOObk1KeYephyoy F6M8vVEm8ygFkgdiFKPcKGqVy6WbGdCgKM0lJwZUvb+kPBu7bosyIR+gib5jXmX5XUgF8Lfdqch wMnrto3agb9DmTYHvoHf95No9lYrr/R4anSf3rtq2e4NtlKpIKo24sRA/gpC6v1YohP3KA6GtMs gfBS0cC6rLzdicZQGysQTX8h9wTsLpdrUvsh4pBaTCpade92wxDRwJ3/7mJI79MUD5iIaKltO5j ZB3HD3ZQyE+MnOo7xEtvOgtDUw5b76LsN0bao0m7GJHbxkCZG99v2z06NucUpN1DVdxB3W00j9m VMkotN4xAcq8k6ou8L64zcqz0RVQU+yfLKvt/TX4Zg3sgCy86Yn+IrutQkCrPszAm55IVlr6DTv 1547Ao3Ouhkijg+Dyu5LffWZZ4O6gDr2/8Mg== X-Received: by 2002:a05:690c:e211:10b0:81e:6cdf:b3eb with SMTP id 00721157ae682-81e6cf4cfc6mr8912777b3.33.1783578989296; Wed, 08 Jul 2026 23:36:29 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81e6c199c5asm10497477b3.32.2026.07.08.23.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 23:36:28 -0700 (PDT) From: Thiago Jung Bauermann To: Matthieu Longo Cc: , Luis Machado , Luis Machado , Andrew Burgess , "Yury Khrustalev" , Pedro Alves , "Tom Tromey" Subject: Re: [PATCH v1 07/10] gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t In-Reply-To: <20260707154900.94542-8-matthieu.longo@arm.com> (Matthieu Longo's message of "Tue, 7 Jul 2026 16:48:57 +0100") References: <20260707154900.94542-1-matthieu.longo@arm.com> <20260707154900.94542-8-matthieu.longo@arm.com> User-Agent: mu4e 1.14.2; emacs 30.2 Date: Thu, 09 Jul 2026 06:36:26 +0000 Message-ID: <87zf00zn2t.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 codedump generation via > gcore command (see gcore-stale-thread test for more details). Did you run into this problem, or just noticed it by inspecting the code? If the former, do you think it's worth adding a testcase to make sure this problem doesn't appear again? > 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 is reading any of the procfs files fails. Typo: is =E2=86=92 if > --- > gdb/linux-tdep.c | 23 ++++++++++------------- > 1 file changed, 10 insertions(+), 13 deletions(-) Reviewed-by: Thiago Jung Bauermann --=20 Thiago (he/him)