This is the mail archive of the cygwin-developers mailing list for the Cygwin 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: About the dll search algorithm of dlopen (patch-r3)

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
> >>
> >> 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

Attachment: signature.asc
Description: PGP signature

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