[apparmor] [patch] valgrind test: improve suppressions for false positives

Steve Beattie steve at nxnw.org
Wed Feb 5 16:46:33 UTC 2014


Valgrind is reporting a false positive on the parser:

==13708== Invalid read of size 4
==13708==    at 0x40A1E2: yylex() (parser_lex.l:277)
==13708==    by 0x40FA94: yyparse() (parser_yacc.c:1487)
==13708==    by 0x40C639: process_profile(int, char const*) (parser_main.c:1001)
==13708==    by 0x40CA88: profile_dir_cb(__dirstream*, char const*, stat*, void*) (parser_main.c:1124)
==13708==    by 0x417068: dirat_for_each(__dirstream*, char const*, void*, int (*)(__dirstream*, char const*, stat*, void*)) (lib .c:117)
==13708==    by 0x404122: main (parser_main.c:1330)

The valgrind test wrapper already has a suppression for this, but it's
too strict in that it doesn't handle the code path that comes through
profile_dir_cb(). The following patch widens the suppression on this.

(For running valgrind manually, you can get the test script to dump the
current suppressions via:

  tst/valgrind_simple.py --dump-suppressions > my_suppressions_file

which you can pass to your valgrind invocation like so:

  valgrind --suppressions=my_suppressions_file [blah blah]
)

Signed-off-by: Steve Beattie <steve at nxnw.org>
---
 parser/tst/valgrind_simple.py |    1 +
 1 file changed, 1 insertion(+)

Index: b/parser/tst/valgrind_simple.py
===================================================================
--- a/parser/tst/valgrind_simple.py
+++ b/parser/tst/valgrind_simple.py
@@ -38,6 +38,7 @@ VALGRIND_SUPPRESSIONS = '''
     fun:_Z?yylex?
     fun:_Z*yyparse*
     fun:_Z*process_profile*
+    ...
     fun:main
 }
 

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140205/a77d0d61/attachment.pgp>


More information about the AppArmor mailing list