On 9/8/2011 4:27 PM, Christopher Faylor wrote:
On Thu, Sep 08, 2011 at 04:15:47PM +0200, Marco atzeri wrote:

Question:
is a mistake in pclose to assume that fh could be invalid

I'm not sure what you're asking here.  It's not a mistake to assume that
pclose is being passed a valid fp.  Linux also crashes if the fp is
closed twice.

Just as I noticed earlier on syscall.cc a defensive approuch

-----------------------------------------------
close_all_files (bool norelease)
{
  cygheap->fdtab.lock ();

  semaphore::terminate ();

  fhandler_base *fh;
  HANDLE h = NULL;

  for (int i = 0; i < (int) cygheap->fdtab.size; i++)
    if ((fh = cygheap->fdtab[i]) != NULL)
      {
------------------------------------------------


or something is just trashing cygheap->fdtab ?

Who knows?  strace should show if the fp is closed twice.

cgf

correct, it looks I have two close in excess for fd 5 and 6

Thanks
Marco



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

Reply via email to