You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(4) |
2
(2) |
|
3
|
4
(3) |
5
(3) |
6
(5) |
7
(7) |
8
(1) |
9
(7) |
|
10
(7) |
11
(1) |
12
(13) |
13
(4) |
14
|
15
(5) |
16
|
|
17
(1) |
18
(2) |
19
(3) |
20
|
21
|
22
|
23
(1) |
|
24
|
25
|
26
|
27
(1) |
28
(3) |
29
|
30
|
|
31
|
|
|
|
|
|
|
|
From: Paul F. <pa...@so...> - 2021-10-07 21:03:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a456fcef6d97ead3548e8c88cfd676d9847712eb commit a456fcef6d97ead3548e8c88cfd676d9847712eb Author: Paul Floyd <pj...@wa...> Date: Thu Oct 7 23:02:29 2021 +0200 FreeBSD support, patch 9 supplemental These files are now derived objects and should have been removed in the previous change. Diff: --- gdbserver_tests/filter_gdb | 252 -------------------------------- gdbserver_tests/filter_memcheck_monitor | 36 ----- gdbserver_tests/filter_stderr | 16 -- gdbserver_tests/filter_vgdb | 34 ----- 4 files changed, 338 deletions(-) diff --git a/gdbserver_tests/filter_gdb b/gdbserver_tests/filter_gdb deleted file mode 100755 index 13de9cc012..0000000000 --- a/gdbserver_tests/filter_gdb +++ /dev/null @@ -1,252 +0,0 @@ -#! /bin/sh - -# filter the output of gdb. - -SED=/usr/bin/sed - -PATTERNFILE=$(mktemp filter_gdb.tmp.XXXXXXXXXX) -cat > $PATTERNFILE <<EOF -# delete the initial lines between the launch of vgdb and the -# output of the echo command telling it is launched. -# This removes a whole lot of uninteresting lines varying -# with OS/glibc/gdb dep -/Remote debugging using/,/vgdb launched process attached/d - -# general way to delete uninteresting and varying lines. -/filter_gdb BEGIN drop/,/filter_gdb END drop/d - -# initial tty control character sent by gdb 7.0 -s/^\[?1034hReading symbols/Reading symbols/ - -# remove message about missing debuginfos -/^Missing separate debuginfo/d - -# remove messages about not being able to download debuginfos -/^Download failed: /d - -# suppress lines telling file _exit.c does not exist -/\/_exit.c: No such file or directory/d - -# On FreeBSD if the base and/or lib32 dbg components -# are installed but not system source then these -# errors get produced by GDB -/\(rtld_start.S\|kill.S\|_exit.S\|_select.S\): No such file or directory/d - -# Remove some Suse package manager messages -/^Try: zypper install -C/d - -# Remove vgdb message -/relaying data between gdb and process/d - -# Anonymise pid numbers -s/pid [0-9][0-9]*/pid ..../g - -# filter 'remote target killed' messages (produced by gdb >= 8.2) -/(Remote target) killed/d - -# Anonymise Thread numbers -s/Thread [0-9][0-9]*/Thread ..../g - -# delete thread switches -/\[Switching to Thread ....\]/d - -# ??? Probably we had a 'Switching ' message in front of -# a frame line ? -s/\(\[Switching to thread [1234] (Thread ....)\]\)#0/\1\n#0/ - -# Anonymise info threads output (e.g. which thread is running and syscall) -s/^\([ \* ] [0-9] Thread .... (tid [0-9] VgTs_WaitSys) 0x........ in\).*$/\1 syscall .../ - -# Newer gdb say Thread .... hit Breakpoint, we expect just Breakpoint. -s/^Thread .... hit Breakpoint /Breakpoint / - -# We expect "Program received" instead of "Thread .... received" -s/^Thread .... received /Program received / - -s/#[0-9]\( 0x........ in sleeper_or_burner\)/#.\1/ - -# Some gdb versions don't show the source line:number after switching -# threads in #0 0x........ in do_burn (). -s/\(#0 0x........ in do_burn ()\) at sleepers.c:41/\1/ - - -# delete Reading symbols file lines -# Note: The 'done.' in "Reading symbols from <exe>...done." -# is optional (bugzilla 406357). -/^Reading symbols from .*\.\.\.\(done\.\)\?/d - -# delete Loaded symbols file lines -/^Loaded symbols for .*$/d - -# delete language switch messages. -/^Current language.*/d -/^The current source language is.*/d - -# 'exited with code' and 'exited normally' are printed slightly -# differently between gdb versions, normalize to "Program exited...". -s/^.*\( exited with code [0-9]\+\).$/Program\1\./g -s/^.*\( exited normally\).$/Program\1\./g - -# remove gdb prompts. -s/(gdb) //g - -# remove gdb continuation prompts. -s/^>[> ]*// - -# remove gdb done prompts. -/^done\.$/d - -# anonymise a 'general' system calls stack trace part -s/in _dl_sysinfo_int80 () from \/lib\/ld-linux.so.*/in syscall .../ - -# anonymise kill syscall. -s/in kill ().*$/in syscall .../ - -# anonymise syscall on ppc64 (bugzilla #284305) -s/in .*kill ().*$/in syscall .../ - - -s/in _dl_sysinfo_int80 ()/in syscall .../ -/^ from \/lib\/ld-linux.so.*$/d -s/\(0x........\) in ?? () from \/lib.*$/\1 in syscall .../ -s/\(0x........\) in ?? ()$/\1 in syscall .../ - -# 4 expressions to cover glibc 2.27 way to do a select, such as -# * 1 Thread 5548 (tid 1 VgTs_WaitSys) 0x0000000004f6203f in __GI___select ( -# nfds=0, readfds=0x0, writefds=0x0, exceptfds=0x0, timeout=0x30a0e0 <t>) -# at ../sysdeps/unix/sysv/linux/select.c:41 -# If select.c sources are present, we can also get a line containing: -# return SYSCALL_CANCEL.... -s/in __select .*/in syscall .../ -s/in __select$/in syscall .../ -/nfds=/d -/exceptfds=/d -/timeout=/d -/sysv\/linux\/select\.c/d -/sysv\/linux\/generic\/select.c/d -/return SYSCALL_CANCEL /d - -# a more specialised system call select stack trace part -# (on 32 bits, we have an int_80, on 64 bits, directly select) -s/in \(.__\)\{0,1\}select () from \/.*$/in syscall .../ - -/^ from \/lib\/libc.so.*$/d -/^ from \/lib64\/libc.so.*$/d -/^ from \/lib64\/.*\/libc.so.*$/d - -# and yet another (gdb 7.0 way) to get a system call -s/in select ()$/in syscall .../ - -# and yet another (gdb 7.0 arm way) to get a system call -s/in \.__select ()$/in syscall .../ - -# + yet another way to get a select system call -s/in select () at \.\.\/sysdeps\/unix\/syscall-template\.S.*$/in syscall .../ - -# FreeBSD system call -s/_select () at _select.S:.*$/0x........ in syscall .../ - -# FreeBSD system call again -/in _select.S/d - -# FreeBSD system call -s/kill () at kill.S:.*$/0x........ in syscall .../ - -# filter out names which starts with a "." -# such names are used for "function descriptors" on ppc64 -# bugzilla 406561 -s/in \.__select () at \.\.\/sysdeps\/unix\/syscall-template\.S.*$/in syscall .../ - -# cleanup some lines for a system call (on ubuntu 10 64 bits) -# (pay attention : there are tab characters there in) -/^[ ]*at \.\.\/sysdeps\/unix\/syscall-template\.S/d -/^[ ]*in \.\.\/sysdeps\/unix\/syscall-template\.S/d - -/^[1-9][0-9]*[ ]*\.\.\/sysdeps\/unix\/syscall-template\.S/d -/^[1-9][0-9]*[ ]in *\.\.\/sysdeps\/unix\/syscall-template\.S/d -/^[1-9][0-9]*[ ]T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)/d - -# and yet another (Solaris way) to get a poll system call -# (on 32 bits, we have /lib/libc.so.*, on 64 bits, /lib/64/libc.so.*) -s/in __pollsys () from \/.*$/in syscall .../ -/^ from \/lib\/64\/libc.so.*$/d - -# which registers can't be modified -s/\(Could not write register \)".*"/\1 "xxx"/ -s/\(ERROR changing register \).*$/\1 xxx regno y/ - -# special transform for arm/ppc watchpoints which have an additional address -# at the beginning -s/0x........ in \(main (argc=1, argv=0x........) at watchpoints.c:[24][3689]\)/\1/ - -s/0x........ in \(main () at clean_after_fork.c:34\)/\1/ - -# SIGFPE backtrace is varying so much that we just remove all lines -# after the signal trapping using an expr in this sed, followed by another sed. -s/\(^.*signal SIGFPE.*$\)/\1\nafter trap SIGFPE/ - -# gdb might also try to show the "entry value" p=p@entry=0x... -s/p=p@entry=0x/p=0x/ - -# for hgtls the breakpoint p=... address might show var location. -s/\(^Breakpoint 1, tls_ptr (p=0x........\) <tests[0-9+]*>\() at tls.c:55\)/\1\2/ - -/Id Target Id *Frame/d -s/^\([ \*] [1234] \) *Thread /\1Thread / - -# Ordering of ' Thread .... (tid .' might differ between gdb version, -# so remove all such lines except the "current" one (starts with '*'). -s/^ [0-9] Thread .... (tid [0-9] .*$// - -# transform info thread of 7.3 into the layout of 7.2 and before. -s/VgTs_WaitSys) 0x/VgTs_WaitSys) 0x/ - -# delete lines telling that some memory can't be accessed: this is -# a.o. produced by gdb 7.2 on arm (same with standard gdbserver) -/Cannot access memory at address 0x......../d - -# Filter 'New thread' lines -# gdb 7.9 reports new threads at different moment than the previous versions. -# Filter these new threads lines so as to not be dependent on this -# gdb aspect. -/\[New Thread/d - -# 406355 -# adjust filtering for the new gdb output -# mcsigpass and mcsignopass tests fails due to the slightly different -# gdb output. Filter the tests output to make it the same for different -# gdb version. Change mcsigpass and mcsignopass .exp to fit filtered -# .out. -s/^0x........ in \(\w\+ (\)/\1/ - -# delete empty lines (the last line (only made of prompts) sometimes -# finishes with a new line, sometimes not ???). -/^$/d - - -EOF - -dir=`dirname $0` - -$dir/filter_stderr | - -# Anonymise addresses -$dir/../tests/filter_addresses | - -# memcheck stuff -$dir/filter_memcheck_monitor "$@" | - -# memcheck filter might leave some "..." lines, we are not interested -$SED -e '/^\ \ \ \ \.\.\.$/d' | - -# Anonymise or remove, using the big list of PATTERN prepared above -$SED -f $PATTERNFILE | - -# remove all the lines telling where the SIGFPE was trapped. -$SED -e '/after trap SIGFPE/,/after continue SIGFPE/d' | - -# join together two lines that gdb 7.1 splits in two (???) -# (in a separate sed, as the below influences the behaviour of the other expressions) -$SED -e :a -e '$!N;s/\n at sleepers.c:39/ at sleepers.c:39/;ta' -e 'P;D' - -rm $PATTERNFILE diff --git a/gdbserver_tests/filter_memcheck_monitor b/gdbserver_tests/filter_memcheck_monitor deleted file mode 100755 index ec7fc6a343..0000000000 --- a/gdbserver_tests/filter_memcheck_monitor +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh - -# used to filter memcheck output shown by gdb/vgdb. - -dir=`dirname $0` - -SED=/usr/bin/sed - -$dir/../memcheck/tests/filter_stderr "$@" | - -# filter vgdb messages -$dir/filter_vgdb | - - -# filter some normal error messages provided by some gdb -# -# gdb 7.2 sometimes tries to access address 0x0 (same as with standard gdbserver) -# -# filter a debian 6.0/ppc32 line -# -# filter some missing info msg from s390 -# -# Bypass a s390x kernel bug which makes faultstatus test3 fail. In our case, we are -# not interested in checking the si_code, but rather the signal passing -# in mcsig(no)pass -# -# When doing inferior function calls from gdb (in mcmain_pic) there might be -# extra heap usage from gdb that we aren't interested in tracking. -# -$SED -e '/Cannot access memory at address 0x......../d' \ - -e '/^[1-9][0-9]* \.\.\/sysdeps\/powerpc\/powerpc32\/dl-start\.S: No such file or directory\./d' \ - -e '/^Missing separate debuginfo/d' \ - -e '/^Try: zypper install -C/d' \ - -e 's/Test 3: FAIL: expected si_code==2, not 128/Test 3: PASS/' \ - -e 's/in use at exit: [0-9][0-9,]* bytes in [0-9][0-9]* blocks/in use at exit: ... bytes in ... blocks/' \ - -e '/^ total heap usage: /d' diff --git a/gdbserver_tests/filter_stderr b/gdbserver_tests/filter_stderr deleted file mode 100755 index 332e0502f1..0000000000 --- a/gdbserver_tests/filter_stderr +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh - -dir=`dirname $0` - -SED=/usr/bin/sed - -$dir/../tests/filter_stderr_basic | -perl -0777 -p -e 's/error 4 Interrupted system call\nVG_\(poll\) failed \(old kernel \?\) retrying .*\n//g' | -$SED -e '/^Copyright (C) /d' \ - \ - -e '/TO DEBUG THIS PROCESS USING GDB/d' \ - -e '/\/path\/to\/gdb/d' \ - -e '/and then give GDB the following command/d' \ - -e '/target remote |/d' \ - -e '/pid is optional if only one valgrind process is running/d' \ - -e '/warning: remote target does not support file transfer, attempting to access files from local filesystem./d' diff --git a/gdbserver_tests/filter_vgdb b/gdbserver_tests/filter_vgdb deleted file mode 100755 index fe24f9eb05..0000000000 --- a/gdbserver_tests/filter_vgdb +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh - -dir=`dirname $0` - -SED=/usr/bin/sed - -$dir/filter_stderr | - -# Anonymise addresses -$dir/../tests/filter_addresses | - - -# On FreeBSD if the base and/or lib32 dbg components -# are installed but not system source then these -# errors get produced by GDB -$SED -e '/\(rtld_start.S\|kill.S\|_exit.S\|_select.S\): No such file or directory/d' | - -# filter vgdb process id, -# pid -# gdb 7.2 sometimes tries to access address 0x0 (same as with standard gdbserver) -# filter a debian 6.0/ppc32 line -$SED -e '/relaying data between gdb and process/d' \ - -e 's/\(sending command .* to pid \)[0-9][0-9]*/\1..../' \ - -e '/Cannot access memory at address 0x......../d' \ - -e '/^[1-9][0-9]* \.\.\/sysdeps\/powerpc\/powerpc32\/dl-start\.S: No such file or directory\./d' | - -# filter some debuginfo problems with ld.so and SLES11 -$SED -e '/^1 rtld.c: No such file or directory\./d' | -$SED -e '/rtld.c: Inappropriate ioctl for device\./d' | -# similar for Debian 11.0 arm64 -$SED -e '/_exit.c: Inappropriate ioctl for device\./d' | - -# and filter out any remaining empty lines -$SED -e '/^$/d' |
|
From: Paul F. <pa...@so...> - 2021-10-07 19:56:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3d25fd4a6c188f6183e69693920f81e3bc4e474f commit 3d25fd4a6c188f6183e69693920f81e3bc4e474f Author: Paul Floyd <pj...@wa...> Date: Tue Oct 5 09:12:45 2021 +0200 FreeBSD support, patch 8b nightly directory Diff: --- nightly/bin/nightly | 22 ++++++++++++++++++---- nightly/conf/freebsd12.1.conf | 4 ++++ nightly/conf/freebsd12.1.sendmail | 8 ++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/nightly/bin/nightly b/nightly/bin/nightly index 92fa076286..370a181114 100755 --- a/nightly/bin/nightly +++ b/nightly/bin/nightly @@ -42,6 +42,14 @@ runcmd () { # Startup #---------------------------------------------------------------------------- +if [ `uname -o` = "FreeBSD" ]; then + CP=gcp + MAKE=gmake +else + CP=cp + MAKE=make +fi + valgrind_git_repo="git://sourceware.org/git/valgrind.git/" # Must have exactly two arguments @@ -72,7 +80,7 @@ if [ "${ABT_EVAL}" = "" ]; then ABT_EVAL="eval" fi if [ "${ABT_RUN_REGTEST}" = "" ]; then - ABT_RUN_REGTEST="make regtest" + ABT_RUN_REGTEST="${MAKE} regtest" fi if [ "${ABT_PERF_TOOLS}" = "" ]; then @@ -118,7 +126,7 @@ for logfile in old new ; do # Check out, build, run tests runcmd $logfile \ "Checking out Valgrind source tree" \ - "cp -r --preserve=links valgrind-repo valgrind-$logfile && cd valgrind-$logfile && git checkout ${git_commit}" && \ + "${CP} -r --preserve=links valgrind-repo valgrind-$logfile && cd valgrind-$logfile && git checkout ${git_commit}" && \ \ runcmd $logfile \ "Configuring valgrind " \ @@ -126,7 +134,7 @@ for logfile in old new ; do \ runcmd $logfile \ "Building valgrind " \ - "cd valgrind-$logfile && make -j ${ABT_JOBS} && make -j ${ABT_JOBS} check && make install" && \ + "cd valgrind-$logfile && ${MAKE} -j ${ABT_JOBS} && ${MAKE} -j ${ABT_JOBS} check && ${MAKE} install" && \ \ runcmd $logfile \ "Running regression tests " \ @@ -177,11 +185,17 @@ END=`date "+%F %H:%M:%S %Z"` # Gather some information about this run and its environment valgrind_revision=$( ./valgrind-new/vg-in-place -v --version ) -gcc_version="`gcc --version 2> /dev/null | head -1`" +if [ `uname -o` = "FreeBSD" ]; then + gcc_version="`clang --version 2> /dev/null | head -1`" +else + gcc_version="`gcc --version 2> /dev/null | head -1`" +fi gdb_version="`gdb --version 2> /dev/null | head -1`" as_version="`as --version 2> /dev/null | head -1`" if [ `uname -o` = "Solaris" ]; then libc="Solaris libc" +elif [ `uname -o` = "FreeBSD" ]; then + libc="FreeBSD libc" else libc_so="`ls -1 /lib/libc.so.* /lib64/libc.so.* /lib32/libc.so.* /lib/*-linux-gnu/libc.so.* 2>/dev/null | tail -1`" libc="unknown" diff --git a/nightly/conf/freebsd12.1.conf b/nightly/conf/freebsd12.1.conf new file mode 100644 index 0000000000..c76383ed5c --- /dev/null +++ b/nightly/conf/freebsd12.1.conf @@ -0,0 +1,4 @@ +export ABT_DETAILS=`uname -mrs` +export ABT_JOBS=2 +#export ABT_PERF="--tools=none,memcheck,callgrind,helgrind,cachegrind,drd,massif --reps=3 --vg=../valgrind-old --vg=../valgrind-new" +export ABT_CONFIGURE_OPTIONS="CC=clang CXX=clang++" diff --git a/nightly/conf/freebsd12.1.sendmail b/nightly/conf/freebsd12.1.sendmail new file mode 100755 index 0000000000..6fc10f9deb --- /dev/null +++ b/nightly/conf/freebsd12.1.sendmail @@ -0,0 +1,8 @@ +#!/bin/sh + +subject=$1 +body=$2 +file=$3 +filename=$( basename $3 ) + +(cat "$body" "$file") | mail -s "$subject" val...@li... -f "Paul Floyd <pj...@wa...>" |
|
From: Paul F. <pa...@so...> - 2021-10-07 19:34:51
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=85bbe2853e813bbd83aa17bc17c2b73d82f6bc3e commit 85bbe2853e813bbd83aa17bc17c2b73d82f6bc3e Author: Paul Floyd <pj...@wa...> Date: Thu Oct 7 21:33:45 2021 +0200 FreeBSD support, patch 5 drd and helgrind tests Diff: --- .gitignore | 7 + configure.ac | 14 + drd/tests/Makefile.am | 23 +- drd/tests/annotate_smart_pointer.cpp | 3 + drd/tests/bar_bad.stderr.exp-freebsd | 45 ++++ drd/tests/bar_bad_xml.stderr.exp-freebsd | 286 +++++++++++++++++++++ drd/tests/circular_buffer.c | 22 +- drd/tests/concurrent_close.cpp | 3 + drd/tests/concurrent_close.vgtest | 2 +- .../{filter_error_count => filter_error_count.in} | 4 +- ...ilter_error_summary => filter_error_summary.in} | 4 +- drd/tests/{filter_stderr => filter_stderr.in} | 8 +- drd/tests/filter_stderr_and_thread_no_and_offset | 4 - .../filter_stderr_and_thread_no_and_offset.in | 6 + .../{filter_thread_no => filter_thread_no.in} | 4 +- ...l_and_thread_no => filter_xml_and_thread_no.in} | 4 +- drd/tests/pth_create_chain.c | 5 + drd/tests/pth_detached3.c | 8 + drd/tests/pth_detached3.stderr.exp-freebsd | 14 + drd/tests/pth_detached3.stderr.exp2 | 4 +- drd/tests/pth_uninitialized_cond.vgtest | 1 + drd/tests/recursive_mutex.stderr.exp-freebsd | 18 ++ drd/tests/std_list.cpp | 27 +- drd/tests/std_string.cpp | 3 + drd/tests/std_thread2.supp | 26 ++ drd/tests/tc09_bad_unlock.stderr.exp-freebsd | 49 ++++ drd/tests/tc09_bad_unlock.stderr.exp-freebsd-clang | 49 ++++ drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 | 46 ++-- drd/tests/tc22_exit_w_lock.vgtest | 1 + drd/tests/tc23_bogus_condwait.stderr.exp-freebsd | 40 +++ drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 | 44 ++-- drd/tests/thread_name.vgtest | 2 +- drd/tests/thread_name_freebsd.c | 63 +++++ drd/tests/thread_name_freebsd.stderr.exp | 93 +++++++ drd/tests/thread_name_freebsd.vgtest | 3 + drd/tests/thread_name_xml.vgtest | 2 +- helgrind/tests/Makefile.am | 13 +- helgrind/tests/bar_bad.c | 3 + helgrind/tests/bar_bad.stderr.exp-destroy-hang | 18 +- helgrind/tests/bar_bad.stderr.exp-freebsd | 58 +++++ helgrind/tests/filter_freebsd.awk | 148 +++++++++++ helgrind/tests/{filter_stderr => filter_stderr.in} | 20 +- helgrind/tests/filter_stderr_freebsd | 60 +++++ .../tests/locked_vs_unlocked2.stderr.exp-freebsd | 44 ++++ .../tests/locked_vs_unlocked3.stderr.exp-freebsd | 34 +++ .../tests/pth_cond_destroy_busy.stderr.exp-freebsd | 24 ++ .../tests/tc06_two_races_xml.stderr.exp-freebsd | 251 ++++++++++++++++++ helgrind/tests/tc07_hbl1.c | 9 +- helgrind/tests/tc08_hbl2.c | 9 +- helgrind/tests/tc09_bad_unlock.c | 3 + helgrind/tests/tc09_bad_unlock.stderr.exp | 72 +++--- helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd | 150 +++++++++++ helgrind/tests/tc09_bad_unlock.stderr.exp-solaris | 72 +++--- helgrind/tests/tc11_XCHG.c | 9 +- helgrind/tests/tc12_rwl_trivial.c | 2 +- helgrind/tests/tc12_rwl_trivial.stderr.exp-freebsd | 31 +++ helgrind/tests/tc17_sembar.c | 5 +- helgrind/tests/tc18_semabuse.stderr.exp-freebsd | 40 +++ helgrind/tests/tc20_verifywrap.c | 2 +- helgrind/tests/tc20_verifywrap.vgtest | 2 +- helgrind/tests/tc22_exit_w_lock.vgtest | 1 + helgrind/tests/tc23_bogus_condwait.c | 9 +- helgrind/tests/tc23_bogus_condwait.stderr.exp | 14 +- .../tests/tc23_bogus_condwait.stderr.exp-freebsd | 100 +++++++ helgrind/tests/tc24_nonzero_sem.c | 5 +- tests/check_makefile_consistency | 2 +- tests/os_test.c | 4 + 67 files changed, 1975 insertions(+), 176 deletions(-) diff --git a/.gitignore b/.gitignore index 86962b4780..ac16d3638a 100644 --- a/.gitignore +++ b/.gitignore @@ -354,6 +354,12 @@ /drd/tests/*.stderr.out /drd/tests/*.stdout.diff* /drd/tests/*.stdout.out +/drd/tests/filter_error_count +/drd/tests/filter_error_summary +/drd/tests/filter_stderr +/drd/tests/filter_stderr_and_thread_no_and_offset +/drd/tests/filter_thread_no +/drd/tests/filter_xml_and_thread_no /drd/tests/.deps /drd/tests/annotate_barrier /drd/tests/annotate_hb_err @@ -629,6 +635,7 @@ /helgrind/tests/*.stderr.out /helgrind/tests/*.stdout.diff* /helgrind/tests/*.stdout.out +/helgrind/tests/filter_stderr /helgrind/tests/.deps /helgrind/tests/annotate_hbefore /helgrind/tests/annotate_rwlock diff --git a/configure.ac b/configure.ac index c05994516f..7e6773606d 100755 --- a/configure.ac +++ b/configure.ac @@ -5215,6 +5215,20 @@ AC_CONFIG_FILES([tests/filter_stderr_basic], [chmod +x tests/filter_stderr_basic]) AC_CONFIG_FILES([tests/filter_discards], [chmod +x tests/filter_discards]) +AC_CONFIG_FILES([drd/tests/filter_stderr], + [chmod +x drd/tests/filter_stderr]) +AC_CONFIG_FILES([drd/tests/filter_error_count], + [chmod +x drd/tests/filter_error_count]) +AC_CONFIG_FILES([drd/tests/filter_error_summary], + [chmod +x drd/tests/filter_error_summary]) +AC_CONFIG_FILES([drd/tests/filter_stderr_and_thread_no_and_offset], + [chmod +x drd/tests/filter_stderr_and_thread_no_and_offset]) +AC_CONFIG_FILES([drd/tests/filter_thread_no], + [chmod +x drd/tests/filter_thread_no]) +AC_CONFIG_FILES([drd/tests/filter_xml_and_thread_no], + [chmod +x drd/tests/filter_xml_and_thread_no]) +AC_CONFIG_FILES([helgrind/tests/filter_stderr], + [chmod +x helgrind/tests/filter_stderr]) AC_OUTPUT cat<<EOF diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am old mode 100644 new mode 100755 index 07650ef88a..4cb2f7f84a --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -87,10 +87,12 @@ EXTRA_DIST = \ bar_bad.stderr.exp \ bar_bad.stderr.exp-nohang \ bar_bad.stderr.exp-solaris \ + bar_bad.stderr.exp-freebsd \ bar_bad.vgtest \ bar_bad_xml.stderr.exp \ bar_bad_xml.stderr.exp-nohang \ bar_bad_xml.stderr.exp-solaris \ + bar_bad_xml.stderr.exp-freebsd \ bar_bad_xml.vgtest \ bar_trivial.stderr.exp \ bar_trivial.stdout.exp \ @@ -213,6 +215,7 @@ EXTRA_DIST = \ pth_detached2.vgtest \ pth_detached3.stderr.exp1 \ pth_detached3.stderr.exp2 \ + pth_detached3.stderr.exp-freebsd \ pth_detached3.vgtest \ pth_detached_sem.stderr.exp \ pth_detached_sem.stdout.exp \ @@ -235,6 +238,7 @@ EXTRA_DIST = \ recursive_mutex.stderr.exp-linux \ recursive_mutex.stderr.exp-darwin \ recursive_mutex.stderr.exp-solaris \ + recursive_mutex.stderr.exp-freebsd \ recursive_mutex.vgtest \ rwlock_race.stderr.exp \ rwlock_race.stderr.exp2 \ @@ -313,6 +317,8 @@ EXTRA_DIST = \ tc09_bad_unlock.stderr.exp-glibc2.8 \ tc09_bad_unlock.stderr.exp-s390 \ tc09_bad_unlock.stderr.exp-solaris \ + tc09_bad_unlock.stderr.exp-freebsd \ + tc09_bad_unlock.stderr.exp-freebsd-clang \ tc09_bad_unlock.vgtest \ tc10_rec_lock.stderr.exp \ tc10_rec_lock.vgtest \ @@ -345,6 +351,7 @@ EXTRA_DIST = \ tc23_bogus_condwait.stderr.exp-linux-ppc \ tc23_bogus_condwait.stderr.exp-darwin-x86 \ tc23_bogus_condwait.stderr.exp-darwin-amd64 \ + tc23_bogus_condwait.stderr.exp-freebsd \ tc23_bogus_condwait.vgtest \ tc24_nonzero_sem.stderr.exp \ tc24_nonzero_sem.vgtest \ @@ -352,6 +359,8 @@ EXTRA_DIST = \ thread_name.vgtest \ thread_name_xml.stderr.exp \ thread_name_xml.vgtest \ + thread_name_freebsd.stderr.exp \ + thread_name_freebsd.vgtest \ threaded-fork.stderr.exp \ threaded-fork.vgtest \ threaded-fork-vcs.stderr.exp \ @@ -410,7 +419,11 @@ check_PROGRAMS = \ threaded-fork \ trylock \ unit_bitmap \ - unit_vc + unit_vc \ + std_atomic \ + std_list \ + std_mutex \ + std_string if HAVE_BOOST_1_35 check_PROGRAMS += boost_thread @@ -440,10 +453,6 @@ endif if CXX_CAN_INCLUDE_THREAD_HEADER if HAVE_SHARED_POINTER_ANNOTATION check_PROGRAMS += \ - std_atomic \ - std_list \ - std_mutex \ - std_string \ std_thread \ std_thread2 endif @@ -480,6 +489,10 @@ if !VGCONF_OS_IS_DARWIN check_PROGRAMS += sem_wait endif +if VGCONF_OS_IS_FREEBSD +check_PROGRAMS += thread_name_freebsd +endif + AM_CFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ @FLAG_FALIGNED_NEW@ \ diff --git a/drd/tests/annotate_smart_pointer.cpp b/drd/tests/annotate_smart_pointer.cpp index ccefc47350..a6c1a9d524 100644 --- a/drd/tests/annotate_smart_pointer.cpp +++ b/drd/tests/annotate_smart_pointer.cpp @@ -37,6 +37,7 @@ #include <pthread.h> // pthread_mutex_t #endif #include "unified_annotations.h" +#include "config.h" static bool s_enable_annotations; @@ -142,7 +143,9 @@ public: { pthread_attr_t attr; pthread_attr_init(&attr); +#if !defined(VGO_freebsd) pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN + 4096); +#endif pthread_create(&m_tid, &attr, pf, arg); pthread_attr_destroy(&attr); } diff --git a/drd/tests/bar_bad.stderr.exp-freebsd b/drd/tests/bar_bad.stderr.exp-freebsd new file mode 100644 index 0000000000..00276e462d --- /dev/null +++ b/drd/tests/bar_bad.stderr.exp-freebsd @@ -0,0 +1,45 @@ + + +initialise a barrier with zero count +pthread_barrier_init: 'count' argument is zero: barrier 0x........ + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) + + +initialise a barrier twice +Barrier reinitialization: barrier 0x........ + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) +barrier 0x........ was first observed at: + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) + + +initialise a barrier which has threads waiting on it +Barrier reinitialization: barrier 0x........ + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) +barrier 0x........ was first observed at: + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) + + +destroy a barrier that has waiting threads +Destruction of a barrier with active waiters: barrier 0x........ + at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) +barrier 0x........ was first observed at: + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) + + +destroy a barrier that was never initialised +Destruction of barrier that is being waited upon: barrier 0x........ + at 0x........: free (vg_replace_malloc.c:...) + by 0x........: main (bar_bad.c:?) +barrier 0x........ was first observed at: + at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?) + by 0x........: main (bar_bad.c:?) + + +ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0) diff --git a/drd/tests/bar_bad_xml.stderr.exp-freebsd b/drd/tests/bar_bad_xml.stderr.exp-freebsd new file mode 100644 index 0000000000..24ac7fe952 --- /dev/null +++ b/drd/tests/bar_bad_xml.stderr.exp-freebsd @@ -0,0 +1,286 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>4</protocolversion> +<protocoltool>drd</protocoltool> + +<preamble> + <line>...</line> + <line>...</line> + <line>...</line> + <line>...</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>drd</tool> + +<args> + <vargv>...</vargv> + <argv> + <exe>./../../helgrind/tests/bar_bad</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +initialise a barrier with zero count +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>BarrierErr</kind> + <what>pthread_barrier_init: 'count' argument is zero: barrier 0x........</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> +</error> + + +initialise a barrier twice +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>BarrierErr</kind> + <what>Barrier reinitialization: barrier 0x........</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + <first_observed_at> + <what>barrier</what> + <address>0x........</address> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + </first_observed_at> +</error> + + +initialise a barrier which has threads waiting on it +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>BarrierErr</kind> + <what>Barrier reinitialization: barrier 0x........</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + <first_observed_at> + <what>barrier</what> + <address>0x........</address> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + </first_observed_at> +</error> + + +destroy a barrier that has waiting threads +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>BarrierErr</kind> + <what>Destruction of a barrier with active waiters: barrier 0x........</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_destroy</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + <first_observed_at> + <what>barrier</what> + <address>0x........</address> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + </first_observed_at> +</error> + + +destroy a barrier that was never initialised +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>BarrierErr</kind> + <what>Destruction of barrier that is being waited upon: barrier 0x........</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>free</fn> + <dir>...</dir> + <file>vg_replace_malloc.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + <first_observed_at> + <what>barrier</what> + <address>0x........</address> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_barrier_init</fn> + <dir>...</dir> + <file>drd_pthread_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>bar_bad.c</file> + <line>...</line> + </frame> + </stack> + </first_observed_at> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> +</errorcounts> + +<suppcounts>...</suppcounts> + +</valgrindoutput> + diff --git a/drd/tests/circular_buffer.c b/drd/tests/circular_buffer.c index 0b750467b7..d84ac01273 100644 --- a/drd/tests/circular_buffer.c +++ b/drd/tests/circular_buffer.c @@ -48,6 +48,12 @@ typedef struct { data_t buffer[BUFFER_MAX]; } buffer_t; +typedef struct id_and_wait_s +{ + int id; + int wait_time; +} id_and_wait_t; + static int quiet = 0; static int use_locking = 1; @@ -158,7 +164,8 @@ static buffer_t b; static void *producer(void* arg) { - int* id = arg; + id_and_wait_t* ctx = arg; + int* id = &ctx->id; buffer_send(&b, id); return NULL; @@ -168,14 +175,16 @@ static void *producer(void* arg) static void *consumer(void* arg) { - int* id = arg; + id_and_wait_t* ctx = arg; + int id = ctx->id; + int wait_time = ctx->wait_time; int d; - usleep(rand() % MAXSLEEP); + usleep(wait_time); buffer_recv(&b, &d); if (! quiet) { - printf("%i: %i\n", *id, d); + printf("%i: %i\n", id, d); fflush(stdout); } return NULL; @@ -187,7 +196,7 @@ int main(int argc, char** argv) { pthread_t producers[THREADS]; pthread_t consumers[THREADS]; - int thread_arg[THREADS]; + id_and_wait_t thread_arg[THREADS]; int i; int optchar; @@ -210,7 +219,8 @@ int main(int argc, char** argv) for (i = 0; i < THREADS; ++i) { - thread_arg[i] = i; + thread_arg[i].id = i; + thread_arg[i].wait_time = rand() % MAXSLEEP; pthread_create(producers + i, NULL, producer, &thread_arg[i]); } diff --git a/drd/tests/concurrent_close.cpp b/drd/tests/concurrent_close.cpp index 9f7e6d622f..e098dd37a5 100644 --- a/drd/tests/concurrent_close.cpp +++ b/drd/tests/concurrent_close.cpp @@ -8,6 +8,7 @@ #include <fcntl.h> /* O_RDONLY */ #include <pthread.h> #include <unistd.h> /* close() */ +#include "config.h" /* Happens with two threads also */ #define THREAD_COUNT 256 @@ -32,7 +33,9 @@ int main() pthread_t threads[THREAD_COUNT]; pthread_attr_init(&attr); +#if !defined(VGO_freebsd) pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); +#endif for (i = 0; i < THREAD_COUNT; ++i) { r = pthread_create(&threads[i], &attr, thread, 0); if (r != 0) { diff --git a/drd/tests/concurrent_close.vgtest b/drd/tests/concurrent_close.vgtest index 19c339b647..cc7834d877 100644 --- a/drd/tests/concurrent_close.vgtest +++ b/drd/tests/concurrent_close.vgtest @@ -1,4 +1,4 @@ prereq: ./supported_libpthread -vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=3 +vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=6 prog: concurrent_close stderr_filter: filter_stderr diff --git a/drd/tests/filter_error_count b/drd/tests/filter_error_count.in similarity index 92% rename from drd/tests/filter_error_count rename to drd/tests/filter_error_count.in index 89dc2b40c7..782284d1c7 100755 --- a/drd/tests/filter_error_count +++ b/drd/tests/filter_error_count.in @@ -1,9 +1,11 @@ #!/bin/sh +SED=@SED@ + # Filter the error output of Valgrind such that only the line with the error # summary is kept. Bart Van Assche, February 26, 2008. -sed -n \ +$SED -n \ -e 's/^.*\(ERROR SUMMARY.*\) ([^()]*)$/\1/' \ -e 's/^\(ERROR SUMMARY: [0-9]* errors\).*$/\1/' \ -e '/ERROR SUMMARY/p' diff --git a/drd/tests/filter_error_summary b/drd/tests/filter_error_summary.in similarity index 62% rename from drd/tests/filter_error_summary rename to drd/tests/filter_error_summary.in index cdf703f2fd..76d7a6dade 100755 --- a/drd/tests/filter_error_summary +++ b/drd/tests/filter_error_summary.in @@ -1,6 +1,8 @@ #!/bin/sh +SED=@SED@ + # Filter the error output of Valgrind such that only the line with the error # summary is kept. Bart Van Assche, February 26, 2008. -sed -n -e 's/^.*\(ERROR SUMMARY.*\) ([^()]*)$/\1/' -e '/ERROR SUMMARY/p' +$SED -n -e 's/^.*\(ERROR SUMMARY.*\) ([^()]*)$/\1/' -e '/ERROR SUMMARY/p' diff --git a/drd/tests/filter_stderr b/drd/tests/filter_stderr.in similarity index 94% rename from drd/tests/filter_stderr rename to drd/tests/filter_stderr.in index f5c56a3541..aec1d60f5d 100755 --- a/drd/tests/filter_stderr +++ b/drd/tests/filter_stderr.in @@ -2,7 +2,9 @@ dir=`dirname $0` -sed -e "s:_pthread_start (in /usr/lib/libSystem.B.dylib):(within libpthread-?.?.so):" | +SED=@SED@ + +$SED -e "s:_pthread_start (in /usr/lib/libSystem.B.dylib):(within libpthread-?.?.so):" | $dir/../../tests/filter_stderr_basic | @@ -17,7 +19,7 @@ fi | # Remove line numbers referring to drd's source code. # Remove libpthread's version number. # Remove line numbers from stack traces. -sed \ +$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 .../" \ -e "/^warning: evaluate_Dwarf3_Expr: unhandled DW_OP_.*/d" \ @@ -30,8 +32,10 @@ sed \ -e "/^Copyright (C) 2006-20.., and GNU GPL'd, by Bart Van Assche.$/d" \ -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/" \ -e "s/[A-Za-z_]* (pthread_create.c:[0-9]*)/(within libpthread-?.?.so)/" \ -e "s/[A-Za-z_]* (in [^ ]*libpthread-[0-9.]*\.so)/(within libpthread-?.?.so)/" \ +-e "s/... (in \/lib\/libthr.so.3)/(within libpthread-?.?.so)/" \ -e "s:(within /lib[0-9]*/ld-[0-9.]*\.so):(within ld-?.?.so):" \ -e "s/was held during [0-9][0-9]*/was held during .../" \ -e "s: BSS section of [^<]*/: BSS section of :g" \ diff --git a/drd/tests/filter_stderr_and_thread_no_and_offset b/drd/tests/filter_stderr_and_thread_no_and_offset deleted file mode 100755 index b0e75a4a7e..0000000000 --- a/drd/tests/filter_stderr_and_thread_no_and_offset +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./filter_stderr_and_thread_no \ -| sed "s/ is at offset [0-9]* from / is at offset ... from /" diff --git a/drd/tests/filter_stderr_and_thread_no_and_offset.in b/drd/tests/filter_stderr_and_thread_no_and_offset.in new file mode 100755 index 0000000000..095d44d66c --- /dev/null +++ b/drd/tests/filter_stderr_and_thread_no_and_offset.in @@ -0,0 +1,6 @@ +#!/bin/sh + +SED=@SED@ + +./filter_stderr_and_thread_no \ +| $SED "s/ is at offset [0-9]* from / is at offset ... from /" diff --git a/drd/tests/filter_thread_no b/drd/tests/filter_thread_no.in similarity index 82% rename from drd/tests/filter_thread_no rename to drd/tests/filter_thread_no.in index f70c7b6682..6fac735705 100755 --- a/drd/tests/filter_thread_no +++ b/drd/tests/filter_thread_no.in @@ -1,7 +1,9 @@ #! /bin/sh +SED=@SED@ + # Get rid of the numbers as these make some tests more scheduling sensitive # -- those where there are multiple threads which play interchangeable roles. grep -v "^Thread [0-9][0-9]*:$" | -sed -e "s:hread [0-9][0-9]*:hread x:g" \ +$SED -e "s:hread [0-9][0-9]*:hread x:g" \ -e "s:of thread [0-9][0-9]*$:of thread x:g" diff --git a/drd/tests/filter_xml_and_thread_no b/drd/tests/filter_xml_and_thread_no.in similarity index 55% rename from drd/tests/filter_xml_and_thread_no rename to drd/tests/filter_xml_and_thread_no.in index a9f7ac1af5..db64dd7742 100755 --- a/drd/tests/filter_xml_and_thread_no +++ b/drd/tests/filter_xml_and_thread_no.in @@ -1,5 +1,7 @@ #! /bin/sh +SED=@SED@ + ../../memcheck/tests/filter_xml | ./filter_thread_no | -sed 's/ vc: \[[0-9:, ]*\]/ vc: [ ... ]/g' +$SED 's/ vc: \[[0-9:, ]*\]/ vc: [ ... ]/g' diff --git a/drd/tests/pth_create_chain.c b/drd/tests/pth_create_chain.c index e0771243d9..add1b33f0a 100644 --- a/drd/tests/pth_create_chain.c +++ b/drd/tests/pth_create_chain.c @@ -7,6 +7,7 @@ #include <stdlib.h> #include <stdio.h> #include <pthread.h> +#include "config.h" static pthread_t s_thread[1000]; @@ -23,7 +24,9 @@ static void* thread_func(void* p) // std::cout << "create " << thread_count << std::endl; s_arg[thread_count] = thread_count; pthread_attr_init(&attr); +#if !defined(VGO_freebsd) pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); +#endif pthread_create(&s_thread[thread_count], &attr, thread_func, &s_arg[thread_count]); pthread_attr_destroy(&attr); @@ -47,7 +50,9 @@ int main(int argc, char** argv) thread_count--; // std::cout << "create " << thread_count << std::endl; pthread_attr_init(&attr); +#if !defined(VGO_freebsd) pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); +#endif pthread_create(&s_thread[thread_count], &attr, thread_func, &thread_count); pthread_attr_destroy(&attr); diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c old mode 100644 new mode 100755 index efeb15b72d..eab8514ede --- a/drd/tests/pth_detached3.c +++ b/drd/tests/pth_detached3.c @@ -6,6 +6,10 @@ #include <stdio.h> #include <stdint.h> +#if defined(VGO_freebsd) +#include <sys/types.h> +#endif + static void* thread_func(void* arg) { return 0; @@ -22,7 +26,11 @@ int main(int argc, char** argv) pthread_detach(thread); /* Invoke pthread_detach() with an invalid thread ID. */ +#ifdef VGO_freebsd + pthread_detach((pthread_t)12345); +#else pthread_detach((pthread_t)((uintptr_t)thread + 8)); +#endif fprintf(stderr, "Finished.\n"); diff --git a/drd/tests/pth_detached3.stderr.exp-freebsd b/drd/tests/pth_detached3.stderr.exp-freebsd new file mode 100644 index 0000000000..870287d0fe --- /dev/null +++ b/drd/tests/pth_detached3.stderr.exp-freebsd @@ -0,0 +1,14 @@ + +pthread_detach(): invalid thread ID 0x........ + at 0x........: vgDrd_set_joinable (drd_pthread_intercepts.c:?) + by 0x........: pthread_detach (drd_pthread_intercepts.c:?) + by 0x........: main (pth_detached3.c:26) + +pthread_detach(): invalid thread ID 0x........ + at 0x........: vgDrd_set_joinable (drd_pthread_intercepts.c:?) + by 0x........: pthread_detach (drd_pthread_intercepts.c:?) + by 0x........: main (pth_detached3.c:30) + +Finished. + +ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) diff --git a/drd/tests/pth_detached3.stderr.exp2 b/drd/tests/pth_detached3.stderr.exp2 index e82dee14db..d5910d8ebb 100644 --- a/drd/tests/pth_detached3.stderr.exp2 +++ b/drd/tests/pth_detached3.stderr.exp2 @@ -2,12 +2,12 @@ pthread_detach(): invalid thread ID 0x........ at 0x........: vgDrd_set_joinable (drd_pthread_intercepts.c:?) by 0x........: pthread_detach (drd_pthread_intercepts.c:?) - by 0x........: main (pth_detached3.c:22) + by 0x........: main (pth_detached3.c:26) pthread_detach(): invalid thread ID 0x........ at 0x........: vgDrd_set_joinable (drd_pthread_intercepts.c:?) by 0x........: pthread_detach (drd_pthread_intercepts.c:?) - by 0x........: main (pth_detached3.c:25) + by 0x........: main (pth_detached3.c:32) Finished. diff --git a/drd/tests/pth_uninitialized_cond.vgtest b/drd/tests/pth_uninitialized_cond.vgtest index fe031397df..f0d9ac286b 100644 --- a/drd/tests/pth_uninitialized_cond.vgtest +++ b/drd/tests/pth_uninitialized_cond.vgtest @@ -1,3 +1,4 @@ prereq: test -e pth_uninitialized_cond && ./supported_libpthread vgopts: --read-var-info=yes --check-stack-var=yes prog: pth_uninitialized_cond +cleanup: rm -f vgcore.* diff --git a/drd/tests/recursive_mutex.stderr.exp-freebsd b/drd/tests/recursive_mutex.stderr.exp-freebsd new file mode 100644 index 0000000000..28c7a6d79f --- /dev/null +++ b/drd/tests/recursive_mutex.stderr.exp-freebsd @@ -0,0 +1,18 @@ + + +Non-recursive mutex. +second lock call failed ! +Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: lock_twice (recursive_mutex.c:?) + by 0x........: main (recursive_mutex.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?) + by 0x........: lock_twice (recursive_mutex.c:?) + by 0x........: main (recursive_mutex.c:?) + +second unlock call failed ! + +Done. + +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/drd/tests/std_list.cpp b/drd/tests/std_list.cpp index 1f09164538..d266bba9cb 100644 --- a/drd/tests/std_list.cpp +++ b/drd/tests/std_list.cpp @@ -15,9 +15,34 @@ #include <string> #include <sstream> #include <list> +#if defined(__FreeBSD__) +#include <mutex> +#endif using namespace std; +#if defined(__FreeBSD__) +std::mutex g_mutex; + +// according to this +// https://stackoverflow.com/questions/4057319/is-setlocale-thread-safe-function +// setlocale is not thread safe, and indeed on FreeBSD +// a load of errors are generated if this is not guarded +void setlocale_wrapper() +{ + const std::lock_guard<std::mutex> lock(g_mutex); + setlocale(LC_ALL, "English"); +} + +#else + +void setlocale_wrapper() +{ + setlocale(LC_ALL, "English"); +} + +#endif + class SubTest { public: SubTest() { @@ -41,7 +66,7 @@ class Test { public: void setUp() { subTest = new SubTest(); - setlocale(LC_ALL, "English"); + setlocale_wrapper(); } void tearDown() { delete subTest; } diff --git a/drd/tests/std_string.cpp b/drd/tests/std_string.cpp old mode 100644 new mode 100755 index 266c93fa5b..63f94729aa --- a/drd/tests/std_string.cpp +++ b/drd/tests/std_string.cpp @@ -8,6 +8,9 @@ #include <string> #include <cstring> #include <pthread.h> +#if defined(__FreeBSD__) +#include <stdio.h> +#endif #include <stdlib.h> #include <unistd.h> diff --git a/drd/tests/std_thread2.supp b/drd/tests/std_thread2.supp index ae69e0ddd9..2e41bac503 100644 --- a/drd/tests/std_thread2.supp +++ b/drd/tests/std_thread2.supp @@ -19,3 +19,29 @@ fun:allocate_stack fun:pthread_create@@GLIBC_2.2* } +{ + drd-gcc-runtims + drd:ConflictingAccess + obj:/lib/libgcc_s.so.1 +} +{ + drd-iterate-phdr + drd:ConflictingAccess + fun:dl_iterate_phdr +} +{ + drd-unwind-cfa + drd:ConflictingAccess + fun:_Unwind_GetCFA +} +{ + drd-thr + drd:ConflictingAccess + obj:/lib/libthr.so.3 +} +{ + drd-rtld + drd:ConflictingAccess + obj:/libexec/ld-elf*.so.1 +} + diff --git a/drd/tests/tc09_bad_unlock.stderr.exp-freebsd b/drd/tests/tc09_bad_unlock.stderr.exp-freebsd new file mode 100644 index 0000000000..e7828fd403 --- /dev/null +++ b/drd/tests/tc09_bad_unlock.stderr.exp-freebsd @@ -0,0 +1,49 @@ + +Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:28) + by 0x........: main (tc09_bad_unlock.c:52) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:24) + by 0x........: main (tc09_bad_unlock.c:52) + +Thread 2: +Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: child_fn (tc09_bad_unlock.c:12) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:52) + +Thread 1: +Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. + at 0x........: nearly_main (tc09_bad_unlock.c:48) + by 0x........: main (tc09_bad_unlock.c:52) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:52) + +--------------------- +Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:28) + by 0x........: main (tc09_bad_unlock.c:53) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:24) + by 0x........: main (tc09_bad_unlock.c:53) + +Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. + at 0x........: nearly_main (tc09_bad_unlock.c:48) + by 0x........: main (tc09_bad_unlock.c:53) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:53) + + +ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc09_bad_unlock.stderr.exp-freebsd-clang b/drd/tests/tc09_bad_unlock.stderr.exp-freebsd-clang new file mode 100644 index 0000000000..384fd5cf75 --- /dev/null +++ b/drd/tests/tc09_bad_unlock.stderr.exp-freebsd-clang @@ -0,0 +1,49 @@ + +Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:28) + by 0x........: main (tc09_bad_unlock.c:52) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:24) + by 0x........: main (tc09_bad_unlock.c:52) + +Thread 2: +Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: child_fn (tc09_bad_unlock.c:12) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:52) + +Thread 1: +Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. + at 0x........: nearly_main (tc09_bad_unlock.c:39) + by 0x........: main (tc09_bad_unlock.c:52) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:52) + +--------------------- +Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:28) + by 0x........: main (tc09_bad_unlock.c:53) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:24) + by 0x........: main (tc09_bad_unlock.c:53) + +Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. + at 0x........: nearly_main (tc09_bad_unlock.c:39) + by 0x........: main (tc09_bad_unlock.c:53) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:53) + + +ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 b/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 index 277705a548..9a6c0474f5 100644 --- a/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 +++ b/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 @@ -1,59 +1,59 @@ Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:27) - by 0x........: main (tc09_bad_unlock.c:49) + by 0x........: nearly_main (tc09_bad_unlock.c:28) + by 0x........: main (tc09_bad_unlock.c:52) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:23) - by 0x........: main (tc09_bad_unlock.c:49) + by 0x........: nearly_main (tc09_bad_unlock.c:24) + by 0x........: main (tc09_bad_unlock.c:52) Thread 2: Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: child_fn (tc09_bad_unlock.c:11) + by 0x........: child_fn (tc09_bad_unlock.c:12) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:31) - by 0x........: main (tc09_bad_unlock.c:49) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:52) Thread 1: The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:41) - by 0x........: main (tc09_bad_unlock.c:49) + by 0x........: nearly_main (tc09_bad_unlock.c:43) + by 0x........: main (tc09_bad_unlock.c:52) Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. - at 0x........: nearly_main (tc09_bad_unlock.c:45) - by 0x........: (below main) + at 0x........: nearly_main (tc09_bad_unlock.c:48) + by 0x........: main (tc09_bad_unlock.c:52) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:31) - by 0x........: main (tc09_bad_unlock.c:49) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:52) --------------------- Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:27) - by 0x........: main (tc09_bad_unlock.c:50) + by 0x........: nearly_main (tc09_bad_unlock.c:28) + by 0x........: main (tc09_bad_unlock.c:53) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:23) - by 0x........: main (tc09_bad_unlock.c:50) + by 0x........: nearly_main (tc09_bad_unlock.c:24) + by 0x........: main (tc09_bad_unlock.c:53) The object at address 0x........ is not a mutex. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:41) - by 0x........: main (tc09_bad_unlock.c:50) + by 0x........: nearly_main (tc09_bad_unlock.c:43) + by 0x........: main (tc09_bad_unlock.c:53) Destroying locked mutex: mutex 0x........, recursion count 1, owner 1. - at 0x........: nearly_main (tc09_bad_unlock.c:45) - by 0x........: (below main) + at 0x........: nearly_main (tc09_bad_unlock.c:48) + by 0x........: main (tc09_bad_unlock.c:53) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: nearly_main (tc09_bad_unlock.c:31) - by 0x........: main (tc09_bad_unlock.c:50) + by 0x........: nearly_main (tc09_bad_unlock.c:32) + by 0x........: main (tc09_bad_unlock.c:53) ERROR SUMMARY: 8 errors from 7 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc22_exit_w_lock.vgtest b/drd/tests/tc22_exit_w_lock.vgtest index f16c1dfe91..5edf4e5ffe 100644 --- a/drd/tests/tc22_exit_w_lock.vgtest +++ b/drd/tests/tc22_exit_w_lock.vgtest @@ -1,3 +1,4 @@ prereq: ./supported_libpthread && [ -e ../../helgrind/tests/tc22_exit_w_lock ] vgopts: --num-callers=3 -q prog: ../../helgrind/tests/tc22_exit_w_lock +cleanup: rm -f vgcore.* diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-freebsd b/drd/tests/tc23_bogus_condwait.stderr.exp-freebsd new file mode 100644 index 0000000000..8fbfa87eb2 --- /dev/null +++ b/drd/tests/tc23_bogus_condwait.stderr.exp-freebsd @@ -0,0 +1,40 @@ + +Mutex not locked: mutex 0x........, recursion count 0, owner 0. + at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:79) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:59) + +The object at address 0x........ is not a mutex. + at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:82) +rwlock 0x........ was first observed at: + at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:62) + +Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 2. + at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:85) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:58) + +The impossible happened: mutex is locked simultaneously by two threads: mutex 0x........, recursion count 1, owner 2. + at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:85) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:58) + +Thread 2: +Mutex not locked by calling thread: mutex 0x........, recursion count 2, owner 1. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: grab_the_lock (tc23_bogus_condwait.c:47) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) +mutex 0x........ was first observed at: + at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) + by 0x........: main (tc23_bogus_condwait.c:58) + + +ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0) diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 index 753b589387..f2c8ad34cd 100644 --- a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 +++ b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 @@ -1,93 +1,93 @@ The object at address 0x........ is not a mutex. at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:69) + by 0x........: main (tc23_bogus_condwait.c:75) Thread 3: Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread. at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?) - by 0x........: rescue_me (tc23_bogus_condwait.c:20) + by 0x........: rescue_me (tc23_bogus_condwait.c:24) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) cond 0x........ was first observed at: at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:56) + by 0x........: main (tc23_bogus_condwait.c:61) Thread 1: Mutex not locked: mutex 0x........, recursion count 0, owner 0. at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:72) + by 0x........: main (tc23_bogus_condwait.c:79) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:54) + by 0x........: main (tc23_bogus_condwait.c:59) Thread 3: Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread. at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?) - by 0x........: rescue_me (tc23_bogus_condwait.c:24) + by 0x........: rescue_me (tc23_bogus_condwait.c:29) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) cond 0x........ was first observed at: at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:56) + by 0x........: main (tc23_bogus_condwait.c:61) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:54) + by 0x........: main (tc23_bogus_condwait.c:59) Thread 1: The object at address 0x........ is not a mutex. at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:75) + by 0x........: main (tc23_bogus_condwait.c:82) rwlock 0x........ was first observed at: at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:57) + by 0x........: main (tc23_bogus_condwait.c:62) Thread 3: Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread. at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?) - by 0x........: rescue_me (tc23_bogus_condwait.c:28) + by 0x........: rescue_me (tc23_bogus_condwait.c:33) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) cond 0x........ was first observed at: at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:56) + by 0x........: main (tc23_bogus_condwait.c:61) rwlock 0x........ was first observed at: at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:57) + by 0x........: main (tc23_bogus_condwait.c:62) Thread 1: Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 2. at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:78) + by 0x........: main (tc23_bogus_condwait.c:85) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:53) + by 0x........: main (tc23_bogus_condwait.c:58) Thread 3: Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread. at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?) - by 0x........: rescue_me (tc23_bogus_condwait.c:32) + by 0x........: rescue_me (tc23_bogus_condwait.c:37) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) cond 0x........ was first observed at: at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:56) + by 0x........: main (tc23_bogus_condwait.c:61) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:53) + by 0x........: main (tc23_bogus_condwait.c:58) Thread 1: The impossible happened: mutex is locked simultaneously by two threads: mutex 0x........, recursion count 1, owner 2. at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:78) + by 0x........: main (tc23_bogus_condwait.c:85) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:53) + by 0x........: main (tc23_bogus_condwait.c:58) Thread 2: Mutex not locked by calling thread: mutex 0x........, recursion count 2, owner 1. at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) - by 0x........: grab_the_lock (tc23_bogus_condwait.c:42) + by 0x........: grab_the_lock (tc23_bogus_condwait.c:47) by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) - by 0x........: main (tc23_bogus_condwait.c:53) + by 0x........: main (tc23_bogus_condwait.c:58) ERROR SUMMARY: 12 errors from 10 contexts (suppressed: 0 from 0) diff --git a/drd/tests/thread_name.vgtest b/drd/tests/thread_name.vgtest index 868f5f3c3b..acd7bc682f 100644 --- a/drd/tests/thread_name.vgtest +++ b/drd/tests/thread_name.vgtest @@ -1,3 +1,3 @@ -prereq: test -e thread_name && ./supported_libpthread +prereq: test -e thread_name && ./supported_libpthread && ! ../../tests/os_test freebsd vgopts: --read-var-info=yes --check-stack-var=yes --num-callers=3 prog: thread_name diff --git a/drd/tests/thread_name_freebsd.c b/drd/tests/thread_name_freebsd.c new file mode 100644 index 0000000000..0f4954ba7c --- /dev/null +++ b/drd/tests/thread_name_freebsd.c @@ -0,0 +1,63 @@ +/* Test whether assigning names to threads works properly. */ + +#define _GNU_SOURCE +#include <pthread.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include "../../drd/drd.h" + + +#define NUM_THREADS 10 + + +static pthread_barrier_t s_barrier; +static pthread_mutex_t s_mutex; +static pthread_cond_t s_cond; +static int s_counter; + +static void* thread_func(void* argp) +{ + const int thread_num = (ptrdiff_t)(argp); + pthread_mutex_t invalid_mutex; + char thread_name[32]; + + snprintf(thread_name, sizeof(thread_name), + "thread_func instance %d", thread_num + 1); + ANNOTATE_THREAD_NAME(thread_name); + + pthread_barrier_wait(&s_barrier); + + pthread_mutex_lock(&s_mutex); + while (s_counter != thread_num) + pthread_cond_wait(&s_cond, &s_mutex); + fprintf(stderr, "\n%s\n\n", thread_name); + pthread_mutex_unlock(&invalid_mutex); + s_counter++; + pthread_cond_broadcast(&s_cond); + pthread_mutex_unlock(&s_mutex); + + return 0; +} + + +int main(int arg, char** argv) +{ + int i; + pthread_t tid[NUM_THREADS]; + + pthread_barrier_init(&s_barrier, NULL, NUM_THREADS); + pthread_mutex_init(&s_mutex, 0); + pthread_cond_init(&s_cond, 0); + + for (i = 0; i < NUM_THREADS; i++) + pthread_create(&tid[i], 0, thread_func, (void*)(ptrdiff_t)i); + + for (i = 0; i < NUM_THREADS; i++) + pthread_join(tid[i], 0); + + pthread_cond_destroy(&s_cond); + pthread_mutex_destroy(&s_mutex); + + return 0; +} diff --git a/drd/tests/thread_name_freebsd.stderr.exp b/drd/tests/thread_name_freebsd.stderr.exp new file mode 100644 index 0000000000..a96e14a4f5 --- /dev/null +++ b/drd/tests/thread_name_freebsd.stderr.exp @@ -0,0 +1,93 @@ + + +thread_func instance 1 + +Thread 2 (thread_func instance 1): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 2 + +Thread 3 (thread_func instance 2): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 3 + +Thread 4 (thread_func instance 3): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 4 + +Thread 5 (thread_func instance 4): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 5 + +Thread 6 (thread_func instance 5): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 6 + +Thread 7 (thread_func instance 6): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 7 + +Thread 8 (thread_func instance 7): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 8 + +Thread 9 (thread_func instance 8): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 9 + +Thread 10 (thread_func instance 9): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +thread_func instance 10 + +Thread 11 (thread_func instance 10): +The object at address 0x........ is not a mutex. + at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?) + by 0x........: thread_func (thread_name_freebsd.c:?) + by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + + +ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 0 from 0) diff --git a/drd/tests/thread_name_freebsd.vgtest b/drd/tests/thread_name_freebsd.vgtest new file mode 100644 index 0000000000..e6317acdab --- /dev/null +++ b/drd/tests/thread_name_freebsd.vgtest @@ -0,0 +1,3 @@ +prereq: ../../tests/os_test freebsd +vgopts: --read-var-info=yes --check-stack-var=yes --num-callers=3 +prog: thread_name_freebsd diff --git a/drd/tests/thread_name_xml.vgtest b/drd/tests/thread_name_xml.vgtest index c6cd1cafb0..4c8545e38b 100644 --- a/drd/tests/thread_name_xml.vgtest +++ b/drd/tests/thread_name_xml.vgtest @@ -1,4 +1,4 @@ -prereq: test -e thread_name && ./supported_libpthread +prereq: test -e thread_name && ./supported_libpthread && ! ../../tests/os_test freebsd vgopts: --read-var-info=yes --check-stack-var=yes --num-callers=3 --xml=yes --xml-fd=2 prog: thread_name stderr_filter: filter_thread_name_xml diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am old mode 100644 new mode 100755 index ad1af191a1..cf7f76d46a --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -4,7 +4,9 @@ include $(top_srcdir)/Makefile.tool-tests.am dist_noinst_SCRIPTS = filter_stderr \ filter_stderr_solaris \ filter_helgrind \ - filter_xml + filter_xml \ + filter_freebsd.awk \ + filter_stderr_freebsd EXTRA_DIST = \ annotate_hbefore.vgtest annotate_hbefore.stdout.exp \ @@ -21,6 +23,7 @@ EXTRA_DIST = \ cond_timedwait_test.stderr.exp \ bar_bad.vgtest bar_bad.stdout.exp bar_bad.stderr.exp \ bar_bad.stderr.exp-destroy-hang \ + bar_bad.stderr.exp-freebsd \ bar_trivial.vgtest bar_trivial.stdout.exp bar_trivial.stderr.exp \ free_is_write.vgtest free_is_write.stdout.exp \ free_is_write.stderr.exp \ @@ -40,9 +43,11 @@ EXTRA_DIST = \ locked_vs_unlocked2.vgtest \ locked_vs_unlocked2.stderr.exp \ locked_vs_unlocked2.stdout.exp \ + locked_vs_unlocked2.stderr.exp-freebsd \ locked_vs_unlocked3.vgtest \ locked_vs_unlocked3.stderr.exp \ locked_vs_unlocked3.stdout.exp \ + locked_vs_unlocked3.stderr.exp-freebsd \ pth_barrier1.vgtest pth_barrier1.stdout.exp pth_barrier1.stderr.exp \ pth_barrier2.vgtest pth_barrier2.stdout.exp pth_barrier2.stderr.exp \ pth_barrier3.vgtest pth_barrier3.stdout.exp pth_barrier3.stderr.exp \ @@ -52,6 +57,7 @@ EXTRA_DIST = \ pth_cond_destroy_busy.vgtest pth_cond_destroy_busy.stderr.exp \ pth_cond_destroy_busy.stderr.exp-ppc64 \ pth_cond_destroy_busy.stderr.exp-solaris \ + pth_cond_destroy_busy.stderr.exp-freebsd \ pth_spinlock.vgtest pth_spinlock.stdout.exp pth_spinlock.stderr.exp \ rwlock_race.vgtest rwlock_race.stdout.exp rwlock_race.stderr.exp \ rwlock_test.vgtest rwlock_test.stdout.exp rwlock_test.stderr.exp \ @@ -72,16 +78,19 @@ EXTRA_DIST = \ tc06_two_races.stderr.exp \ tc06_two_races_xml.vgtest tc06_two_races_xml.stdout.exp \ tc06_two_races_xml.stderr.exp \ + tc06_two_races_xml.stderr.exp-freebsd \ tc07_hbl1.vgtest tc07_hbl1.stdout.exp tc07_hbl1.stderr.exp \ tc08_hbl2.vgtest tc08_hbl2.stdout.exp tc08_hbl2.stderr.exp \ tc09_bad_unlock.vgtest tc09_bad_unlock.stdout.exp \ tc09_bad_unlock.stderr.exp tc09_bad_unlock.stderr.exp-solaris \ + tc09_bad_unlock.stderr.exp-freebsd \ tc10_rec_lock.vgtest tc10_rec_lock.stdout.exp tc10_rec_lock.stderr.exp \ tc11_XCHG.vgtest tc11_XCHG.stdout.exp tc11_XCHG.stderr.exp \ tc12_rwl_trivial.vgtest tc12_rwl_trivial.stdout.exp \ tc12_rwl_trivial.stderr.exp \ tc12_rwl_trivial.stderr.exp-darwin970 \ tc12_rwl_trivial.stderr.exp-solaris \ + tc12_rwl_trivial.stderr.exp-freebsd \ tc13_laog1.vgtest tc13_laog1.stdout.exp tc13_laog1.stderr.exp \ tc14_laog_dinphils.vgtest tc14_laog_dinphils.stdout.exp \ tc14_laog_dinphils.stderr.exp \ @@ -96,6 +105,7 @@ EXTRA_DIST = \ tc18_semabuse.stderr.exp-linux-mips32 \ tc18_semabuse.stderr.exp-linux-mips32-b \ tc18_semabuse.stderr.exp-solaris \ + tc18_semabuse.stderr.exp-freebsd \ tc19_shadowmem.vgtest tc19_shadowmem.stdout.exp \ tc19_shadowmem.stderr.exp tc19_shadowmem.stderr.exp-mips32 \ tc19_shadowmem.stderr.exp-mips32-BE \ @@ -115,6 +125,7 @@ EXTRA_DIST = \ tc23_bogus_condwait.vgtest tc23_bogus_condwait.stdout.exp \ tc23_bogus_condwait.stderr.exp \ tc23_bogus_condwait.stderr.exp-mips32 \ + tc23_bogus_condwait.stderr.exp-freebsd \ tc24_nonzero_sem.vgtest tc24_nonzero_sem.stdout.exp \ tc24_nonzero_sem.stderr.exp \ tls_threads.vgtest tls_threads.stdout.exp \ diff --git a/helgrind/tests/bar_bad.c... [truncated message content] |
|
From: Mark W. <ma...@so...> - 2021-10-07 11:47:32
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f22758d6dad9bae9b7531046e42ce105f12e1ead commit f22758d6dad9bae9b7531046e42ce105f12e1ead Author: Mark Wielaard <ma...@kl...> Date: Thu Oct 7 13:43:19 2021 +0200 Fix make distcheck by removing references to uncommitted files Some files for the freebsd port have not yet committed, but were already referenced in the Makefiles. Remove those references for now to make distcheck happy. * coregrind/Makefile.am (valgrind_SOURCES): Remove launcher-freebsd.c * drd/tests/Makefile.am (check_PROGRAMS): Remove thread_name_freebsd. * none/tests/Makefile.am (SUBDIRS): Remove freebsd. (DIST_SUBDIRS): Likewise. * none/tests/freebsd/filter_stderr: Removed. Diff: --- coregrind/Makefile.am | 1 - drd/tests/Makefile.am | 4 ---- none/tests/Makefile.am | 5 +---- none/tests/freebsd/filter_stderr | 3 --- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index ee70cfde31..01b8783ee4 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -51,7 +51,6 @@ valgrind_SOURCES = \ endif if VGCONF_OS_IS_FREEBSD valgrind_SOURCES = \ - launcher-freebsd.c \ m_debuglog.c endif diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index b53eeefebe..07650ef88a 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -480,10 +480,6 @@ if !VGCONF_OS_IS_DARWIN check_PROGRAMS += sem_wait endif -if VGCONF_OS_IS_FREEBSD -check_PROGRAMS += thread_name_freebsd -endif - AM_CFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ @FLAG_FALIGNED_NEW@ \ diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 617c92854d..b75fb01a5e 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -47,9 +47,6 @@ endif if VGCONF_OS_IS_SOLARIS SUBDIRS += solaris endif -if VGCONF_OS_IS_FREEBSD -SUBDIRS += freebsd -endif # Platform-specific tests if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX @@ -72,7 +69,7 @@ SUBDIRS += x86-solaris endif DIST_SUBDIRS = x86 amd64 ppc32 ppc64 arm arm64 s390x mips32 mips64 nanomips \ - linux darwin solaris freebsd amd64-linux x86-linux amd64-darwin \ + linux darwin solaris amd64-linux x86-linux amd64-darwin \ x86-darwin amd64-solaris x86-solaris scripts . dist_noinst_SCRIPTS = \ diff --git a/none/tests/freebsd/filter_stderr b/none/tests/freebsd/filter_stderr deleted file mode 100755 index a778e971fc..0000000000 --- a/none/tests/freebsd/filter_stderr +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -../filter_stderr "$@" |
|
From: Paul F. <pa...@so...> - 2021-10-07 06:54:35
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a6096335c3f0d01c57b87538430de805aa632260 commit a6096335c3f0d01c57b87538430de805aa632260 Author: Paul Floyd <pj...@wa...> Date: Tue Oct 5 00:05:18 2021 +0200 FreeBSD support, patch 8a docs directory Diff: --- docs/xml/dist-docs.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/xml/dist-docs.xml b/docs/xml/dist-docs.xml index b1b5598fb0..439cdcc5f0 100644 --- a/docs/xml/dist-docs.xml +++ b/docs/xml/dist-docs.xml @@ -131,4 +131,14 @@ xmlns:xi="http://www.w3.org/2001/XInclude" /> </literallayout> </chapter> + + <chapter id="dist.readme-freebsd" + xreflabel="Readme FreeBSD"> + <title>README.freebsd</title> + <literallayout> + <xi:include href="../../README.freebsd" + parse="text" + xmlns:xi="http://www.w3.org/2001/XInclude" /> + </literallayout> + </chapter> </book> |
|
From: Paul F. <pa...@so...> - 2021-10-07 06:19:38
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e2583c02a5638fcbe7b3d693f7127ebde5d7c359 commit e2583c02a5638fcbe7b3d693f7127ebde5d7c359 Author: Paul Floyd <pj...@wa...> Date: Thu Oct 7 07:53:33 2021 +0200 FreeBSD support, patch 2 Files in the root directory Several Makefile.am files that have dependencies on FreeBSD autoconf variables. Included a few new filter files to act as placeholders to create new freebsd subdirectories. Updated NEWS with the FreeBSD bugzilla items plus a couple of other items fixed indirectly. Diff: --- .gitignore | 96 ++++++++++++++- Makefile.all.am | 25 ++++ Makefile.am | 2 + Makefile.tool.am | 24 ++++ NEWS | 2 + README | 2 + README.freebsd | 180 ++++++++++++++++++++++++++++ cachegrind/tests/Makefile.am | 2 + configure.ac | 181 ++++++++++++++++++++++++++--- coregrind/Makefile.am | 11 ++ docs/Makefile.am | 5 + drd/tests/Makefile.am | 15 ++- freebsd-drd.supp | 170 +++++++++++++++++++++++++++ freebsd-helgrind.supp | 162 ++++++++++++++++++++++++++ freebsd.supp | 51 ++++++++ gdbserver_tests/Makefile.am | 11 +- memcheck/tests/Makefile.am | 9 ++ memcheck/tests/amd64-freebsd/filter_stderr | 3 + memcheck/tests/freebsd/filter_pts | 5 + memcheck/tests/x86-freebsd/filter_stderr | 3 + mpi/Makefile.am | 4 + none/tests/Makefile.am | 23 +++- none/tests/freebsd/filter_stderr | 3 + 23 files changed, 960 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index bb8578d680..86962b4780 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ /auxprogs/getoff-nanomips-linux /auxprogs/getoff-amd64-solaris /auxprogs/getoff-x86-solaris +/auxprogs/getoff-*-freebsd /auxprogs/libmpiwrap-PPC32_LINUX.so /auxprogs/libmpiwrap-PPC64_LINUX.so /auxprogs/libmpiwrap-x86-darwin.so @@ -73,6 +74,7 @@ /cachegrind/cachegrind-*-darwin /cachegrind/cachegrind-*-linux /cachegrind/cachegrind-*-solaris +/cachegrind/cachegrind-*-freebsd /cachegrind/cg_annotate /cachegrind/cg_diff /cachegrind/cg_merge @@ -119,6 +121,7 @@ /callgrind/callgrind-*-darwin /callgrind/callgrind-*-linux /callgrind/callgrind-*-solaris +/callgrind/callgrind-*-freebsd /callgrind/callgrind_annotate /callgrind/callgrind_control /callgrind/Makefile @@ -152,6 +155,7 @@ /coregrind/link_tool_exe_darwin /coregrind/link_tool_exe_linux /coregrind/link_tool_exe_solaris +/coregrind/link_tool_exe_freebsd /coregrind/Makefile /coregrind/Makefile.in /coregrind/no_op_client_for_valgrind @@ -259,11 +263,13 @@ /dhat/dhat-*-darwin /dhat/dhat-*-linux /dhat/dhat-*-solaris +/dhat/dhat-*-freebsd /dhat/Makefile /dhat/Makefile.in /dhat/vgpreload_dhat-*-linux.so /dhat/vgpreload_dhat-*-darwin.so /dhat/vgpreload_dhat-*-solaris.so +/dhat/vgpreload_dhat-*-freebsd.so # /dhat/tests/ /dhat/tests/Makefile @@ -324,12 +330,14 @@ /drd/drd-*-darwin /drd/drd-*-linux /drd/drd-*-solaris +/drd/drd-*-freebsd /drd/Makefile /drd/Makefile.in /drd/splash2 /drd/vgpreload_drd-*-linux.so /drd/vgpreload_drd-*-darwin.so /drd/vgpreload_drd-*-solaris.so +/drd/vgpreload_drd-*-freebsd.so # /drd/docs/ /drd/docs/.deps @@ -455,6 +463,7 @@ /drd/tests/tc24_nonzero_sem /drd/tests/threaded-fork /drd/tests/thread_name +/drd/tests/thread_name_freebsd /drd/tests/trylock /drd/tests/tsan_unittest /drd/tests/unit_bitmap @@ -552,6 +561,11 @@ /gdbserver_tests/*.dSYM /gdbserver_tests/*.diff* /gdbserver_tests/*.out +/gdbserver_tests/filter_gdb +/gdbserver_tests/filter_memcheck_monitor +/gdbserver_tests/filter_stderr +/gdbserver_tests/filter_vgdb +/gdbserver_tests/filter_vgdb.in.orig /gdbserver_tests/.deps /gdbserver_tests/clean_after_fork /gdbserver_tests/detailed @@ -597,11 +611,13 @@ /helgrind/helgrind-*-darwin /helgrind/helgrind-*-linux /helgrind/helgrind-*-solaris +/helgrind/helgrind-*-freebsd /helgrind/Makefile /helgrind/Makefile.in /helgrind/vgpreload_helgrind-*-linux.so /helgrind/vgpreload_helgrind-*-darwin.so /helgrind/vgpreload_helgrind-*-solaris.so +/helgrind/vgpreload_helgrind-*-freebsd.so # /helgrind/docs/ /helgrind/docs/Makefile @@ -683,6 +699,7 @@ /lackey/lackey-*-darwin /lackey/lackey-*-linux /lackey/lackey-*-solaris +/lackey/lackey-*-freebsd /lackey/Makefile /lackey/Makefile.in @@ -707,6 +724,7 @@ /massif/massif-*-darwin /massif/massif-*-linux /massif/massif-*-solaris +/massif/massif-*-freebsd /massif/ms_print # /massif/docs/ @@ -765,6 +783,7 @@ /memcheck/memcheck-*-darwin /memcheck/memcheck-*-linux /memcheck/memcheck-*-solaris +/memcheck/memcheck-*-freebsd # /memcheck/docs/ /memcheck/docs/Makefile.in @@ -777,6 +796,8 @@ /memcheck/tests/*.stderr.out /memcheck/tests/*.stdout.diff* /memcheck/tests/*.stdout.out +/memcheck/tests/filter_dw4 +/memcheck/tests/filter_overlaperror /memcheck/tests/.deps /memcheck/tests/accounting /memcheck/tests/addressable @@ -968,7 +989,7 @@ /memcheck/tests/zeropage # /memcheck/tests/amd64/ -/memcheck/tests/amd64/*.diff +/memcheck/tests/amd64/*.diff* /memcheck/tests/amd64/*.dSYM /memcheck/tests/amd64/*.out /memcheck/tests/amd64/.deps @@ -1204,6 +1225,7 @@ /memcheck/tests/x86/*.stderr.out /memcheck/tests/x86/*.stdout.diff /memcheck/tests/x86/*.stdout.out +/memcheck/tests/x86/filter_pushfpopf /memcheck/tests/x86/.deps /memcheck/tests/x86/Makefile /memcheck/tests/x86/Makefile.in @@ -1260,6 +1282,65 @@ /memcheck/tests/x86-solaris/ldsoexec /memcheck/tests/x86-solaris/scalar +# /memcheck/tests/freebsd/ +/memcheck/tests/freebsd/*.stderr.diff* +/memcheck/tests/freebsd/*.stderr.out +/memcheck/tests/freebsd/*.stdout.diff +/memcheck/tests/freebsd/*.stdout.out +/memcheck/tests/freebsd/.deps +/memcheck/tests/freebsd/Makefile +/memcheck/tests/freebsd/Makefile.in +/memcheck/tests/freebsd/statfs +/memcheck/tests/freebsd/pdfork_pdkill +/memcheck/tests/freebsd/getfsstat +/memcheck/tests/freebsd/inlinfo +/memcheck/tests/freebsd/inlinfo_nested.so +/memcheck/tests/freebsd/extattr +/memcheck/tests/freebsd/sigwait +/memcheck/tests/freebsd/chflags +/memcheck/tests/freebsd/get_set_login +/memcheck/tests/freebsd/revoke +/memcheck/tests/freebsd/scalar +/memcheck/tests/freebsd/capsicum +/memcheck/tests/freebsd/getfh +/memcheck/tests/freebsd/linkat +/memcheck/tests/freebsd/scalar_fork +/memcheck/tests/freebsd/scalar_thr_exit +/memcheck/tests/freebsd/scalar_abort2 +/memcheck/tests/freebsd/scalar_pdfork +/memcheck/tests/freebsd/scalar_vfork +/memcheck/tests/freebsd/stat +/memcheck/tests/freebsd/file_locking_wait6 +/memcheck/tests/freebsd/utimens +/memcheck/tests/freebsd/access +/memcheck/tests/freebsd/chmod_chown +/memcheck/tests/freebsd/misc +/memcheck/tests/freebsd/get_set_context +/memcheck/tests/freebsd/utimes +/memcheck/tests/freebsd/static_allocs + +# /memcheck/tests/amd64-freebsd +/memcheck/tests/amd64-freebsd/*.stderr.diff +/memcheck/tests/amd64-freebsd/*.stderr.out +/memcheck/tests/amd64-freebsd/*.stdout.diff +/memcheck/tests/amd64-freebsd/*.stdout.out +/memcheck/tests/amd64-freebsd/.deps +/memcheck/tests/amd64-freebsd/Makefile +/memcheck/tests/amd64-freebsd/Makefile.in +/memcheck/tests/amd64-freebsd/posix_fadvise +/memcheck/tests/amd64-freebsd/posix_fallocate + +# /memcheck/tests/x86-freebsd +/memcheck/tests/x86-freebsd/*.stderr.diff +/memcheck/tests/x86-freebsd/*.stderr.out +/memcheck/tests/x86-freebsd/*.stdout.diff +/memcheck/tests/x86-freebsd/*.stdout.out +/memcheck/tests/x86-freebsd/.deps +/memcheck/tests/x86-freebsd/Makefile +/memcheck/tests/x86-freebsd/Makefile.in +/memcheck/tests/x86-freebsd/posix_fadvise +/memcheck/tests/x86-freebsd/posix_fallocate + # /mpi/ /mpi/*.dSYM /mpi/*.so @@ -1290,6 +1371,7 @@ /none/none-*-darwin /none/none-*-linux /none/none-*-solaris +/none/none-*-freebsd # /none/docs/ /none/docs/Makefile.in @@ -1946,6 +2028,18 @@ /none/tests/solaris/stack_prot /none/tests/solaris/threads_exitall +# /none/tests/freebsd/ +/none/tests/freebsd/*.stderr.diff +/none/tests/freebsd/*.stderr.out +/none/tests/freebsd/*.stdout.diff +/none/tests/freebsd/*.stdout.out +/none/tests/freebsd/.deps +/none/tests/freebsd/Makefile +/none/tests/freebsd/Makefile.in +/none/tests/freebsd/auxv +/none/tests/freebsd/osrel +/none/tests/freebsd/swapcontext + # /none/tests/x86/ /none/tests/x86/*.dSYM /none/tests/x86/*.stderr.diff diff --git a/Makefile.all.am b/Makefile.all.am old mode 100644 new mode 100755 index 06b23c99e0..1de1f13a7e --- a/Makefile.all.am +++ b/Makefile.all.am @@ -151,9 +151,17 @@ AM_CFLAGS_PSO_BASE = -dynamic \ -O -g -fno-omit-frame-pointer -fno-strict-aliasing \ -fpic -fPIC -fno-builtin @FLAG_FNO_IPA_ICF@ else +if VGCONF_OS_IS_FREEBSD +AM_CFLAGS_PSO_BASE = -O -g -fno-omit-frame-pointer -fno-strict-aliasing \ + -fpic -fPIC -fno-builtin +if COMPILER_IS_CLANG + AM_CFLAGS_BASE += @FLAG_W_NO_EXPANSION_TO_DEFINED@ +endif +else AM_CFLAGS_PSO_BASE = -O -g -fno-omit-frame-pointer -fno-strict-aliasing \ -fpic -fno-builtin @FLAG_FNO_IPA_ICF@ endif +endif # Flags for specific targets. @@ -218,6 +226,12 @@ AM_CFLAGS_PPC64LE_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(ISA_3_0_BUILD_FLAG) AM_CFLAGS_PSO_PPC64LE_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE) AM_CCASFLAGS_PPC64LE_LINUX = @FLAG_M64@ -g +AM_FLAG_M3264_X86_FREEBSD = @FLAG_M32@ +AM_CFLAGS_X86_FREEBSD = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY_2@ \ + $(AM_CFLAGS_BASE) -fomit-frame-pointer +AM_CFLAGS_PSO_X86_FREEBSD = @FLAG_M32@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE) +AM_CCASFLAGS_X86_FREEBSD = @FLAG_M32@ -g + AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@ AM_CFLAGS_ARM_LINUX = @FLAG_M32@ \ $(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8 @@ -231,6 +245,14 @@ AM_CFLAGS_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) AM_CFLAGS_PSO_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE) AM_CCASFLAGS_ARM64_LINUX = @FLAG_M64@ -g + +AM_FLAG_M3264_AMD64_FREEBSD = @FLAG_M64@ +AM_CFLAGS_AMD64_FREEBSD = @FLAG_M64@ \ + $(AM_CFLAGS_BASE) -fomit-frame-pointer +AM_CFLAGS_PSO_AMD64_FREEBSD = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE) +AM_CCASFLAGS_AMD64_FREEBSD = @FLAG_M64@ -g + + AM_FLAG_M3264_X86_DARWIN = -arch i386 AM_CFLAGS_X86_DARWIN = $(WERROR) -arch i386 $(AM_CFLAGS_BASE) \ -mmacosx-version-min=10.6 \ @@ -299,6 +321,7 @@ endif # Baseline link flags for making vgpreload shared objects. # PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst +PRELOAD_LDFLAGS_COMMON_FREEBSD = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst PRELOAD_LDFLAGS_COMMON_DARWIN = -dynamic -dynamiclib -all_load PRELOAD_LDFLAGS_COMMON_SOLARIS = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst if SOLARIS_XPG_SYMBOLS_PRESENT @@ -319,6 +342,8 @@ PRELOAD_LDFLAGS_PPC64BE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ PRELOAD_LDFLAGS_PPC64LE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ +PRELOAD_LDFLAGS_X86_FREEBSD = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@ +PRELOAD_LDFLAGS_AMD64_FREEBSD= $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@ PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386 PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64 PRELOAD_LDFLAGS_S390X_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ diff --git a/Makefile.am b/Makefile.am index f5935eb692..7749442e9f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,6 +45,7 @@ SUPP_FILES = \ glibc-2.2-LinuxThreads-helgrind.supp \ glibc-2.X-drd.supp \ darwin9.supp darwin9-drd.supp \ + freebsd.supp freebsd-helgrind.supp freebsd-drd.supp \ darwin10.supp darwin10-drd.supp \ darwin11.supp darwin12.supp darwin13.supp darwin14.supp darwin15.supp \ darwin16.supp darwin17.supp \ @@ -116,6 +117,7 @@ EXTRA_DIST = \ README.mips \ README.aarch64 \ README.solaris \ + README.freebsd \ NEWS.old \ valgrind.pc.in \ valgrind.spec.in \ diff --git a/Makefile.tool.am b/Makefile.tool.am index 2bf90de5da..fe5f002cec 100644 --- a/Makefile.tool.am +++ b/Makefile.tool.am @@ -40,13 +40,21 @@ TOOL_LDFLAGS_COMMON_DARWIN = \ TOOL_LDFLAGS_COMMON_SOLARIS = \ -static -nodefaultlibs -nostartfiles -u _start \ -Wl,-M,/usr/lib/ld/map.noexstk +TOOL_LDFLAGS_COMMON_FREEBSD = -static \ + -nodefaultlibs -nostartfiles -Wl,-u,_start @FLAG_NO_BUILD_ID@ TOOL_LDFLAGS_X86_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ +TOOL_LDFLAGS_X86_FREEBSD = \ + $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@ + TOOL_LDFLAGS_AMD64_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ +TOOL_LDFLAGS_AMD64_FREEBSD = \ + $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@ + TOOL_LDFLAGS_PPC32_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ @@ -125,12 +133,18 @@ LIBREPLACEMALLOC_PPC64BE_LINUX = \ LIBREPLACEMALLOC_PPC64LE_LINUX = \ $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a +LIBREPLACEMALLOC_X86_FREEBSD = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-freebsd.a + LIBREPLACEMALLOC_ARM_LINUX = \ $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a LIBREPLACEMALLOC_ARM64_LINUX = \ $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a +LIBREPLACEMALLOC_AMD64_FREEBSD = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-freebsd.a + LIBREPLACEMALLOC_X86_DARWIN = \ $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a @@ -187,6 +201,16 @@ LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \ $(LIBREPLACEMALLOC_ARM64_LINUX) \ -Wl,--no-whole-archive +LIBREPLACEMALLOC_LDFLAGS_X86_FREEBSD = \ + -Wl,--whole-archive \ + $(LIBREPLACEMALLOC_X86_FREEBSD) \ + -Wl,--no-whole-archive + +LIBREPLACEMALLOC_LDFLAGS_AMD64_FREEBSD = \ + -Wl,--whole-archive \ + $(LIBREPLACEMALLOC_AMD64_FREEBSD) \ + -Wl,--no-whole-archive + LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \ $(LIBREPLACEMALLOC_X86_DARWIN) diff --git a/NEWS b/NEWS index e4cec71c56..68315a77ad 100644 --- a/NEWS +++ b/NEWS @@ -37,7 +37,9 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +208531 [PATCH]: FreeBSD support for valgrind 368960 WARNING: unhandled amd64-linux syscall: 163 (acct) +407589 [Linux] Add support for C11 aligned_alloc() and GNU reallocarray() 423963 Error in child thread when CLONE_PIDFD is used 429375 PPC ISA 3.1 support is missing, part 9 431157 PPC_FEATURE2_SCV needs to be masked in AT_HWCAP2 diff --git a/README b/README index b8cc51de83..ae21cc74d6 100644 --- a/README +++ b/README @@ -46,6 +46,8 @@ platforms: - nanoMIPS/Linux - X86/Solaris - AMD64/Solaris +- X86/FreeBSD +- AMD64/FreeBSD Note that AMD64 is just another name for x86_64, and Valgrind runs fine on Intel processors. Also note that the core of macOS is called diff --git a/README.freebsd b/README.freebsd new file mode 100644 index 0000000000..c6e6818211 --- /dev/null +++ b/README.freebsd @@ -0,0 +1,180 @@ +Installing from ports or via pkg +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you are using FreeBSD 11.3 or later, then you should be able to install +Valgrind using either + +pkg install devel/valgrind + +or alternatively from ports (if installed) + +cd /usr/ports/devel/valgrind && make install clean + + +Building Valgrind +~~~~~~~~~~~~~~~~~ + +Install ports for autoconf, automake, libtool and gmake. + +$ sh autogen.sh +$ ./configure --prefix=/where/ever +$ gmake +$ gmake install + +Known Limitations (December 2020) + +0. Be aware that if you use a wrapper script and run Valgrind on the wrapper + script Valgrind may hit restrictions if the wrapper script runs any + Capsicum enabled applications. Examples of Capsicum enabled applications + are echo, basename, tee, uniq and wc. It is recommended that you either + avoid these applications or that you run Valgrind directly on your test + application. +1. There are some limitations when running Valgrind on code that was compiled + with clang. These issues are not present with code compiled with GCC. + a) There may be missing source information concerning variables. + b) The client request mechanism may not work entirely correctly. + c) Code that uses OpenMP will generate spurious errors. +2. There are some limitations specific to i386 + a) In some cases signals are mishandled causing Valgrind to terminate and + report a SIGSEGV. + b) Applications that create and join many threads may crash. + +Notes for Developers +~~~~~~~~~~~~~~~~~~~~ + +See README_DEVELOPERS, README_MISSING_SYSCALL_OR_IOCTL and docs/* +for more general information for developers. + +0. Adding syscalls. + +When adding syscalls, you need to look at the manpage and also syscalls.master +(online at +https://github.com/freebsd/freebsd/blob/master/sys/kern/syscalls.master +and for 32bit +https://github.com/freebsd/freebsd/blob/master/sys/compat/freebsd32/syscalls.master + +and if you installed the src package there should also be + +/usr/src/sys/kern/syscalls.master +and +/usr/src/sys/compat/freebsd32/syscalls.master) + +syscalls.master is particularly useful for seeing quickly whether parameters +are inputs or outputs. + +The syscall wrappers can vary from trivial to difficult. Fortunately, many are +either trivial (no arguments) or easy (Valgrind just needs to know what memory +is being read or written). Some syscalls, such as those involving process +creation and termination, signals and memory mapping require deeper interaction +with Valgrind. + +When you add syscalls you will need to modify several files + a) include/vki/vki-scnums-freebsd.h + This file contains one #define for each syscall. The _NR_ prefix (Linux + style) is used rather than SYS_ for compatibility with the rest of the + Valgrind source. + b) coregrind/m_syswrap/priv_syswrap-freebsd.h + This uses the DECL_TEMPLATE macro to generate declarations for the syscall + before and after wrappers. + c) coregrind/m_syswrap/syswrap-freebsd.c + This is where the bulk of the code resides. Toward the end of the file + the BSDX_/BSDXY macros are used to generate entries in the table of + syscalls. BSDX_ is used for wrappers that only have a 'before', BSDXY + if both wrappers are required. In general, syscalls that have no arguments + or only input arguments just need a BSDX_ macro (before only). Syscalls + with output arguments need a BSDXY macro (before and after). + d) If the syscall uses 64bit arguments (long long) then instead of putting + the wrapper definitions in syswrap-freebsd.c there will be one definition + for each platform amd64 and x86 in syswrap-x86-freebsd.c and + syswrap-amd64-freebsd.c. + Each long long needs to be split into two ARGs in the x86 version. + +The PRE (before) wrapper +------------------------ + +Each PRE wrapper always contains the following two macro calls + +PRINT. This outputs the syscall name and argument values when Valgrind is +executed with +--trace-syscalls=yes + +PRE_READ_REGX. This macro lets Valgrind know about the number and types of the +syscall arguments which allows Valgrind to check that they are initialized. +X is the number of arguments. It is best that the argument names match +the man page, but the must match the types and number of arguments in +syscalls.master. +Occasionally there are differences between the two. + +If the syscall takes pointers to memory there will be one of the following for +each pointer argument. + +PRE_MEM_RASCIIZ for NULL terminated ascii strings. + +PRE_MEM_READ for pointers to structures or arrays that are read. + +PRE_MEM_WRITE for pointers to structures or arrays that are written. + +As a rule, the definitions of structures are copied into vki-freebsd.h +with the vki- prefix. [vki - Valgrind kernel interface; this was done +historically to protect against discrepancies between user include +structure definitions and kernel definitions on Linux]. + +The POST (after) wrapper +------------------------ + +These are much easier. + +They just contain a POST_MEM_WRITE macro for each output argument. + + +Feedback +~~~~~~~~ + +If you find any problems please create a bugzilla report at +https://bugs.kde.org using the Valgrind product. + +Alternatively you can use the FreeBSD bugilla +https://bugs.freebsd.org + +Credits +~~~~~~~ + +Valgrind was originally ported to FreeBSD by Doug Rabson +in 2004. + +Paul Floyd (that's me), started looking at this project in late 2018, +took a long pause and then continued in earnest in January 2020. + +A big thanks to Nick Briggs for helping with the x86 version. + +Kyle Evans and Ed Maste for contributing patches and helping with the +integration with FreeBSD ports. + +Prior to 2018 many others have also contributed. + +Dimitry Andric +Simon Barner +Roman Bogorodskiy +Rebecca Cran +Bryan Drewery +Brian Fundakowski Feldman +Denis Generalov +Mikolaj Golub +Eugene Kilachkoff +Xin LI +Phil Longstaff +Pav Lucistnik +Conrad Meyer +Julien Nadeau +Frerich Raabe +Doug Rabson +Craig Rodrigues +Tom Russo +Stephen Sanders +Stanislav Sedov +Andrei V. Shetuhin +Niklas Sorensson +Ryan Stone +Jerry Toung +Yuri + diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index 571ae222a8..7eb20e294b 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -30,7 +30,9 @@ AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) # C ones +if !VGCONF_OS_IS_FREEBSD dlclose_LDADD = -ldl +endif if VGCONF_OS_IS_DARWIN myprint_so_LDFLAGS = $(AM_CFLAGS) -dynamic -dynamiclib -all_load -fpic else diff --git a/configure.ac b/configure.ac index 0398aafa1c..c05994516f 100755 --- a/configure.ac +++ b/configure.ac @@ -224,7 +224,7 @@ case "${host_cpu}" in ARCH_MAX="x86" ;; - x86_64) + x86_64|amd64) AC_MSG_RESULT([ok (${host_cpu})]) ARCH_MAX="amd64" ;; @@ -360,6 +360,57 @@ case "${host_os}" in ;; + *freebsd*) + AC_MSG_RESULT([ok (${host_os})]) + VGCONF_OS="freebsd" + AC_DEFINE([FREEBSD_10], 1000, [FREEBSD_VERS value for FreeBSD 10.x]) + AC_DEFINE([FREEBSD_11], 1100, [FREEBSD_VERS value for FreeBSD 11.x]) + AC_DEFINE([FREEBSD_12], 1200, [FREEBSD_VERS value for FreeBSD 12.0 to 12.1]) + AC_DEFINE([FREEBSD_12_2], 1220, [FREEBSD_VERS value for FreeBSD 12.2]) + AC_DEFINE([FREEBSD_13], 1300, [FREEBSD_VERS value for FreeBSD 13.x]) + AC_DEFINE([FREEBSD_14], 1400, [FREEBSD_VERS value for FreeBSD 14.x]) + + AC_MSG_CHECKING([for the kernel version]) + kernel=`uname -r` + + case "${kernel}" in + 10.*) + AC_MSG_RESULT([FreeBSD 10.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_10, [FreeBSD version]) + ;; + 11.*) + AC_MSG_RESULT([FreeBSD 11.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_11, [FreeBSD version]) + ;; + 12.*) + case "${kernel}" in + 12.[[0-1]]-*) + AC_MSG_RESULT([FreeBSD 12.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_12, [FreeBSD version]) + ;; + *) + AC_MSG_RESULT([FreeBSD 12.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_12_2, [FreeBSD version]) + ;; + esac + ;; + 13.*) + AC_MSG_RESULT([FreeBSD 13.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_13, [FreeBSD version]) + ;; + 14.*) + AC_MSG_RESULT([FreeBSD 14.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_14, [FreeBSD version]) + ;; + *) + AC_MSG_RESULT([unsupported (${kernel})]) + AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 14.x]) + ;; + esac + + DEFAULT_SUPP="freebsd.supp freebsd-helgrind.supp freebsd-drd.supp ${DEFAULT_SUPP}" + ;; + *darwin*) AC_MSG_RESULT([ok (${host_os})]) VGCONF_OS="darwin" @@ -660,6 +711,48 @@ case "$ARCH_MAX-$VGCONF_OS" in valt_load_address_pri_inner="0x38000000" AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) ;; + x86-freebsd) + VGCONF_ARCH_PRI="x86" + VGCONF_ARCH_SEC="" + VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD" + VGCONF_PLATFORM_SEC_CAPS="" + valt_load_address_pri_norml="0x38000000" + valt_load_address_pri_inner="0x28000000" + valt_load_address_sec_norml="0xUNSET" + valt_load_address_sec_inner="0xUNSET" + AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) + ;; + amd64-freebsd) + if test x$vg_cv_only64bit = xyes; then + VGCONF_ARCH_PRI="amd64" + VGCONF_ARCH_SEC="" + VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD" + VGCONF_PLATFORM_SEC_CAPS="" + elif test x$vg_cv_only32bit = xyes; then + VGCONF_ARCH_PRI="x86" + VGCONF_ARCH_SEC="" + VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD" + VGCONF_PLATFORM_SEC_CAPS="" + else + VGCONF_ARCH_PRI="amd64" + VGCONF_ARCH_SEC="x86" + VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD" + VGCONF_PLATFORM_SEC_CAPS="X86_FREEBSD" + fi + # These work with either base clang or ports installed gcc + # Hand rolled compilers probably need INSTALL_DIR/lib (at least for gcc) + if test x$is_clang = xclang ; then + FLAG_32ON64="-B/usr/lib32" + else + GCC_MAJOR_VERSION=`${CC} -dumpversion | $SED 's/\..*//' 2>/dev/null` + FLAG_32ON64="-B/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -Wl,-rpath,/usr/local/lib32/gcc${GCC_MAJOR_VERSION}/" + fi + valt_load_address_pri_norml="0x38000000" + valt_load_address_pri_inner="0x28000000" + valt_load_address_sec_norml="0x38000000" + valt_load_address_sec_inner="0x28000000" + AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) + ;; # Darwin gets identified as 32-bit even when it supports 64-bit. # (Not sure why, possibly because 'uname' returns "i386"?) Just about # all Macs support both 32-bit and 64-bit, so we just build both. If @@ -860,12 +953,15 @@ esac AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86, test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD \ -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \ -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \ -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS ) AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \ -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \ -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS ) AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, @@ -918,7 +1014,12 @@ AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX, test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX) AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_NANOMIPS_LINUX, test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX) -AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN, +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD, + test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN, test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN) AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN, @@ -945,12 +1046,20 @@ AM_CONDITIONAL(VGCONF_OS_IS_LINUX, -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX) +AM_CONDITIONAL(VGCONF_OS_IS_FREEBSD, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD) AM_CONDITIONAL(VGCONF_OS_IS_DARWIN, test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS, test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \ -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS) +AM_CONDITIONAL(VGCONF_OS_IS_DARWIN_OR_FREEBSD, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) # Sometimes, in the Makefile.am files, it's useful to know whether or not @@ -1068,6 +1177,14 @@ AC_EGREP_CPP([DARWIN_LIBC], [ ], GLIBC_VERSION="darwin") +AC_EGREP_CPP([FREEBSD_LIBC], [ +#include <sys/cdefs.h> +#if defined(__FreeBSD__) + FREEBSD_LIBC +#endif +], +GLIBC_VERSION="freebsd") + # not really a version check AC_EGREP_CPP([BIONIC_LIBC], [ #if defined(__ANDROID__) @@ -1159,6 +1276,11 @@ case "${GLIBC_VERSION}" in AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) # DEFAULT_SUPP set by kernel version check above. ;; + freebsd) + AC_MSG_RESULT(FreeBSD) + AC_DEFINE([FREEBSD_LIBC], 1, [Define to 1 if you're using FreeBSD]) + # DEFAULT_SUPP set by kernel version check above. + ;; bionic) AC_MSG_RESULT(Bionic) AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic]) @@ -1929,12 +2051,12 @@ case "${host_cpu}" in AC_MSG_CHECKING([if gcc accepts -m32]) safe_CFLAGS=$CFLAGS - CFLAGS="-m32 -Werror" + CFLAGS="${FLAG_32ON64} -m32 -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])], [ - FLAG_M32="-m32" + FLAG_M32="${FLAG_32ON64} -m32" AC_MSG_RESULT([yes]) ], [ FLAG_M32="" @@ -2273,6 +2395,7 @@ AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION]) AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE]) AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE]) AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION]) +AC_GCC_WARNING_SUBST_NO([expansion-to-defined], [FLAG_W_NO_EXPANSION_TO_DEFINED]) AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS]) AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY]) @@ -2656,7 +2779,7 @@ CFLAGS=$safe_CFLAGS AC_MSG_CHECKING([if gcc accepts -no-pie]) safe_CFLAGS=$CFLAGS -CFLAGS="-no-pie" +CFLAGS="-no-pie -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ return 0; @@ -2679,30 +2802,52 @@ CFLAGS=$safe_CFLAGS # will reside. -Ttext aligns just the .text section start (but not any # other section). # -# So test for -Ttext-segment which is supported by all bfd ld versions +# LLVM ld.lld 10.0 changed the semantics of its -Ttext. See "Breaking changes" +# in https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html +# The --image-base option (since version 6.0?) provides the semantics needed. +# -Ttext-segment generates an error, but -Ttext now more closely +# follows the GNU (bfd) ld's -Ttext. +# +# So test first for --image-base support, and if that fails then +# for -Ttext-segment which is supported by all bfd ld versions # and use that if it exists. If it doesn't exist it must be an older # version of gold and we can fall back to using -Ttext which has the # right semantics. -AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment]) - safe_CFLAGS=$CFLAGS -CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror" +AC_MSG_CHECKING([if the linker accepts -Wl,--image-base]) + +CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,--image-base=$valt_load_address_pri_norml -Werror" AC_LINK_IFELSE( [AC_LANG_SOURCE([int _start () { return 0; }])], [ linker_using_t_text="no" - AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"]) + AC_SUBST([FLAG_T_TEXT], ["--image-base"]) AC_MSG_RESULT([yes]) ], [ - linker_using_t_text="yes" - AC_SUBST([FLAG_T_TEXT], ["-Ttext"]) AC_MSG_RESULT([no]) + + AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment]) + + CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror" + + AC_LINK_IFELSE( + [AC_LANG_SOURCE([int _start () { return 0; }])], + [ + linker_using_t_text="no" + AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"]) + AC_MSG_RESULT([yes]) + ], [ + linker_using_t_text="yes" + AC_SUBST([FLAG_T_TEXT], ["-Ttext"]) + AC_MSG_RESULT([no]) + ]) ]) + CFLAGS=$safe_CFLAGS -# If the linker only supports -Ttext (not -Ttext-segment) then we will +# If the linker only supports -Ttext (not -Ttext-segment or --image-base) then we will # have to strip any build-id ELF NOTEs from the statically linked tools. # Otherwise the build-id NOTE might end up at the default load address. # (Pedantically if the linker is gold then -Ttext is fine, but newer @@ -2728,7 +2873,7 @@ AC_LINK_IFELSE( AC_MSG_RESULT([no]) ]) else -AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.]) +AC_MSG_NOTICE([ld --image-base or -Ttext-segment used, no need to strip build-id NOTEs.]) AC_SUBST([FLAG_NO_BUILD_ID], [""]) fi CFLAGS=$safe_CFLAGS @@ -4515,6 +4660,7 @@ AC_PATH_PROG([MPI_CC], [mpicc], [mpicc], mflag_primary= if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \ -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ @@ -4522,6 +4668,7 @@ if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then mflag_primary=$FLAG_M32 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \ -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \ @@ -4537,7 +4684,8 @@ mflag_secondary= if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \ -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS \ - -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX ; then + -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD ; then mflag_secondary=$FLAG_M32 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then mflag_secondary="$FLAG_M32 -arch i386" @@ -4558,6 +4706,9 @@ AC_SUBST(MPI_CC) AM_COND_IF([VGCONF_OS_IS_LINUX], [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic" LDFLAGS_MPI="-fpic -shared"]) +AM_COND_IF([VGCONF_OS_IS_FREEBSD], + [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic" + LDFLAGS_MPI="-fpic -shared"]) AM_COND_IF([VGCONF_OS_IS_DARWIN], [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic" LDFLAGS_MPI="-dynamic -dynamiclib -all_load"]) diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 65d2c705ad..ee70cfde31 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -49,6 +49,11 @@ valgrind_SOURCES = \ launcher-linux.c \ m_debuglog.c endif +if VGCONF_OS_IS_FREEBSD +valgrind_SOURCES = \ + launcher-freebsd.c \ + m_debuglog.c +endif # for valgrind coregrind building, use the LTO versions, in case they differ from non lto versions AR = ${LTO_AR} @@ -92,6 +97,12 @@ endif if VGCONF_OS_IS_SOLARIS vgdb_SOURCES += vgdb-invoker-solaris.c endif +if VGCONF_OS_IS_FREEBSD +# As with Darwin, we don't have ptrace PTRACE_PEEKTEXT +# so we can't use vgdb-invoker-ptrace.c +# Need to find an alternative, like Solaris +vgdb_SOURCES += vgdb-invoker-none.c +endif vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) diff --git a/docs/Makefile.am b/docs/Makefile.am index e9d659d2ec..5c777a263a 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -113,7 +113,11 @@ valkyriedir = $(top_builddir)/docs/vg-html downloadsdir = $(top_builddir)/docs/downloads vgdir = $(top_builddir)/docs/valgrind +if VGCONF_OS_IS_FREEBSD +XML_CATALOG_FILES = /usr/local/share/xml/catalog +else XML_CATALOG_FILES = /etc/xml/catalog +endif # file to log print output to LOGFILE = print.log @@ -132,6 +136,7 @@ XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl XSL_MAN_STYLES = \ + /usr/local/share/xsl/docbook/manpages/docbook.xsl \ /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \ /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \ /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 3889fb15e3..b53eeefebe 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -400,7 +400,6 @@ check_PROGRAMS = \ pth_inconsistent_cond_wait \ pth_mutex_reinit \ pth_process_shared_mutex \ - pth_uninitialized_cond \ recursive_mutex \ rwlock_race \ rwlock_test \ @@ -428,8 +427,12 @@ endif if HAVE_BUILTIN_ATOMIC_CXX check_PROGRAMS += \ - annotate_smart_pointer \ - tsan_unittest + annotate_smart_pointer +endif + +if !VGCONF_OS_IS_FREEBSD +check_PROGRAMS += tsan_unittest \ + pth_uninitialized_cond endif # clang 3.3 will generate errors about libstdc++ headers from @@ -477,6 +480,10 @@ if !VGCONF_OS_IS_DARWIN check_PROGRAMS += sem_wait endif +if VGCONF_OS_IS_FREEBSD +check_PROGRAMS += thread_name_freebsd +endif + AM_CFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ @FLAG_FALIGNED_NEW@ \ @@ -487,7 +494,9 @@ LDADD = -lpthread bug322621_SOURCES = bug322621.cpp concurrent_close_SOURCES = concurrent_close.cpp +if !VGCONF_OS_IS_FREEBSD dlopen_main_LDADD = -ldl +endif dlopen_lib_so_SOURCES = dlopen_lib.c dlopen_lib_so_CFLAGS = -fPIC dlopen_lib_so_LDFLAGS = -shared -fPIC diff --git a/freebsd-drd.supp b/freebsd-drd.supp new file mode 100644 index 0000000000..a3414b544a --- /dev/null +++ b/freebsd-drd.supp @@ -0,0 +1,170 @@ +# Suppressions for FreeBSD / DRD + +{ + DRD-LDRT + drd:ConflictingAccess + obj:/libexec/ld-elf*.so.1 +} +{ + DRD-PTHREAD-EXIT1 + drd:ConflictingAccess + ... + fun:pthread_exit +} +{ + DRD-PTHREAD_CREATE1 + drd:ConflictingAccess + ... + fun:pthread_create +} +{ + DRD-PTHREAD-EXIT2 + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + fun:pthread_exit +} +{ + DRD-PRINTF1 + drd:ConflictingAccess + fun:f*lockfile +} +{ + DRD-MANY1 + drd:ConflictingAccess + obj:/lib/libthr.so.3 + obj:/libexec/ld-elf*.so.1 +} +{ + DRD-MANY2 + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 + obj:/libexec/ld-elf*.so.1 +} +{ + DRD-MANY3 + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 + obj:/libexec/ld-elf*.so.1 +} +{ + DRD-UNWIND1 + drd:ConflictingAccess + ... + fun:dl_iterate_phdr + obj:*/lib*/libgcc_s.so.1 +} +{ + DRD-PTHREAD-DETACH1 + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + fun:pthread_detach +} +{ + DRD-LIBGOMP + drd:ConflictingAccess + obj:/usr/local/lib*/gcc*/libgomp.so.1.0.0 +} +{ + DRD-LIBOMP + drd:ConflictingAccess + obj:/usr/lib*/libomp.so +} +{ + DRD-LIBGOMP3 + drd:ConflictingAccess + fun:.omp_outlined* +} +{ + DRD-LIBGOMP4 + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 + fun:pthread_setspecific +} +{ + DRD-UNWIND1 + drd:ConflictingAccess + fun:_Unwind_GetCFA + obj:*/lib*/libthr.so.3 + obj:*/lib*/libgcc_s.so.1 +} +{ + DRD-UNWIND2 + drd:ConflictingAccess + ... + fun:_Unwind_ForcedUnwind +} +{ + DRD-PTHREAD-ATTR1 + drd:ConflictingAccess + fun:pthread_attr_get_np +} +{ + DRD-PTHREAD-SETSPECIFIC + drd:ConflictingAccess + fun:pthread_setspecific +} +{ + DRD-MEMSET + drd:ConflictingAccess + fun:memset + obj:*/lib*/libthr.so.3 +} +{ + DRD-SET-POINTER + drd:ConflictingAccess + fun:_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE11set_pointerEPS1_ +} +{ + DRD-DL-ITERATE-PHDR + drd:ConflictingAccess + ... + obj:*/lib*/libthr.so.3 + obj:/libexec/ld-elf*.so.1 + fun:dl_iterate_phdr +} +{ + DRD-LIBGCC-S + drd:ConflictingAccess + obj:*/lib*/libgcc_s.so.1 + obj:*/lib*/libgcc_s.so.1 + obj:*/lib*/libgcc_s.so.1 + obj:*/lib*/libgcc_s.so.1 + obj:*/lib*/libgcc_s.so.1 + obj:*/lib*/libgcc_s.so.1 +} +{ + DRD-DLOPEN + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + fun:dlopen +} +{ + DRD-LD-ELF + drd:ConflictingAccess + obj:*/lib*/libthr.so.3 + ... + obj:/libexec/ld-elf*.so.1 +} +{ + DRD-SNPRINTF + drd:ConflictingAccess + ... + obj:*/lib*/libc.so.7 + fun:snprintf +} +{ + DRD-FREEBSD122-OMP + drd:MutexErr + fun:pthread_mutex_destroy_intercept + fun:pthread_mutex_destroy + fun:_ZNSt3__15mutexD1Ev + fun:__cxa_finalize +} diff --git a/freebsd-helgrind.supp b/freebsd-helgrind.supp new file mode 100644 index 0000000000..d24ff859bf --- /dev/null +++ b/freebsd-helgrind.supp @@ -0,0 +1,162 @@ +# Suppressions for FreeBSD / Helgrind + +{ + HELGRIND-LIBTHR1 + Helgrind:Race + obj:*/lib*/libthr.so.3 +} +{ + HELGRIND-LIB-LDRT1 + Helgrind:Race + obj:/libexec/ld-elf*.so.1 +} +{ + HELGRIND-PTHREAD-EXIT0 + Helgrind:Race + fun:thr_exit + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 +} +{ + HELGRIND-PTHREAD-EXIT1 + Helgrind:Race + fun:_pthread_exit_mask + fun:pthread_exit + obj:*/lib*/libthr.so.3 +} +{ + HELGRIND-PTHREAD-EXIT2 + Helgrind:Race + fun:__sys_thr_exit + fun:_pthread_exit_mask + fun:pthread_exit + obj:*/lib*/libthr.so.3 +} +{ + HELGRIND-PTHREAD-EXIT4 + Helgrind:Race + fun:_thr_try_gc + obj:*/lib*/libthr.so.3 + fun:pthread_join_WRK + fun:pthread_join +} +{ + HELGRIND-PTHREAD-EXIT5 + Helgrind:Race + fun:__sys_thr_exit + obj:*/lib*/libthr.so.3 + fun:_pthread_exit_mask + fun:pthread_exit + obj:/lib/libthr.so.3 +} +{ + HELGRIND-PTHREAD-BARRIER2 + Helgrind:Race + fun:pthread_barrier_init +} +# added PJF +{ + HELGRIND-EXIT1 + Helgrind:Race + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + fun:__cxa_finalize + fun:exit +} +{ + HELGRIND-EXIT2 + Helgrind:Race + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + fun:_rtld_error + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + fun:__cxa_finalize + fun:exit +} +{ + HELGRIND-EDIT3 + Helgrind:Race + fun:_rtld_error + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + fun:__cxa_finalize + fun:exit +} +{ + HELGRIND-EXIT3 + Helgrind:Race + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + fun:__cxa_finalize + fun:exit +} +# PJF not sure exactly what the cause of this is, but it looks like it is the +# tls used for pthread_self() with a conflict between pthread_create and +# mythread_wrapper which coverst create/join/exit +{ + HELGRIND-PTHREAD-CREATE1 + Helgrind:Race + obj:/libexec/ld-elf*.so.1 + fun:_rtld_allocate_tls + obj:*/lib*/libthr.so.3 + obj:*/lib*/libthr.so.3 + fun:pthread_create +} +{ + HELGRIND-PTHREAD-CREATE2 + Helgrind:Race + fun:memset + obj:*/lib*/libthr.so.3 + fun:pthread_create +} +# PJF again a pthread_self() hazard +{ + HELGRIND-PTHREAD-SELF1 + Helgrind:Race + fun:mythread_wrapper + obj:*/lib*/libthr.so.3 +} +{ + HELGRIND-SEM-CLOCKWAIT1 + Helgrind:Race + fun:sem_clockwait_np +} +{ + HELGRIND-UMTX-OP1 + Helgrind:Race + fun:_umtx_op +} +{ + HELGRIND-SEM-POST1 + Helgrind:Race + fun:sem_post +} +{ + HELGRIND-GCC-UNWIND1 + Helgrind:Race + obj:/lib/libgcc_s.so.1 +} +{ + HELGRIND-LIBC-PRINTF1 + Helgrind:Race + fun:flockfile +} +{ + HELGRIND-LIBC-PRINTF2 + Helgrind:Race + fun:funlockfile +} +{ + HELGRIND-MUTEX-LOCK1 + Helgrind:Race + fun:memset + obj:*/lib*/libthr.so.3 +} +{ + HELGRIND-LIBOMP + Helgrind:Race + obj:/usr/lib*/libomp.so +} diff --git a/freebsd.supp b/freebsd.supp new file mode 100644 index 0000000000..7345d713de --- /dev/null +++ b/freebsd.supp @@ -0,0 +1,51 @@ +# Suppressions for FreeBSD / Memcheck +#This is a workaround for a bug in rtld +{ + MEMCHECK-RTLD-32ON64 + Memcheck:Addr4 + fun:memcpy + fun:elf_aux_info +} +{ + MEMCHECK-RTLD-COND + Memcheck:Cond + obj:/libexec/ld-elf*.so.1 +} +{ + MEMCHECK-RTLD-32ON64-ADDR4 + Memcheck:Addr4 + obj:/libexec/ld-elf32.so.1 + obj:/libexec/ld-elf32.so.1 +} + +{ + MEMCHECK-LIBSTDC++-REACHABLE + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + obj:/usr/local/lib*/gcc9/libstdc++.so.* + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 + obj:/libexec/ld-elf*.so.1 +} +{ + MEMCHECK-LIBC-REACHABLE + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + obj:*/lib*/libc.so.7 + obj:*/lib*/libc.so.7 + obj:*/lib*/libc.so.7 + fun:vfprintf_l +} +# clang only, should check that this is not a genuine error +{ + MEMCHECK-POSIX-FADVISE + Memcheck:Cond + fun:posix_fadvise +} +{ + MEMCHECK-POSIX-FALLOCATE + Memcheck:Cond + fun:posix_fallocate +} diff --git a/gdbserver_tests/Makefile.am b/gdbserver_tests/Makefile.am index 1a5c51356a..e93ead322f 100644 --- a/gdbserver_tests/Makefile.am +++ b/gdbserver_tests/Makefile.am @@ -155,17 +155,20 @@ check_PROGRAMS = \ clean_after_fork \ fork_chain \ gone \ - main_pic \ passsigalrm \ self_invalidate \ sleepers \ t \ watchpoints +if !VGCONF_OS_IS_FREEBSD + check_PROGRAMS += main_pic + + main_pic_LDFLAGS = @FLAG_PIE@ + main_pic_CFLAGS = $(AM_CFLAGS) -fPIC +endif + AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) LDADD = -lpthread - -main_pic_LDFLAGS = @FLAG_PIE@ -main_pic_CFLAGS = $(AM_CFLAGS) -fPIC diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 38a087cdfc..9fe8082b94 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -36,6 +36,9 @@ endif if VGCONF_OS_IS_SOLARIS SUBDIRS += solaris endif +if VGCONF_OS_IS_FREEBSD +SUBDIRS += freebsd +endif # Platform-specific tests if VGCONF_PLATFORMS_INCLUDE_X86_LINUX @@ -53,6 +56,12 @@ endif if VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS SUBDIRS += amd64-solaris endif +if VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD +SUBDIRS += x86-freebsd +endif +if VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD +SUBDIRS += amd64-freebsd +endif DIST_SUBDIRS = x86 amd64 ppc32 ppc64 s390x linux \ darwin solaris x86-linux amd64-linux arm64-linux \ diff --git a/memcheck/tests/amd64-freebsd/filter_stderr b/memcheck/tests/amd64-freebsd/filter_stderr new file mode 100755 index 0000000000..a778e971fc --- /dev/null +++ b/memcheck/tests/amd64-freebsd/filter_stderr @@ -0,0 +1,3 @@ +#! /bin/sh + +../filter_stderr "$@" diff --git a/memcheck/tests/freebsd/filter_pts b/memcheck/tests/freebsd/filter_pts new file mode 100755 index 0000000000..81dd4f2041 --- /dev/null +++ b/memcheck/tests/freebsd/filter_pts @@ -0,0 +1,5 @@ +#! /bin/sh + +../filter_stderr "$@" | + +gsed 's/Open file descriptor.*/Open file descriptor .../' diff --git a/memcheck/tests/x86-freebsd/filter_stderr b/memcheck/tests/x86-freebsd/filter_stderr new file mode 100755 index 0000000000..a778e971fc --- /dev/null +++ b/memcheck/tests/x86-freebsd/filter_stderr @@ -0,0 +1,3 @@ +#! /bin/sh + +../filter_stderr "$@" diff --git a/mpi/Makefile.am b/mpi/Makefile.am index 471fee02a9..69b69aa925 100644 --- a/mpi/Makefile.am +++ b/mpi/Makefile.am @@ -40,6 +40,10 @@ if VGCONF_OS_IS_LINUX MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI) MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC) endif +if VGCONF_OS_IS_FREEBSD + MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI) + MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC) +endif if VGCONF_OS_IS_DARWIN MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI) MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index e4a12cadc3..617c92854d 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -47,6 +47,9 @@ endif if VGCONF_OS_IS_SOLARIS SUBDIRS += solaris endif +if VGCONF_OS_IS_FREEBSD +SUBDIRS += freebsd +endif # Platform-specific tests if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX @@ -69,7 +72,7 @@ SUBDIRS += x86-solaris endif DIST_SUBDIRS = x86 amd64 ppc32 ppc64 arm arm64 s390x mips32 mips64 nanomips \ - linux darwin solaris amd64-linux x86-linux amd64-darwin \ + linux darwin solaris freebsd amd64-linux x86-linux amd64-darwin \ x86-darwin amd64-solaris x86-solaris scripts . dist_noinst_SCRIPTS = \ @@ -265,9 +268,12 @@ if HAVE_NESTED_FUNCTIONS endif # This doesn't appear to be compilable on Darwin. +if ! VGCONF_OS_IS_DARWIN_OR_FREEBSD + check_PROGRAMS += rlimit64_nofile +endif + if ! VGCONF_OS_IS_DARWIN - check_PROGRAMS += rlimit64_nofile \ - ppoll_alarm + check_PROGRAMS += ppoll_alarm endif # clang does not know -ansi @@ -328,9 +334,14 @@ pth_self_kill_LDADD = -lpthread pth_stackalign_LDADD = -lpthread pth_2sig_LDADD = -lpthread pth_term_signal_LDADD = -lpthread -res_search_LDADD = -lresolv -lpthread +if VGCONF_OS_IS_FREEBSD + res_search_LDADD = -lpthread + resolv_LDADD = -lpthread +else + res_search_LDADD = -lresolv -lpthread + resolv_LDADD = -lresolv -lpthread +endif resolv_CFLAGS = $(AM_CFLAGS) -resolv_LDADD = -lresolv -lpthread if VGCONF_OS_IS_SOLARIS resolv_CFLAGS += -U_REENTRANT endif @@ -366,7 +377,7 @@ else endif vgprintf_nvalgrind_SOURCES = vgprintf.c -vgprintf_nvalgrind_CFLAGS = -DNVALGRIND +vgprintf_nvalgrind_CFLAGS = ${AM_CFLAGS} -DNVALGRIND valgrind_cpp_test_SOURCES = valgrind_cpp_test.cpp valgrind_cpp_test_LDADD = -lstdc++ diff --git a/none/tests/freebsd/filter_stderr b/none/tests/freebsd/filter_stderr new file mode 100755 index 0000000000..a778e971fc --- /dev/null +++ b/none/tests/freebsd/filter_stderr @@ -0,0 +1,3 @@ +#! /bin/sh + +../filter_stderr "$@" |