bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #20495] debug version crashes on windows on close(-1)


From: anonymous
Subject: [bug #20495] debug version crashes on windows on close(-1)
Date: Tue, 03 Mar 2009 16:16:56 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)

Follow-up Comment #1, bug #20495 (project make):

There seems to be a change within the Microsoft Visual C++ Runtime between
Microsoft Visual Studio .NET (aka 2002) and Microsoft Visual Studio 2005. I
have no access to Microsoft Visual Studio 2003 so I can't prove if this
behavior was introduced earlier.

Microsoft Visual Studio .NETVc7crtsrcclose.c

/* validate file handle */
if ( ((unsigned)fh >= (unsigned)_nhandle) ||
     !(_osfile(fh) & FOPEN) )
 {
        /* bad file handle, set errno and abort */
        errno = EBADF;
        _doserrno = 0;
        return -1;
}

Microsoft Visual Studio 8VCcrtsrcclose.c

/* validate file handle */
_CHECK_FH_CLEAR_OSSERR_RETURN( fh, EBADF, -1 );
_VALIDATE_CLEAR_OSSERR_RETURN((fh >= 0 && (unsigned)fh < (unsigned)_nhandle),
EBADF, -1);
_VALIDATE_CLEAR_OSSERR_RETURN((_osfile(fh) & FOPEN), EBADF, -1);

Anyway, closing the file handle -1 is definitely a bug, which was ignored by
earlier versions of the Microsoft libraries (in fact it was reported by the
return code of close() which is *explicitly* ignored by the caller within
function.c).

Regards, Stefan

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?20495>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]