[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[CHANGESET] Random failure of fopen when file does not exist
From: |
Rafael Laboissiere |
Subject: |
[CHANGESET] Random failure of fopen when file does not exist |
Date: |
Thu, 5 Feb 2009 23:18:54 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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
proper-fs-is-dir-test.diff
Description: Text Data
- [CHANGESET] Random failure of fopen when file does not exist,
Rafael Laboissiere <=