valgrind: Backport fixes from 3.22 branch
PATCH 1/3 valgrind: Backport fixes from 3.22 branch
These fixes are helping some ptests on musl and 6.6 kernel
--- ....py-regular-expressions-should-use-r.patch | 64 +++++ ...ind-3.22.0-fails-on-assertion-when-l.patch | 147 ++++++++++++ .../0003-Add-fchmodat2-syscall-on-linux.patch | 221 ++++++++++++++++++ ...ind-incompatibility-with-binutils-2..patch | 137 +++++++++++ .../valgrind/valgrind_3.22.0.bb | 4 + 5 files changed, 573 insertions(+) create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch
meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch new file +64 -0
@@ -0,0 +1,64 @@ +From 027b649fdb831868e71be01cafdacc49a5f419ab Mon Sep 17 00:00:00 2001 +From: Mark Wielaard <[email protected]> +Date: Fri, 17 Nov 2023 14:01:21 +0100 +Subject: [PATCH 1/4] valgrind-monitor.py regular expressions should use raw + strings + +With python 3.12 gdb will produce the following SyntaxWarning when +loading valgrind-monitor-def.py: + + /usr/share/gdb/auto-load/valgrind-monitor-def.py:214: + SyntaxWarning: invalid escape sequence '\[' + if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str): + +In a future python version this will become an SyntaxError. + +Use a raw strings for the regular expression. + +https://bugs.kde.org/show_bug.cgi?id=476708 +(cherry picked from commit 0fbfbe05028ad18efda786a256a2738d2c231ed4) + +Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=027b649fdb831868e71be01cafdacc49a5f419ab] +Signed-off-by: Khem Raj <[email protected]> +--- + NEWS | 13 +++++++++++++ + coregrind/m_gdbserver/valgrind-monitor-def.py | 2 +- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/NEWS b/NEWS +index f11da4be8..ee5b4ff11 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,16 @@ ++Branch 3.22 ++~~~~~~~~~~~ ++ ++* ==================== FIXED BUGS ==================== ++ ++The following bugs have been fixed or resolved on this branch. ++ ++476708 valgrind-monitor.py regular expressions should use raw strings ++ ++To see details of a given bug, visit ++ https://bugs.kde.org/show_bug.cgi?id=XXXXXX ++where XXXXXX is the bug number as listed above. ++ + Release 3.22.0 (31 Oct 2023) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +diff --git a/coregrind/m_gdbserver/valgrind-monitor-def.py b/coregrind/m_gdbserver/valgrind-monitor-def.py +index b4e7b992d..d74b1590c 100644 +--- a/coregrind/m_gdbserver/valgrind-monitor-def.py ++++ b/coregrind/m_gdbserver/valgrind-monitor-def.py +@@ -211,7 +211,7 @@ class Valgrind_ADDR_LEN_opt(Valgrind_Command): + For compatibility reason with the Valgrind gdbserver monitor command, + we detect and accept usages such as 0x1234ABCD[10].""" + def invoke(self, arg_str : str, from_tty : bool) -> None: +- if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str): ++ if re.fullmatch(r"^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str): + arg_str = arg_str.replace("[", " ") + arg_str = arg_str.replace("]", " ") + eval_execute_2(self, arg_str, +-- +2.44.0 +
meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch new file +147 -0
147 lines not on this page · raw message
meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch new file +221 -0
221 lines not on this page · raw message
meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch new file +137 -0
137 lines not on this page · raw message
meta/recipes-devtools/valgrind/valgrind_3.22.0.bb +4 -0
@@ -33,6 +33,10 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ file://0001-docs-Disable-manual-validation.patch \ + file://0001-valgrind-monitor.py-regular-expressions-should-use-r.patch \ + file://0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch \ + file://0003-Add-fchmodat2-syscall-on-linux.patch \ + file://0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch \ " SRC_URI[sha256sum] = "c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c" UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
Signature · 1 line
2.44.0
PATCH 2/3 valgrind: Re-enable fixed test cases
These tests have been fixed in prior to 3.22 release
--- meta/recipes-devtools/valgrind/valgrind_3.22.0.bb | 6 ------ 1 file changed, 6 deletions(-)
meta/recipes-devtools/valgrind/valgrind_3.22.0.bb +0 -6
@@ -243,12 +243,6 @@ do_install_ptest() { # https://bugs.kde.org/show_bug.cgi?id=402833 rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest - # This is known failure see https://bugs.kde.org/show_bug.cgi?id=435732 - rm ${D}${PTEST_PATH}/memcheck/tests/leak_cpp_interior.vgtest - - # https://bugs.kde.org/show_bug.cgi?id=445743 - rm ${D}${PTEST_PATH}/drd/tests/pth_mutex_signal - # As the binary isn't stripped or debug-splitted, the source file isn't fetched # via dwarfsrcfiles either, so it needs to be installed manually. mkdir -p ${D}${TARGET_DBGSRC_DIR}/none/tests/
Signature · 1 line
2.44.0
Re: [OE-core] [PATCH 2/3] valgrind: Re-enable fixed test cases
Quoted 6 lines · Khem Raj
These tests have been fixed in prior to 3.22 release
Signed-off-by Khem Raj <[email protected]>---
meta/recipes-devtools/valgrind/valgrind_3.22.0.bb | 6 ------1 file changed, 6 deletions(-)
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6452/steps/13/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6257/steps/13/logs/stdio
Failed ptests:
{'valgrind': ['memcheck/tests/leak_cpp_interior', 'drd/tests/pth_mutex_signal']}
so they're not fixed.
Cheers,
Richard
Re: [OE-core] [PATCH 2/3] valgrind: Re-enable fixed test cases
Quoted 8 lines · Richard Purdie
Quoted 6 lines · Khem Raj
These tests have been fixed in prior to 3.22 release
Signed-off-by Khem Raj <[email protected]>---
�meta/recipes-devtools/valgrind/valgrind_3.22.0.bb | 6 ------ �1 file changed, 6 deletions(-)
Quoted 8 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6452/steps/13/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6257/steps/13/logs/stdioFailed ptests:
{'valgrind': ['memcheck/tests/leak_cpp_interior', 'drd/tests/pth_mutex_signal']}so they're not fixed.
Failed test details...drd/tests/pth_mutex_signal.stderr.diff
************
pth_mutex_signal.stderr.out renamed from pth_mutex_signal.stderr.exp +30 -10
@@ -2,14 +2,34 @@ mutex initialized thread attributes initialized thread created -sleeping -signalling -sleeping -nullHandler running -unlocking -contender locked mutex -contender unlocking mutex -contender unlocked mutex -joining thread -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +Process terminating with default action of signal 6 (SIGABRT) + at 0x........: __pthread_kill_implementation (pthread_kill.c:?) + by 0x........: raise (raise.c:?) + by 0x........: abort (abort.c:?) + by 0x........: __libc_message_impl.cold (libc_fatal.c:?) + by 0x........: __libc_fatal (libc_fatal.c:?) + by 0x........: futex_fatal_error (futex-internal.h:87) + by 0x........: __futex_lock_pi64 (futex-internal.c:203) + by 0x........: __pthread_mutex_lock_full (pthread_mutex_lock.c:?) + by 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: contender_start (pth_mutex_signal.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + by 0x........: start_thread + by 0x........: clone (in /...libc...) +Thread 2: +Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. + at 0x........: __libc_write (write.c:?) + by 0x........: write (write.c:?) + by 0x........: _IO_file_write@@GLIBC_2.2.5 (fileops.c:?) + by 0x........: new_do_write (fileops.c:?) + by 0x........: _IO_new_file_xsputn (fileops.c:?) + by 0x........: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:?) + by 0x........: fwrite (iofwrite.c:?) + by 0x........: main (pth_mutex_signal.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (pth_mutex_signal.c:?) + + +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Failed test details...memcheck/tests/leak_cpp_interior.stderr.diff
************
leak_cpp_interior.stderr.out renamed from leak_cpp_interior.stderr.exp +10 -6
@@ -1,4 +1,7 @@ +Conditional jump or move depends on uninitialised value(s) + ... + valgrind output will go to log VALGRIND_DO_LEAK_CHECK x bytes in 1 blocks are definitely lost in loss record ... of ...
@@ -35,10 +38,10 @@ LEAK SUMMARY: definitely lost: x (+0) bytes in 1 (+0) blocks indirectly lost: 0 (+0) bytes in 0 (+0) blocks - possibly lost: x (-x) bytes in 5 (+1) blocks - still reachable: x (+x) bytes in 3 (-1) blocks + possibly lost: x (-x) bytes in 4 (+0) blocks + still reachable: x (+x) bytes in 4 (+0) blocks of which reachable via heuristic: - newarray : x (+x) bytes in 1 (+1) blocks + newarray : x (+x) bytes in 2 (+2) blocks multipleinheritance: 0 (-x) bytes in 0 (-2) blocks To see details of leaked memory, give 'full' arg to leak_check
@@ -46,11 +49,11 @@ LEAK SUMMARY: definitely lost: x (+0) bytes in 1 (+0) blocks indirectly lost: 0 (+0) bytes in 0 (+0) blocks - possibly lost: x (-x) bytes in 5 (+0) blocks - still reachable: x (+x) bytes in 3 (+0) blocks + possibly lost: x (+x) bytes in 5 (+1) blocks + still reachable: x (-x) bytes in 3 (-1) blocks of which reachable via heuristic: length64 : x (+x) bytes in 1 (+1) blocks - newarray : 0 (-x) bytes in 0 (-1) blocks + newarray : 0 (-x) bytes in 0 (-2) blocks To see details of leaked memory, give 'full' arg to leak_check leak_check summary heuristics stdstring
@@ -133,5 +136,6 @@ All heap blocks were freed -- no leaks are possible +Use --track-origins=yes to see where uninitialised values come from
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [OE-core] [PATCH 2/3] valgrind: Re-enable fixed test cases
yeah drop it for now. I need to check x86 results with gcc
Quoted 124 lines · Alexandre Belloni
Quoted 8 lines · Richard Purdie
Quoted 6 lines · Khem Raj
These tests have been fixed in prior to 3.22 release
Signed-off-by Khem Raj <[email protected]>--- meta/recipes-devtools/valgrind/valgrind_3.22.0.bb | 6 ------ 1 file changed, 6 deletions(-)Quoted 8 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6452/steps/13/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6257/steps/13/logs/stdioFailed ptests:
{'valgrind': ['memcheck/tests/leak_cpp_interior', 'drd/tests/pth_mutex_signal']}so they're not fixed.
Failed test details...
drd/tests/pth_mutex_signal.stderr.diff
************pth_mutex_signal.stderr.out renamed from pth_mutex_signal.stderr.exp +30
-10@@ -2,14 +2,34 @@ mutex initialized thread attributes initialized thread created -sleeping -signalling -sleeping -nullHandler running -unlocking -contender locked mutex -contender unlocking mutex -contender unlocked mutex -joining thread -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +Process terminating with default action of signal 6 (SIGABRT) + at 0x........: __pthread_kill_implementation (pthread_kill.c:?) + by 0x........: raise (raise.c:?) + by 0x........: abort (abort.c:?) + by 0x........: __libc_message_impl.cold (libc_fatal.c:?) + by 0x........: __libc_fatal (libc_fatal.c:?) + by 0x........: futex_fatal_error (futex-internal.h:87) + by 0x........: __futex_lock_pi64 (futex-internal.c:203) + by 0x........: __pthread_mutex_lock_full (pthread_mutex_lock.c:?) + by 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?) + by 0x........: contender_start (pth_mutex_signal.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + by 0x........: start_thread + by 0x........: clone (in /...libc...) +Thread 2: +Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. + at 0x........: __libc_write (write.c:?) + by 0x........: write (write.c:?) + by 0x........: _IO_file_write@@GLIBC_2.2.5 (fileops.c:?) + by 0x........: new_do_write (fileops.c:?) + by 0x........: _IO_new_file_xsputn (fileops.c:?) + by 0x........: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:?) + by 0x........: fwrite (iofwrite.c:?) + by 0x........: main (pth_mutex_signal.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (pth_mutex_signal.c:?) + + +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)Failed test details...
memcheck/tests/leak_cpp_interior.stderr.diff
************leak_cpp_interior.stderr.out renamed from leak_cpp_interior.stderr.exp +10
-7@@ -1,4 +1,7 @@ +Conditional jump or move depends on uninitialised value(s) + ... + valgrind output will go to log VALGRIND_DO_LEAK_CHECK x bytes in 1 blocks are definitely lost in loss record ... of ...@@ -35,10 +38,10 @@ LEAK SUMMARY: definitely lost: x (+0) bytes in 1 (+0) blocks indirectly lost: 0 (+0) bytes in 0 (+0) blocks - possibly lost: x (-x) bytes in 5 (+1) blocks - still reachable: x (+x) bytes in 3 (-1) blocks + possibly lost: x (-x) bytes in 4 (+0) blocks + still reachable: x (+x) bytes in 4 (+0) blocks of which reachable via heuristic: - newarray : x (+x) bytes in 1 (+1) blocks + newarray : x (+x) bytes in 2 (+2) blocks multipleinheritance: 0 (-x) bytes in 0 (-2) blocks To see details of leaked memory, give 'full' arg to leak_check@@ -46,11 +49,11 @@ LEAK SUMMARY: definitely lost: x (+0) bytes in 1 (+0) blocks indirectly lost: 0 (+0) bytes in 0 (+0) blocks - possibly lost: x (-x) bytes in 5 (+0) blocks - still reachable: x (+x) bytes in 3 (+0) blocks + possibly lost: x (+x) bytes in 5 (+1) blocks + still reachable: x (-x) bytes in 3 (-1) blocks of which reachable via heuristic: length64 : x (+x) bytes in 1 (+1) blocks - newarray : 0 (-x) bytes in 0 (-1) blocks + newarray : 0 (-x) bytes in 0 (-2) blocks To see details of leaked memory, give 'full' arg to leak_check leak_check summary heuristics stdstring@@ -133,5 +136,6 @@ All heap blocks were freed -- no leaks are possible +Use --track-origins=yes to see where uninitialised values come from --Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 3/3 readline: Apply patches from readline-8.2-patches
In reply to Khem RajThese patches are submitted/backported to 8.2 release and address issues reported by different distros.
--- .../readline/readline/readline82-001.patch | 45 ++++++++ .../readline/readline/readline82-002.patch | 51 +++++++++ .../readline/readline/readline82-003.patch | 46 ++++++++ .../readline/readline/readline82-004.patch | 68 ++++++++++++ .../readline/readline/readline82-005.patch | 53 +++++++++ .../readline/readline/readline82-006.patch | 102 ++++++++++++++++++ .../readline/readline/readline82-007.patch | 51 +++++++++ .../readline/readline/readline82-008.patch | 80 ++++++++++++++ .../readline/readline/readline82-009.patch | 76 +++++++++++++ .../readline/readline/readline82-010.patch | 70 ++++++++++++ meta/recipes-core/readline/readline_8.2.bb | 12 +++ 11 files changed, 654 insertions(+) create mode 100644 meta/recipes-core/readline/readline/readline82-001.patch create mode 100644 meta/recipes-core/readline/readline/readline82-002.patch create mode 100644 meta/recipes-core/readline/readline/readline82-003.patch create mode 100644 meta/recipes-core/readline/readline/readline82-004.patch create mode 100644 meta/recipes-core/readline/readline/readline82-005.patch create mode 100644 meta/recipes-core/readline/readline/readline82-006.patch create mode 100644 meta/recipes-core/readline/readline/readline82-007.patch create mode 100644 meta/recipes-core/readline/readline/readline82-008.patch create mode 100644 meta/recipes-core/readline/readline/readline82-009.patch create mode 100644 meta/recipes-core/readline/readline/readline82-010.patch
meta/recipes-core/readline/readline/readline82-001.patch new file +45 -0
@@ -0,0 +1,45 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.2 +Patch-ID: readline82-001 + +Bug-Reported-by: Kan-Ru Chen <[email protected]> +Bug-Reference-ID: +Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109 + +Bug-Description: + +Starting a readline application with an invalid locale specification for +LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline. + +Patch (apply with `patch -p0'): + +Upstream-Status: Submitted [https://ftp.gnu.org/gnu/readline/readline-8.2-patches/] +Signed-off-by: Khem Raj <[email protected]> + +*** ../readline-8.2-patched/nls.c 2022-08-15 09:38:51.000000000 -0400 +--- nls.c 2022-10-05 09:23:22.000000000 -0400 +*************** +*** 142,145 **** +--- 142,149 ---- + lspec = ""; + ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */ ++ if (ret == 0 || *ret == 0) ++ ret = setlocale (LC_CTYPE, (char *)NULL); ++ if (ret == 0 || *ret == 0) ++ ret = RL_DEFAULT_LOCALE; + #else + ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec; + +*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2014-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 0 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 1
meta/recipes-core/readline/readline/readline82-002.patch new file +51 -0
51 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-003.patch new file +46 -0
46 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-004.patch new file +68 -0
68 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-005.patch new file +53 -0
53 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-006.patch new file +102 -0
102 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-007.patch new file +51 -0
51 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-008.patch new file +80 -0
80 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-009.patch new file +76 -0
76 lines not on this page · raw message
meta/recipes-core/readline/readline/readline82-010.patch new file +70 -0
70 lines not on this page · raw message
meta/recipes-core/readline/readline_8.2.bb +12 -0
@@ -2,4 +2,16 @@ require readline.inc SRC_URI += " file://norpath.patch" +SRC_URI += "file://readline82-001.patch;striplevel=0 \ + file://readline82-002.patch;striplevel=0 \ + file://readline82-003.patch;striplevel=0 \ + file://readline82-004.patch;striplevel=0 \ + file://readline82-005.patch;striplevel=0 \ + file://readline82-006.patch;striplevel=0 \ + file://readline82-007.patch;striplevel=0 \ + file://readline82-008.patch;striplevel=0 \ + file://readline82-009.patch;striplevel=0 \ + file://readline82-010.patch;striplevel=0 \ + " + SRC_URI[archive.sha256sum] = "3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35"
Signature · 1 line
2.44.0