On Fri, Nov 10, 2017 at 02:02:07PM +0000, Mathieu Desnoyers wrote:
> > @@ -312,9 +321,15 @@ error:
> >     if (elf) {
> >             free(elf->ehdr);
> >             if (elf->fd >= 0) {
> > -                   if (close(elf->fd)) {
> > +                   lttng_ust_lock_fd_tracker();
> > +                   ret = close(elf->fd);
> > +                   if (!ret) {
> > +                           lttng_ust_delete_fd_from_tracker(elf->fd);
> > +                   } else {
> > +                           PERROR("close");
> >                             abort();
> >                     }
> > +                   lttng_ust_lock_fd_tracker();
> 
> This appears to be a double-lock.

I was testing you... more seriously good catch.

> 
> How did you test this code path ?

I did not test the error path. Will be more careful in the future.

v2 simplify all of this by using lttng_ust_elf_destroy directly.

Cheers

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to