This is the mail archive of the cygwin-patches 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: check_iovec cleanup


On Wed, Jul 26, 2006 at 07:15:43PM -0500, Brian Ford wrote:
>On Wed, 26 Jul 2006, Christopher Faylor wrote:
>
>> Thanks for the patch,
>
>Thanks for the review.
>
>> but I'm not convinced that this patch duplicates the functionality that
>> you eliminated from check_iovec.
>
>It doesn't exactly, but the part it doesn't didn't seem correct.  See
>below.
>
>> And, the dummytest is actually there for a reason.
>
>Ok, then what *is* the reason for checking only the last byte of each
>iovec buffer for read or write-ability?  Doesn't it need to check a byte
>on every system page to be complete (because buffers could start in or
>span across invalid/protected virtual addresses)?  Should an error be
>flagged if the readv wouldn't have actually accessed the invalid addresses
>(I'm not sure here)?
>
>After my patch, if the iovec buffer addresses are invalid, they will
>either be flagged as such by the underlying Windows system call, or they
>will trigger the fault handler installed above by all check_iovec callers
>if the cygwin DLL code tries to access them, no?

The "underlying Windows system call" can throw an uncaught exception.
That's why we check first.

The check is there for a reason.  When I first moved to the exception
handling method, I took all of the checking out of the iovec stuff.  I
had to put it back in because it didn't work without it.

cgf


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