[CHANGESET] Random failure of fopen when file does not exist
Rafael Laboissiere
rafael at debian.org
Thu Feb 5 16:18:54 CST 2009
In the process of packaging octave 3.1.51 for Debian, I am getting errors
like this:
/usr/bin/make -C interpreter all
[...]
../../run-octave -f -q -H -p . --eval "sparseimages ('spchol', 'txt');"
error: fputs: invalid stream number = -1
[...]
The annoying thing is that the bug is not deterministic and the build fails
each time on a different run-octave line.
I think I nailed down the problem and the changeset attached below should
fix it. It seems to be caused by changeset b68e44c90afe, in which a test
using fs.is_dir () was introduced in do_stream_open(). The problem is that
when the file_stat fs variable is created in file_stat fs (fname) and the
file with name fname does not exist (as it is the case in the example
above), then the private variable fs_mode is not initialized. In my system
here (Debian sid amd64) it seems that fs.is_dir() will return random values
in this case.
I hope I did the correct analysis and the fix is appropriate. At least, the
Debian package is building correctly now.
--
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proper-fs-is-dir-test.diff
Type: text/x-diff
Size: 1548 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20090205/a5029578/attachment.bin
More information about the Octave-maintainers
mailing list