This is the mail archive of the cygwin 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: [1.7] deleting in-use directories


On Apr  9 17:30, Eric Blake wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> 
> > Incredible but true.  It was an alignment problem with a local buffer
> > in the function which moves the directory to the bin when a sharing
> > violation occurs.
> 
> > BYTE infobuf[sizeof (FILE_NAME_INFORMATION) + 32767 * sizeof (WCHAR)]
> 
> That's an awfully big buffer to be stack-allocating.  It's bigger than a system 
> page, which means if you are nearing stack overflow, then call rmdir(), your 
> application could suffer from silent termination rather than orderly SIGSEGV 
> stack overflow when it accesses beyond the guard page.

Yes, I know.  I didn't use the TLS temporary path buffer because the
returned size is potentially a bit bigger than 64K (by the above sizeof
(FILE_NAME_INFORMATION)), which is the max.  buffer size for these temp
buffers.  I was already wondering when I fixed the alignment problem
if we should just ignore this potential problem.

Erm...

Actually the max size is 64K + 4 bytes.  Given that PATH_MAX is 4096,
maybe a temporary TLS buffer of 64K is sensible enough.

Hang on, I'll fix that in a minute.


Corinna

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

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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