Failure of test07 in 27_io/filebuf_members.cc under HP-UX (PR 9964)
John David Anglin
dave@hiauly1.hia.nrc.ca
Thu Apr 10 19:06:00 GMT 2003
I have examined the failure of 27_io/filebuf_members.cc on
hppa2.0w-hp-hpux11.11. The test fails because the following code
from config/io/basic_file_stdio.cc doesn't close the file after a
character is written to a broken pipe:
__basic_file<char>*
__basic_file<char>::close()
{
__basic_file* __retval = static_cast<__basic_file*>(NULL);
if (this->is_open())
{
fflush(_M_cfile);
if ((_M_cfile_created && fclose(_M_cfile) == 0) || !_M_cfile_created)
{
_M_cfile = 0;
__retval = this;
}
}
return __retval;
}
The fflush and fclose calls both fail with error EPIPE. As a result,
_M_cfile is not set to 0 and the test fails. I don't know if the
fclose call actually closes the stream or not.
The single unix specification indicates that any use of a stream
after calling fclose will cause undefined behavior. So, possibly
_M_cfile should always be set to 0 after calling fclose.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
More information about the Libstdc++
mailing list