[PATCH] libdw: add thread-safety to dwarf_getabbrev()

Jonathon Anderson jma14@rice.edu
Wed Aug 21 22:21:00 GMT 2019



On Wed, Aug 21, 2019 at 4:50 PM, Mark Wielaard <mark@klomp.org> wrote:
> On Fri, 2019-08-16 at 14:24 -0500, Jonathon Anderson wrote:
>>  diff --git a/ChangeLog b/ChangeLog
>>  index bed3999f..93907ddd 100644
>>  --- a/ChangeLog
>>  +++ b/ChangeLog
>>  @@ -1,3 +1,8 @@
>>  +2019-08-15  Jonathon Anderson <jma14@rice.edu>
>>  +
>>  +	* configure.ac: Add new --enable-valgrind-annotations
>>  +	* configure.ac: Add new --with-valgrind (headers only)
>>  +
>>   2019-08-13  Mark Wielaard  <mark@klomp.org>
>> 
>>   	* configure.ac: Set version to 0.177.
>>  diff --git a/configure.ac b/configure.ac
>>  index c443fa3b..c5406b44 100644
>>  --- a/configure.ac
>>  +++ b/configure.ac
>>  @@ -323,6 +323,35 @@ if test "$use_valgrind" = yes; then
>>   fi
>>   AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes)
>> 
>>  +AC_ARG_WITH([valgrind],
>>  +AS_HELP_STRING([--with-valgrind],[include directory for Valgrind
>>  headers]),
>>  +[with_valgrind_headers=$withval], [with_valgrind_headers=no])
>>  +if test "x$with_valgrind_headers" != xno; then
>>  +    save_CFLAGS="$CFLAGS"
>>  +    CFLAGS="$CFLAGS -I$with_valgrind_headers"
>>  +    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
>>  +      #include <valgrind/valgrind.h>
>>  +      int main() { return 0; }
>>  +    ]])], [ HAVE_VALGRIND_HEADERS="yes"
>>  +            CFLAGS="$save_CFLAGS -I$with_valgrind_headers" ],
>>  +          [ AC_MSG_ERROR([invalid valgrind include directory:
>>  $with_valgrind_headers]) ])
>>  +fi
>>  +
>>  +AC_ARG_ENABLE([valgrind-annotations],
>>  +AS_HELP_STRING([--enable-valgrind-annotations],[insert extra
>>  annotations for better valgrind support]),
>>  +[use_vg_annotations=$enableval], [use_vg_annotations=no])
>>  +if test "$use_vg_annotations" = yes; then
>>  +    if test "x$HAVE_VALGRIND_HEADERS" != "xyes"; then
>>  +      AC_MSG_CHECKING([whether Valgrind headers are available])
>>  +      AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
>>  +        #include <valgrind/valgrind.h>
>>  +        int main() { return 0; }
>>  +      ]])], [ AC_MSG_RESULT([yes]) ],
>>  +            [ AC_MSG_ERROR([valgrind annotations requested but no
>>  headers are available]) ])
>>  +    fi
>>  +fi
>>  +AM_CONDITIONAL(USE_VG_ANNOTATIONS, test "$use_vg_annotations" = 
>> yes)
>>  +
>>   AC_ARG_ENABLE([install-elfh],
>>   AS_HELP_STRING([--enable-install-elfh],[install elf.h in include 
>> dir]),
>>                  [install_elfh=$enableval], [install_elfh=no])
>>  @@ -668,6 +697,7 @@ AC_MSG_NOTICE([
>>     OTHER FEATURES
>>       Deterministic archives by default  : 
>> ${default_ar_deterministic}
>>       Native language support            : ${USE_NLS}
>>  +    Extra Valgrind annotations         : ${use_vg_annotations}
>> 
>>     EXTRA TEST FEATURES (used with make check)
>>       have bunzip2 installed (required)  : ${HAVE_BUNZIP2}
> 
> This part sets up things so we can include extra valgrind annotations,
> but then doesn't seem to be used. It sounds useful though, because
> valgrind/helgrind won't know about any of the atomics. Is this
> something you added, but then removed?
> 
> Thanks,
> 
> Mark
> 
> P.S. It looks like something decided to add some line breaks in the
> patch so that it doesn't easily apply. It isn't hard to fixup, but you
> might want to consider submitting using git send-email or attaching 
> the
> result of git format-patch instead of putting the patch in the message
> body.

Originally I had some issues with git send-mail, I usually do PRs 
purely in git so the email side is still a little new. I've attached 
the original patch from git format-patch, sorry for the mess.

-Jonathon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libdw-add-thread-safety-to-dwarf_getabbrev.patch
Type: text/x-patch
Size: 51473 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/elfutils-devel/attachments/20190821/eb5e6c10/attachment.bin>


More information about the Elfutils-devel mailing list