Bug 2208574

Summary: Disable valgrind-monitor python scripts
Product: Red Hat Enterprise Linux 8 Reporter: Mark Wielaard <mjw>
Component: valgrindAssignee: Mark Wielaard <mjw>
valgrind sub component: system-version QA Contact: Jesus Checa <jchecahi>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: fweimer, jakub, jchecahi, ohudlick, qe-baseos-tools-bugs, wcohen
Version: 8.9Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: valgrind-3.21.0-3.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2208571 Environment:
Last Closed: 2023-11-14 15:32:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Deadline: 2023-06-12   

Description Mark Wielaard 2023-05-19 15:22:52 UTC
One of the new features for valgrind 3.21.0 (see bug #2124345) are the gdb python scripts. But currently when you use these, gdb will warn a lot:

warning: File "/usr/libexec/valgrind/valgrind-monitor.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /usr/libexec/valgrind/valgrind-monitor.py
line to your configuration file "/home/mark/.config/gdb/gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/mark/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"

And even when fixing that, the python script doesn't fully load because the gdb in rhel 8 is too old to support all features.

My suggestion is to disable these scripts. We could try to backport the support in gdb, but it seems better to disable the feature in 8.9 and recommend users to upgrade to 9.3 if they want to use this new feature.

We have a patch upstream that adds a configure --without-gdb-scripts option to not install these scripts.

Comment 1 Jesus Checa 2023-05-30 11:27:25 UTC
Tested with valgrind-3.21.0-3.el8. The warnings are not showing up anymore.

Output from valgrind-3.21.0-2.el8:
-----
0x0000000004017cd0 in _start () from /lib/ld-linux-aarch64.so.1
Breakpoint 1 at 0x400694: file something.c, line 10.
warning: File "/usr/libexec/valgrind/valgrind-monitor.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /usr/libexec/valgrind/valgrind-monitor.py
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"

Breakpoint 1, main (argc=1, argv=0x1ffefff578) at something.c:10
----

Output from valgrind-3.21.0-3.el8:
----
0x0000000004016110 in _start () from /lib/ld-linux-aarch64.so.1
Breakpoint 1 at 0x400644: file something.c, line 10.

Breakpoint 1, main (argc=1, argv=0x1fff00dfc8) at something.c:10
----

Comment 6 errata-xmlrpc 2023-11-14 15:32:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (valgrind bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6953