libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] interval based cache?


From: Dave Watson
Subject: Re: [Libunwind-devel] interval based cache?
Date: Wed, 12 Apr 2017 12:13:55 -0700
User-agent: Mutt/1.6.0 (2016-04-01)

On 04/12/17 02:08 PM, Doug Moore wrote:
> It's not clear to me that the cache is thread-safe; I don't see any locking
> going on, so I wonder if there might be problems with multiple threads
> reading/writing the global cache at once.  Has this problem been addressed?

Gparser.c calls lock_acquire and lock_release if caching is UNW_CACHE_GLOBAL

http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=src/dwarf/Gparser.c;h=ede856e053e5d1716058d2e56165e9feb4a670e6;hb=HEAD#l571

which are macros around sigprocmask + taking the lock with pthread_mutex_lock

http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=include/libunwind_i.h;h=ee2ea2fbec327b1f812baabbab98191ded830c56;hb=HEAD#l199

For thread-local cache, it is indeed not really safe, looks like the
TLS part of it was removed at some point in the past, and we should
fix it eventually:

http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=include/dwarf.h;h=e29b8400ea90719d196cffebd184829ca12a0b98;hb=HEAD#l41



reply via email to

[Prev in Thread] Current Thread [Next in Thread]