|
From: <sv...@va...> - 2009-06-24 03:49:24
|
Author: njn
Date: 2009-06-24 04:49:19 +0100 (Wed, 24 Jun 2009)
New Revision: 10366
Log:
Abort if a dir is given to --suppressions. Fixes bug 197456.
Added:
trunk/memcheck/tests/supp-dir.stderr.exp
trunk/memcheck/tests/supp-dir.vgtest
Modified:
trunk/coregrind/m_errormgr.c
trunk/memcheck/tests/Makefile.am
Modified: trunk/coregrind/m_errormgr.c
===================================================================
--- trunk/coregrind/m_errormgr.c 2009-06-24 03:45:31 UTC (rev 10365)
+++ trunk/coregrind/m_errormgr.c 2009-06-24 03:49:19 UTC (rev 10366)
@@ -952,6 +952,15 @@
Char* err_str = NULL;
SuppLoc tmp_callers[VG_MAX_SUPP_CALLERS];
+ // Check it's not a directory.
+ if (VG_(is_dir)( filename )) {
+ if (VG_(clo_xml))
+ VG_UMSG("</valgrindoutput>\n");
+ VG_UMSG("FATAL: suppressions file \"%s\" is a directory", filename );
+ VG_(exit)(1);
+ }
+
+ // Open the suppression file.
sres = VG_(open)( filename, VKI_O_RDONLY, 0 );
if (sr_isError(sres)) {
if (VG_(clo_xml))
Modified: trunk/memcheck/tests/Makefile.am
===================================================================
--- trunk/memcheck/tests/Makefile.am 2009-06-24 03:45:31 UTC (rev 10365)
+++ trunk/memcheck/tests/Makefile.am 2009-06-24 03:49:19 UTC (rev 10366)
@@ -149,6 +149,7 @@
strchr.stderr.exp strchr.stderr.exp2 strchr.stderr.exp-darwin \
strchr.vgtest \
str_tester.stderr.exp str_tester.vgtest \
+ supp-dir.vgtest supp-dir.stderr.exp \
supp_unknown.stderr.exp supp_unknown.vgtest supp_unknown.supp \
supp1.stderr.exp supp1.vgtest \
supp2.stderr.exp supp2.vgtest \
Added: trunk/memcheck/tests/supp-dir.stderr.exp
===================================================================
--- trunk/memcheck/tests/supp-dir.stderr.exp (rev 0)
+++ trunk/memcheck/tests/supp-dir.stderr.exp 2009-06-24 03:49:19 UTC (rev 10366)
@@ -0,0 +1,2 @@
+
+FATAL: suppressions file "x86/" is a directory
Added: trunk/memcheck/tests/supp-dir.vgtest
===================================================================
--- trunk/memcheck/tests/supp-dir.vgtest (rev 0)
+++ trunk/memcheck/tests/supp-dir.vgtest 2009-06-24 03:49:19 UTC (rev 10366)
@@ -0,0 +1,2 @@
+prog: ../../tests/true
+vgopts: --suppressions=x86/
|