About the dll search algorithm of dlopen (patch-r3)

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Aug 30 13:26:00 GMT 2016

On Aug 26 16:08, Michael Haubenwallner wrote:
> On 08/26/2016 12:59 PM, Corinna Vinschen wrote:
> > Hi Michael,
> > 
> > On Aug 25 19:48, Michael Haubenwallner wrote:
> >> Using tmp_pathbuf now, wrapped behind some trivial allocator - which
> >> might fit better somewhere else than to dlfcn.cc?
> >>
> >> BTW: Is it really intended for tmp_pathbuf to have a single active
> >> instance (per thread) at a time?
> > 
> > Well, yes.  tmp_pathbuf is meant to be initialized on function entry
> > (more or less, depends).  It's supposed to exist only once per frame.
> > When the frame goes out of scope, the tmp_pathbuf usage counter is
> > restored to the values of the parent frame.
> > 
> >> +   ATTENTION: Requesting memory from an instance of tmp_pathbuf breaks
> >> +   when another instance on a newer stack frame has provided memory. */
> > 
> > I don't understand this comment, though.
> Problem is that while the second tmp_pathbuf is constructed,
> the first tmp_pathbuf must not be asked for another buffer,
> because destructing the second tmp_pathbuf will reset the
> tls.counter to what it was before constructing the second,
> causing the first tmp_pathbuf to return buffers *again* which
> it may have returned already while the second one was alive.
> I've had something like this scope flow breaking, where pathfinder
> used tmp_pathbuf tpF as its own instance, while the local stack
> used tmp_pathbuf tpL:

Yeah, ok, that's not what tmp_pathbuf was designed for, it was strictly
a per-frame thingy.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20160830/3576217b/attachment.sig>

More information about the Cygwin-developers mailing list