This is the mail archive of the cygwin-apps 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: [patch/rebase] Add a rebase database to keep track of DLL addresses

On Jul 24 14:09, Charles Wilson wrote:
> On 7/24/2011 7:44 AM, Corinna Vinschen wrote:
> > How do you know there was nothing stored?  Maybe it was just not what
> > you expected.  Say, if read returned 1 and wrote a 0x0 byte, it can
> > easily be missed.
> Sure, but the actual contents of *(array[i].name) were not changed,
> according to my tests.  I think the issue is that all of the read()
> checks are of the form:
> 	if (read (...) < 0)
>             report error
> but read is returning 0

Ouch, ouch, ouch!  Why didn't you say that in your first mail?  Ignoring
0 == EOF is a blatant bug in my loader code.

Wait with your patch, please.  First I'll add the early-EOF handling.

> posix is /not/ (always) an error (*). So the test above is more-or-less

It's never an error, it just means EOF.

> (*) although I would have thought that read() would block until it DID
> get the number of requested bytes

That would be pretty bad since it would never return in the last read
which encounters EOF.  We're talking about files, not about pipes or
signals.  And even in these cases it only hanmgs and waits for input
as long as the other side didn't close the connection, which then is
equivalent to EOF.

> > Oh boy.
> Yep. I'm hungering for the day when msys-2.0 is created, as a much
> simpler fork from cygwin-$modern.  If we're lucky it could even be a
> simple patch rather than a full-on fork. (With cygwin's new /etc/fstab
> support, support for multiple simultaneous cygwin installs, AND dropping
> support in MinGW/MSYS for Win9x/WinNT-, the delta between cygwin and
> $stuff-msys-needs is much smaller. Basically: changing the name of
> global objects, modifying uname(), turning off a lot of perms/security,
> and the auto-path-translation logic in

Fortunately I don't have to understand that.

> If we *don't* make that change (to the read tests), then I'd still feel
> better about using calloc -- or at least setting name[0] to '\0'
> explicitly (but short reads would then overwrite the initial '\0' with
> no guarantee that any trailing '\0' would be present).

As soon as EOF is handled, this won't be necessary.

> > (*) Actually \?? is a virtual folder which merges a system-wide folder
> >     (\GLOBAL??) and a per-session folder (\Sessions\0\DosDevices\$session-id). 
> Oh, sure...simple as ABC. :-P

It's a pretty plain concept, not at all rocket science.  

> Thanks for the explanation, tho -- that's going in my permanent
> cygwin-data folder...

Nothing to do with Cygwin...


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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