On Fri, Aug 02, 2024 at 07:38:05PM -0400, Aaron Merey wrote:
> From: Heather McIntyre <h...@rice.edu>
> 
>       * libdw/dwarf_formref_die.c (dwarf_formref_die): Add locking
>         around call to __libdw_intern_next_unit.
>         * libdw/libdwP.h (__libdw_dieabbrev): Add locking.
> 
> Signed-off-by: Heather S. McIntyre <h...@rice.edu>
> Signed-off-by: Aaron Merey <ame...@redhat.com>
> Signed-off-by: Mark Wielaard <m...@klomp.org>
> 
> v3 changes:
> Move dwarf_setalt.c changes to patch 5/9 v3.
> Set __libdw_dieabbrev result before releasing lock.
> ---
>  libdw/dwarf_formref_die.c |  3 +++
>  libdw/libdwP.h            | 25 +++++++++++++++++++++----
>  2 files changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/libdw/dwarf_formref_die.c b/libdw/dwarf_formref_die.c
> index 48ba8194..69d1bf1c 100644
> --- a/libdw/dwarf_formref_die.c
> +++ b/libdw/dwarf_formref_die.c
> @@ -92,7 +92,10 @@ dwarf_formref_die (Dwarf_Attribute *attr, Dwarf_Die 
> *result)
>         bool scan_debug_types = false;
>         do
>           {
> +           rwlock_wrlock(attr->cu->dbg->dwarf_lock);
>             cu = __libdw_intern_next_unit (attr->cu->dbg, scan_debug_types);
> +           rwlock_unlock(attr->cu->dbg->dwarf_lock);
> +
>             if (cu == NULL)
>               {
>                 if (scan_debug_types == false)

Aha, sorry, so there is extra locking around __libdw_intern_next_unit
here. Shouldn't this be combined with the next patch?

Thanks,

Mark

Reply via email to