From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F3DF383F238; Fri, 16 Dec 2022 16:06:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F3DF383F238 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671206775; bh=de6NMl4Mudp2DRPeT7pxOsIF+jPzmJiGMD5a9IeWUVY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XOc0njJqG9gvrzdhUlFaZ1OBKOgR/ElYX1uAoefD7we5QDX3IVYOJ6d+QBXsDO0Gz QIVorLigglGB49gJwh4Ln5FBtdxJMm9wvDo8eHm0Y8b096JtLXGp3R7opt9x2Z3IkW 3IXu6+2C1+5LXshkLa34uR9TI7lwctnKAy9ORl80= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29907] gdb tries to open /proc/pid/mem even for --version Date: Fri, 16 Dec 2022 16:06:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pedro at palves dot net X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29907 --- Comment #2 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Pedro Alves : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9dff6a5d54f2= 12f875b6551444393691a2410f3e commit 9dff6a5d54f212f875b6551444393691a2410f3e Author: Pedro Alves Date: Fri Dec 16 12:04:54 2022 +0000 Delay checking whether /proc/pid/mem is writable (PR gdb/29907) As of 1bcb0708f229 ("gdb/linux-nat: Check whether /proc/pid/mem is writable"), GDB checks if /proc/pid/mem is writable. This is done early at GDB startup, in order to get a consistent warning, instead of a warning that depends on whenever GDB writes to inferior memory. PR gdb/29907 points out that some build systems (like QEMU's, apparently) may call 'gdb --version' to check GDB's presence & its version on the system, and that Gentoo's build process has sandboxing which blocks the /proc/pid/mem access and thus GDB warns, which results in build fails. To help with that, this patch delays the /proc/pid/mem check until we start or attach to an inferior. Ends up potentially emiting a warning close where we already emit other ptrace- and /proc- related warnings, which just Feels Right. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29907 Change-Id: I5537653ecfbbe76a04ab035e40e59d09b4980763 --=20 You are receiving this mail because: You are on the CC list for the bug.=