[Bug 194293] New: FUSE program freezes when seeking pos > file size
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Oct 10 20:30:25 UTC 2014
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194293
Bug ID: 194293
Summary: FUSE program freezes when seeking pos > file size
Product: Base System
Version: 10.1-BETA3
Hardware: amd64
OS: Any
Status: Needs Triage
Severity: Affects Many People
Priority: ---
Component: kern
Assignee: freebsd-bugs at FreeBSD.org
Reporter: nishida at asusa.net
This happens with both 10.1-RC1 and 9.3-Release.
I wrote a simple and straight forward file system program with FUSE.
It just does like:
open: open a file with the same name in a different directory
read: read a file with the same name in a different directory
write: write a file with the same name in a different directory
etc.
However, the program always freezes when saving a xcf file (Gimp's native
format) with Gimp.
Once it freezes, it cannot be killed even by shutdown.
Therefore, I always have to reset my PC after shutdown.
After investigating Gimp's source code, I found that this happened when Gimp
tried to fseek() a position greater than the file size.
In /usr/ports/graphics/gimp-app/work/gimp-2.8.10/app/xcf/xcf-seek.c, there is
xcf_seek_pos().
Adding
fstat(fd, &sb);
if (pos > sb.st_size) {
ftruncate(fd, pos);
}
to it solved the problem.
This is not only a FUSE's problem, but I guess it will be better to deal with
it.
Sincerely,
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list