Created attachment 136077 [details] DRD tests changes Changes in the DRD tests directory. Here are the main things. Makefile.am New expecteds. I cleaned up the C++ tests that work OK with clang. Made libdl (which does not exist on FreeBSD conditional) Added a FreeBSD version of thread_name. In general this seems to be going a bit against the DRD philosophy of not having platform specific tests. Soumc C files wouldn't compile (missing headers). There is a FreeBSD defect related to the use of pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN + 4096); In all cases these have been made conditional bar_bad* needs an expexted, like Solaris circular_buffer was generating errors due to the global seed. So I moved the call to rand into main and added the time to a new struct. concurrent_close - increased the stack depth because FreeBSD start function is in libc which increases the stack depth. filters - make sure GNU sed is used. Need to make this a configure time selection. Added some FreeBSD specific filters. pth_detached3 - need to see if this can be made a bit more portable without the #ifdef; required header change std_list - added a guard to setlocale otherwise there were tons of hazards swapcontext -WIP There are a few new expecteds and modified expected where I need to change the C files and hence the line numbers.
Created attachment 141836 [details] diffs in DRD/tests
I haven't reviewed the new/changed tests themselves. But this is where you would introduce the new configure.ac CONFIG files for: drd/tests/filter_error_count.in drd/tests/filter_error_summary.in drd/tests/filter_stderr.in drd/tests/filter_stderr_and_thread_no_and_offset.in drd/tests/filter_thread_no.in drd/tests/filter_xml_and_thread_no.in I would also add them with their full names in .gitignore. Using filter_* is too broad IMHO. Are you sure that the cleanup: rm -f vgcore.* in the .vgtest files is a good idea? Do these tests deliberately dump core? If not I would keep the vgcore files to investigate afterwards. I assume the drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 and drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 changes were because of the line number shifts in the corresponding test files?
I've added the full filter_ names to .gitignore. As a rule, if the guest application dumps core when running standalone then it will also dump core when running under Valgrind. Since a lot of the regression tests are deliberately performing undefined behaviour, some of them do dump core. If I remmember rightly, these ones do not core dump on Linux but they do on FreeBSD. I've had to change several test .c files. In the tc23 case, there is a header missing on FreeBSD and a copuple of the UB tests caused a hang, so I made them conditional.
This addition makes things compile: diff --git a/.gitignore b/.gitignore index 4f1a341cc..ca91c6b90 100644 --- a/.gitignore +++ b/.gitignore @@ -342,6 +342,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_and_thread_no_and_offset +/drd/tests/filter_stderr +/drd/tests/filter_thread_no +/drd/tests/filter_xml_and_thread_no /drd/tests/.deps /drd/tests/annotate_barrier /drd/tests/annotate_hb_err diff --git a/configure.ac b/configure.ac index 874287863..dee9b8911 100755 --- a/configure.ac +++ b/configure.ac @@ -5195,6 +5195,20 @@ AC_CONFIG_FILES([coregrind/link_tool_exe_darwin], [chmod +x coregrind/link_tool_exe_darwin]) AC_CONFIG_FILES([coregrind/link_tool_exe_solaris], [chmod +x coregrind/link_tool_exe_solaris]) + +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_OUTPUT cat<<EOF But tests/os_test freebsd cannot be used in a prereq in drd/tests/thread_name.vgtest drd/tests/thread_name_freebsd.vgtest and drd/tests/thread_name_xml.vgtest because that generates an error: returned 2: ../../tests/os_test freebsd tests/is_test.c needs to be updated before this patch can be applied
Created attachment 141936 [details] freebsd5 patch After applying the freebsd-tests.patch from bug #433504 - FreeBSD support, part 8, before this one and adding those .gitignore and configure.ac CONFIG files this compiles on fedora x86_64. But it does introduce one failure drd/tests/tc23_bogus_condwait (stderr) because the line numbers in some backtraces don't match anymore.
Created attachment 142036 [details] freebsd5 My original freebsd5 patch was missing some of the new filter .in files. This adds them. I would still recommend merging this with freebsd7 patch to prevent some spurious failures for tests that changed for the helgrind tests.
Created attachment 142185 [details] drd and helgrind tests Merged drd and helgrind tests
Code committed with commit 85bbe2853e813bbd83aa17bc17c2b73d82f6bc3e