| Summary: | tests/filter_libc: remove the line holding the futex syscall error entirely | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Stefan Maksimovic <stefan.maksimovic> |
| Component: | general | Assignee: | Julian Seward <jseward> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mark, mips32r2 |
| Priority: | NOR | ||
| Version First Reported In: | 3.15 SVN | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Proposed solution | ||
Did anyone have a chance to take a look at this? (In reply to Stefan Maksimovic from comment #1) > Did anyone have a chance to take a look at this? Sorry, missed this. You are right that the whole line needs to be removed. The problem is that older glibc versions didn't emit a newline. See https://sourceware.org/PR20271 This was fixed in glibc-2.29. So a fix should remove the message with or without newline at the end. I am unable to replicate the issue on my setup. But I think the following would work:
diff --git a/tests/filter_libc b/tests/filter_libc
index 9607db5..8eb9911 100755
--- a/tests/filter_libc
+++ b/tests/filter_libc
@@ -37,6 +37,8 @@ while (<>)
s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../;
# Some glibc versions complain about unexpected futex syscall errors.
+ # With or without newline (see sourceware PR20271).
+ next if /^The futex facility returned an unexpected error code.$/;
s/The futex facility returned an unexpected error code.//;
print;
Does that work for your setup?
Approved on irc by Julian. commit eacf885df231037fd6a02ada7a7cafb44ce6b89c Author: Mark Wielaard <mark@klomp.org> Date: Thu Apr 11 18:01:24 2019 +0200 filter_libc: remove the line holding the futex syscall error entirely The current filter might leave empty lines behind. This is caused by the fact that glibc used to not include a newline in the message. But since glibc 2.29 it does. https://bugs.kde.org/show_bug.cgi?id=405205 Reported-by: Stefan Maksimovic <stefan.maksimovic@rt-rk.com> |
Created attachment 118641 [details] Proposed solution SUMMARY At the moment the message reported by glibc is removed by the perl substitute command, leaving an empty line it its place. This change alters tests/filter_libc so as to remove the line containing the futex error message completely; effectively we skip printing the line altogether. Need for this arose when observing a build process initiated by a buildbot, in which case the 'make regtest' command was invoked via ssh. In that case a terminal isn't spawned so the abovementioned message is printed to stderr which gets filtered by tests/filter_libc (cf. building valgrind regularly; the message is printed directly to the terminal, not stderr, hence does not get filtered). After this change no empty line is printed instead of the message, so there are no conflicts with the existing stderr.exp files for the helgrind/tests/{tc18_semabuse,tc20_verifywrap}. These two tests were the ones where the stderr failure was observed. I did not observe any regressions for mips32, mips64 or x86 after this change. STEPS TO REPRODUCE 1. Run either a single test or 'make regtest' via ssh remotely 2. Run the same command locally 3. Observe the difference in the futex syscall error message being printed to stderr in the first case, whereas it is printed directly to the terminal in the second case for the two tests mentioned OBSERVED RESULT An additional newline appears in the tc18_semabuse and tc20_verifywrap stderr.out files EXPECTED RESULT No empty line generated