|
From: Paul F. <pj...@wa...> - 2020-07-02 06:27:06
|
Well, let’s try to get the ball rolling. I’ll kick off with a few things here that I feel are not likely to be accepted. 1. Number of added ‘expected’ files. Currently there are 126 (and for comparison, Solaris only has about 30). About half of these are for Helgrind, which I’ll come to in a moment. I also generated expected files for Linux/clang to cover many of the clang vs. GCC issues. Some of those can probably be removed. Most of the clang diffs are due to clang generating fewer branches and using ‘cmov’ opcodes instead. This tends to cause errors to pop up later. For instance something like “printf(“foo %d”, cond ? a : b)” will generate an error at the call site with GCC but will cause more than one error in the libc printf internals with clang. I’ve also modified several of the test source files, either because they crash under FreeBSD (for instance, creating mutexes with completely bogus data) or because they don’t compile or because clang optimises away errors. Where there are blocks that are #ifdeffed out, a different expected is needed. One possible solution to the above would be to make a separate FreeBSD-only test - disable the original in the .vgtest file for FreeBSD and then copy the test to the appropriate FreeBSD directory. 2. Filter scripts. ‘sed' on FreeBSD is not GNU sed, which is an optional install as ‘used’. Rather than waste time debugging sed issues, and not being very expert with automake I just did a brute force change in the filter scripts that is basically “if uname == FreeBSD sed=gsed else sed=sed” and then use $sed. Making automake .in files would probably be cleaner. 3. Helgrind changes. The FreeBSD pthread* signatures do not end with @*. So I’ve changed the filter and expected files to strip the @*. There would be fewer changes if I reversed this (which would require a tool with regex lookahead). Lastly on Helgrind, when Valgrind is built with clang there is no function prolog generated for pthread/sem functions. As a consequence the generated stack traces are missing one of the ‘hg_intercepts.c’ lines. One possibility to avoid that would be to disable optimization for the Helgrind intercepts so that clang generates the prologs. I might also be able to use the same mechanism as is used for syscalls (which also don’t have any prolog). A+ Paul |