[PATCH 06/10 v3] libdwP.h: Add locking to dwarf_formref_die and __libdw_dieabbrev
Aaron Merey
amerey@redhat.com
Wed Aug 21 00:34:16 GMT 2024
Hi Mark,
On Fri, Aug 16, 2024 at 5:51 PM Mark Wielaard <mark@klomp.org> wrote:
>
> On Fri, Aug 02, 2024 at 07:38:05PM -0400, Aaron Merey wrote:
> > From: Heather McIntyre <hsm2@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 <hsm2@rice.edu>
> > Signed-off-by: Aaron Merey <amerey@redhat.com>
> > Signed-off-by: Mark Wielaard <mark@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?
I moved these dwarf_formref_die.c into the patch "libdw: Make
libdw_find_split_unit thread-safe", which was pushed as commit
2630bce747. The rest of the changes were pushed as commit
28b74a1bf73.
Aaron
More information about the Elfutils-devel
mailing list