This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cancellation and dlmopen?


On 11/17/2015 09:14 PM, Carlos O'Donell wrote:

> I don't see any file-private lock implementation in SQLite upstream,
> but you are correct from a first principles perspective.

See os_unix.c, section âPosix Advisory Lockingâ.  The global variable is
called inodeList.

> Could you explain in a little more detail how you see the failure
> mode in this case?

Two copies of libsqlite3.so in the same process will have separate
inodeList values.  This means that they can both lock the same file and
assume they have exclusive access.  In addition, if one SQLite copy
closes this file, it releases the lock for all the other files.  SQLite
needs to keep global state because POSIX advisory locks are âbroken by
designâ (their words, not mine, but it is difficult to see a scenario in
which the POSIX semantics make any sense at all), and if the state is
namespace-local instead of global, things fall apart quickly.

Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]