From: Mark Wielaard Date: Tue, 12 Oct 2021 16:51:23 +0000 (+0200) Subject: drd/tests: Extract start_thread which can come from libpthread or libc X-Git-Tag: VALGRIND_3_18_0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df838bccab28311b06836d032f54df9973c9cb74;p=thirdparty%2Fvalgrind.git drd/tests: Extract start_thread which can come from libpthread or libc The drd/tests/tc21_pthonce and drd/tests/annotate_barrier tests would fail if start_thread came from libc (as it does in glibc 2.34) instead of from libpthread. Extract start_thread in filter_stderr.in and update the backtraces in annotate_barrier.stderr.exp and in tc21_pthonce.stderr.exp Tested against glibc 2.34, 2.33 and 2.17 on x86_64. --- diff --git a/drd/tests/annotate_barrier.stderr.exp b/drd/tests/annotate_barrier.stderr.exp index 1ae8934c34..41296531a9 100644 --- a/drd/tests/annotate_barrier.stderr.exp +++ b/drd/tests/annotate_barrier.stderr.exp @@ -25,7 +25,7 @@ Thread 2: Conflicting store by thread 2 at 0x........ size 4 at 0x........: threadfunc (annotate_barrier.c:?) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - by 0x........: (within libpthread-?.?.so) + by 0x........: start_thread Address 0x........ is at offset 0 from 0x......... Allocation context: at 0x........: malloc (vg_replace_malloc.c:...) by 0x........: barriers_and_races (annotate_barrier.c:?) diff --git a/drd/tests/filter_stderr.in b/drd/tests/filter_stderr.in index aec1d60f5d..e7d975b81b 100755 --- a/drd/tests/filter_stderr.in +++ b/drd/tests/filter_stderr.in @@ -19,6 +19,7 @@ fi | # Remove line numbers referring to drd's source code. # Remove libpthread's version number. # Remove line numbers from stack traces. +# Extract start_thread because it can be in libpthread or libc. $SED \ -e "/^drd, a thread error detector$/d" \ -e "s/^Allocation context: stack of thread \([0-9]*\), offset -[0-9]*$/Allocation context: stack of thread \1, offset .../" \ @@ -30,6 +31,7 @@ $SED \ -e "s/(\(functional\|thread\):[0-9]*)/(\1:...)/" \ -e "s/(tc20_verifywrap.c:261)/(tc20_verifywrap.c:262)/" \ -e "/^Copyright (C) 2006-20.., and GNU GPL'd, by Bart Van Assche.$/d" \ +-e "s/start_thread ([^)]*)/start_thread/" \ -e "s/\([A-Za-z_]*\) (clone.S:[0-9]*)/\1 (in \/...libc...)/" \ -e "s/\([A-Za-z_]*\) (swapcontext.S:[0-9]*)/\1 (in \/...libc...)/" \ -e "s/_swapcontext/swapcontext/" \ diff --git a/drd/tests/tc21_pthonce.stderr.exp b/drd/tests/tc21_pthonce.stderr.exp index b6458280f1..3179b98859 100644 --- a/drd/tests/tc21_pthonce.stderr.exp +++ b/drd/tests/tc21_pthonce.stderr.exp @@ -3,7 +3,7 @@ Thread 3: Conflicting load by thread 3 at 0x........ size 4 at 0x........: child (tc21_pthonce.c:74) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - by 0x........: (within libpthread-?.?.so) + by 0x........: start_thread Allocation context: BSS section of tc21_pthonce Other segment start (thread 2) (thread finished, call stack no longer available) @@ -13,7 +13,7 @@ Other segment end (thread 2) Conflicting store by thread 3 at 0x........ size 4 at 0x........: child (tc21_pthonce.c:74) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) - by 0x........: (within libpthread-?.?.so) + by 0x........: start_thread Allocation context: BSS section of tc21_pthonce Other segment start (thread 2) (thread finished, call stack no longer available)