From 612322bbbde153ee68a04fba6ae1bc547d8da315 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 18 May 2009 04:41:48 +0000 Subject: [PATCH] Merge parts of r9775, r9777, r9789, r9794 from the DARWIN branch. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9883 --- helgrind/tests/filter_stderr | 7 ++++--- memcheck/tests/x86-linux/scalar.c | 4 ++++ memcheck/tests/x86-linux/scalar.stderr.exp | 18 +++++++++--------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/helgrind/tests/filter_stderr b/helgrind/tests/filter_stderr index 5b710686d..8b90d7126 100755 --- a/helgrind/tests/filter_stderr +++ b/helgrind/tests/filter_stderr @@ -11,7 +11,7 @@ $dir/../../tests/filter_addresses | sed "/^Helgrind, a thread error detector/ , /./ d" | # Anonymise line numbers in hg_intercepts.c -sed "s/hg_intercepts.c:[0-9]\+/hg_intercepts.c:.../g" | +sed "s/hg_intercepts.c:[0-9]*/hg_intercepts.c:.../g" | # Change (eg) "/lib64/libpthread-2.5.so" into "/...libpthread..." sed \ @@ -45,8 +45,9 @@ sed -e "s/frame #[0-9][0-9]*/frame #x/g" | \ # "Thread #x was created" stack traces are unreliable once you get above # "pthread_create@* (hg_intercepts.c:...)" -- they can contan # "pthread_create@GLIBC_", "do_clone", "clone", etc. So we cut all the -# "at"/"by" lines above "pthread_create@*". -perl -p -0 -e 's/(Thread #. was created\n)( (at|by)[^\n]*\n)*( by 0x........: pthread_create@\* \(hg_intercepts.c:...\)\n)/$1 ...\n$4/gs' | +# "at"/"by" lines above "pthread_create@*". We also convert +# "pthread_create" into "pthread_create@*". +perl -p -0 -e 's/(Thread #. was created\n)( (at|by)[^\n]*\n)*( by 0x........: pthread_create)(@\*)?( \(hg_intercepts.c:...\)\n)/$1 ...\n$4@*$6/gs' | # Anything below "mythread_wrapper" in stack traces is unreliable, # containing libc and libpthread stuff like start_thread, clone, etc. So we diff --git a/memcheck/tests/x86-linux/scalar.c b/memcheck/tests/x86-linux/scalar.c index 057ed703b..b853c0345 100644 --- a/memcheck/tests/x86-linux/scalar.c +++ b/memcheck/tests/x86-linux/scalar.c @@ -17,6 +17,10 @@ // when memory is unaddressable, and so tries to dereference it when doing // PRE_MEM_READ/PRE_MEM_WRITE calls. (Note that Memcheck will // always issue an error message immediately before these seg faults occur). +// +// The output has numbers like "3s 2m" for each syscall. "s" is short for +// "scalar", ie. the argument itself is undefined. "m" is short for "memory", +// ie. the argument points to memory which is unaddressable. int main(void) { diff --git a/memcheck/tests/x86-linux/scalar.stderr.exp b/memcheck/tests/x86-linux/scalar.stderr.exp index 9949fde1f..96a97cf26 100644 --- a/memcheck/tests/x86-linux/scalar.stderr.exp +++ b/memcheck/tests/x86-linux/scalar.stderr.exp @@ -582,25 +582,25 @@ Syscall param sigaction(act->sa_handler) points to unaddressable byte(s) ... Address 0x........ is 0 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) Syscall param sigaction(act->sa_mask) points to unaddressable byte(s) ... Address 0x........ is 4 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) Syscall param sigaction(act->sa_flags) points to unaddressable byte(s) ... Address 0x........ is 8 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) Syscall param sigaction(oldact) points to unaddressable byte(s) ... Address 0x........ is 0 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) ----------------------------------------------------- 68: __NR_sgetmask n/a ----------------------------------------------------- @@ -1212,13 +1212,13 @@ Syscall param sigprocmask(set) points to unaddressable byte(s) ... Address 0x........ is 0 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) Syscall param sigprocmask(oldset) points to unaddressable byte(s) ... Address 0x........ is 0 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) ----------------------------------------------------- 127: __NR_create_module ni ----------------------------------------------------- @@ -1731,7 +1731,7 @@ Syscall param rt_sigaction(act->sa_handler) points to unaddressable byte(s) ... Address 0x........ is 4 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) Syscall param rt_sigaction(act->sa_mask) points to unaddressable byte(s) ... @@ -1741,13 +1741,13 @@ Syscall param rt_sigaction(act->sa_flags) points to unaddressable byte(s) ... Address 0x........ is 8 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) Syscall param rt_sigaction(oldact) points to unaddressable byte(s) ... Address 0x........ is 4 bytes after a block of size 4 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (scalar.c:24) + by 0x........: main (scalar.c:28) ----------------------------------------------------- 175: __NR_rt_sigprocmask 4s 2m -----------------------------------------------------