This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
elf_end(): rwlock_fini() with a locked object
- From: Kurt Roeckx <kurt at roeckx dot be>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Sun, 26 Feb 2012 00:11:43 +0100
- Subject: elf_end(): rwlock_fini() with a locked object
Hi,
In libelf/elf_end.c:244 you have:
rwlock_fini (elf->lock);
But this lock is always still held when you get there.
I see this:
> Results are undefined if pthread_rwlock_destroy()
> is called when any thread holds rwlock.
[...]
> The pthread_rwlock_destroy() function may fail if:
> [EBUSY]
> The implementation has detected an attempt to destroy the object
> referenced by rwlock while it is locked.
And I get this on Debian's kfreebsd port, resulting in an
assertion failure. I wonder why I'm not getting it on other
ports.
Adding a "rwlock_unlock (elf->lock);" just in front of that
line fixes the problem.
Kurt