public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version
@ 2022-12-16 6:56 sam at gentoo dot org
2022-12-16 6:57 ` [Bug gdb/29907] " sam at gentoo dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-12-16 6:56 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29907
Bug ID: 29907
Summary: gdb tries to open /proc/pid/mem even for --version
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: sam at gentoo dot org
CC: pedro at palves dot net
Target Milestone: ---
Build systems (like QEMU's, apparently) may call 'gdb --version' to check gdb's
presence & its version on the system.
As of 1bcb0708f22956d5128a2e75df6eba5a18327892, gdb will check if /proc/pid/mem
is writable, including for 'gdb --version' calls.
Gentoo's build process has sandboxing which blocks this access and then as a
result the build fails.
Is it possible to skip this the /proc/pid/mem check for simple --version
invocations? Thanks.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/29907] gdb tries to open /proc/pid/mem even for --version
2022-12-16 6:56 [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version sam at gentoo dot org
@ 2022-12-16 6:57 ` sam at gentoo dot org
2022-12-16 12:32 ` pedro at palves dot net
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-12-16 6:57 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29907
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unknown |HEAD
See Also| |https://bugs.gentoo.org/sho
| |w_bug.cgi?id=886189
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/29907] gdb tries to open /proc/pid/mem even for --version
2022-12-16 6:56 [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version sam at gentoo dot org
2022-12-16 6:57 ` [Bug gdb/29907] " sam at gentoo dot org
@ 2022-12-16 12:32 ` pedro at palves dot net
2022-12-16 16:06 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pedro at palves dot net @ 2022-12-16 12:32 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29907
Pedro Alves <pedro at palves dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at sourceware dot org |pedro at palves dot net
--- Comment #1 from Pedro Alves <pedro at palves dot net> ---
Fix posted here:
[PATCH] Delay checking whether /proc/pid/mem is writable (PR gdb/29907)
https://sourceware.org/pipermail/gdb-patches/2022-December/194817.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/29907] gdb tries to open /proc/pid/mem even for --version
2022-12-16 6:56 [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version sam at gentoo dot org
2022-12-16 6:57 ` [Bug gdb/29907] " sam at gentoo dot org
2022-12-16 12:32 ` pedro at palves dot net
@ 2022-12-16 16:06 ` cvs-commit at gcc dot gnu.org
2022-12-16 16:14 ` pedro at palves dot net
2022-12-16 23:10 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-16 16:06 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29907
--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9dff6a5d54f212f875b6551444393691a2410f3e
commit 9dff6a5d54f212f875b6551444393691a2410f3e
Author: Pedro Alves <pedro@palves.net>
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=29907
Change-Id: I5537653ecfbbe76a04ab035e40e59d09b4980763
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/29907] gdb tries to open /proc/pid/mem even for --version
2022-12-16 6:56 [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version sam at gentoo dot org
` (2 preceding siblings ...)
2022-12-16 16:06 ` cvs-commit at gcc dot gnu.org
@ 2022-12-16 16:14 ` pedro at palves dot net
2022-12-16 23:10 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: pedro at palves dot net @ 2022-12-16 16:14 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29907
Pedro Alves <pedro at palves dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Pedro Alves <pedro at palves dot net> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/29907] gdb tries to open /proc/pid/mem even for --version
2022-12-16 6:56 [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version sam at gentoo dot org
` (3 preceding siblings ...)
2022-12-16 16:14 ` pedro at palves dot net
@ 2022-12-16 23:10 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-12-16 23:10 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29907
--- Comment #4 from Sam James <sam at gentoo dot org> ---
Many thanks for the speedy resolution!
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-12-16 23:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 6:56 [Bug gdb/29907] New: gdb tries to open /proc/pid/mem even for --version sam at gentoo dot org
2022-12-16 6:57 ` [Bug gdb/29907] " sam at gentoo dot org
2022-12-16 12:32 ` pedro at palves dot net
2022-12-16 16:06 ` cvs-commit at gcc dot gnu.org
2022-12-16 16:14 ` pedro at palves dot net
2022-12-16 23:10 ` sam at gentoo dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).