W dniu 06.04.2015 o 22:26, Tim Rühsen pisze:
> Valgrind suppressions are a bit compiler/architecture/distribution dependent. 
> Maybe you could you add a comment into the suppression file with these infos. 
> As a quick reference and explanation.
I have added a reference URL to Redhat's bugzilla, where the problem is
described.
https://bugzilla.redhat.com/show_bug.cgi?id=678518

> Sorry, one point I missed: Please put the suppression file into EXTRA_DIST 
> variable in tests/Makefile.am. Else it won't go into the tarball (make dist).
Done.

I also refactored a little my modification in the Perl script. (Put the
suppression file path into a variable, and use Cwd to get the correct
path, instead of making relative path from the test being run.)

And I also found a simpler way to suppress that error. Valgrind has an
option --partial-loads-ok which would suppress it (more details can be
found in the URL above).

I am not sure which workaround is better for Wget (suppression file vs.
--partial-loads-ok=yes). What do you think?
(The --partial-loads-ok could suppress actual mistakes in future Wget's
code, while the former just works for the particular function in libidn.so.)

> And yes, if you find a proper way to execute the 'testenv' part no matter if 
> 'tests' fails or not, a patch would be welcome. It always annoyed me, but not 
> enough to put work into it :-(
I will look into it and see if I can find a solution.


Thank you,
Hubert
From 45dc542ad7de79005f7db73b7b6ae8049fa8abac Mon Sep 17 00:00:00 2001
From: Hubert Tarasiuk <[email protected]>
Date: Mon, 6 Apr 2015 12:33:37 +0200
Subject: [PATCH 2/2] Add Valgrind suppresion for libidn.so at
 idna_to_ascii_4z.

* tests/WgetTests.pm (run): Include suppression file when running Valgrind.
* tests/valgrind-suppressions: Add suppression for idn_to_ascii_4z.
---
 tests/Makefile.am           | 2 +-
 tests/WgetTests.pm          | 4 +++-
 tests/valgrind-suppressions | 8 ++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)
 create mode 100644 tests/valgrind-suppressions

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0ea587e..5d387aa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -131,7 +131,7 @@ PX_TESTS = \
 
 EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
              WgetTests.pm WgetFeature.pm WgetFeature.cfg $(PX_TESTS) \
-             certs
+             certs valgrind-suppressions
 
 check_PROGRAMS = unit-tests
 unit_tests_SOURCES =
diff --git a/tests/WgetTests.pm b/tests/WgetTests.pm
index 3d3b9dd..5d9a1e5 100644
--- a/tests/WgetTests.pm
+++ b/tests/WgetTests.pm
@@ -14,6 +14,7 @@ use POSIX qw(locale_h);
 use locale;
 
 our $WGETPATH = '../src/wget';
+our $VALGRIND_SUPP_FILE = Cwd::getcwd() . '/valgrind-suppressions';
 
 my @unexpected_downloads = ();
 
@@ -122,7 +123,8 @@ sub run
     elsif ($valgrind == 1)
     {
         $cmdline =
-          'valgrind --error-exitcode=301 --leak-check=yes --track-origins=yes '
+          'valgrind --suppressions=' . $VALGRIND_SUPP_FILE
+          . ' --error-exitcode=301 --leak-check=yes --track-origins=yes '
           . $cmdline;
     }
     else
diff --git a/tests/valgrind-suppressions b/tests/valgrind-suppressions
new file mode 100644
index 0000000..4026770
--- /dev/null
+++ b/tests/valgrind-suppressions
@@ -0,0 +1,8 @@
+{
+   False positive in libidn.so. More info: https://bugzilla.redhat.com/show_bug.cgi?id=678518
+   Memcheck:Addr4
+   fun:idna_to_ascii_4z
+   fun:idna_to_ascii_8z
+   fun:idn_encode
+   fun:url_parse
+}
-- 
2.3.5

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to