apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Rumph <mike.ru...@oracle.com>
Subject testdup test fails when compiled in debug mode on Windows
Date Wed, 06 Nov 2013 19:06:05 GMT
The apr_file_dup2() function in apr/file_io/win32/filedup.c calls 
_commit() for standard file handles 0, 1 and 2.
The _commit() function will assert with the message "Invalid file 
descriptor. File possibly closed by a different thread" or return a 
value of -1 if the file handle refers to a device.
The assert will appear if APR is compiled in debug mode.

This can be seen by running "testall.exe testdup".
But if file redirection is used (such as "testall.exe testdup > outfile 
2>&1"), then the test completes successfully.

I have attached a patch that corrects this problem by checking _isatty().

Credit goes to Jeff Trawick for catching this problem in the first place.

Thanks,

Mike Rumph

Mime
View raw message