Bug 278057 - fuse filesystem syscall deadlocks
Summary: fuse filesystem syscall deadlocks
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.7 SVN
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-18 23:21 UTC by Mike Shal
Modified: 2011-08-18 15:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch against svn r11899 to fix the issue. (1.24 KB, patch)
2011-07-18 23:21 UTC, Mike Shal
Details
Additional fuse callback compatibility via command line argument. (6.04 KB, patch)
2011-07-19 16:19 UTC, James E. King, III
Details
Adds sys_chdir() and sys_stat64() to the fuse clo patch. (6.74 KB, patch)
2011-07-19 23:55 UTC, Mike Shal
Details
Adds sys_newfstatat() and sys_fstatat64(). (7.53 KB, patch)
2011-08-04 01:26 UTC, Mike Shal
Details
Add a 'fuse-compatible' sym-hint (6.94 KB, patch)
2011-08-12 21:39 UTC, Mike Shal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Shal 2011-07-18 23:21:39 UTC
Created attachment 61973 [details]
Patch against svn r11899 to fix the issue.

Valgrind will deadlock when entering file-system related syscalls in a FUSE filesystem, similar to this thread: http://sourceforge.net/mailarchive/message.php?msg_id=26871509

The attached patch applies the same fix to the following syscalls: chdir(), close(), fchdir(), and stat64(). The patch only fixes the x86-linux version of stat64() since it is the only platform I can test. The other syscalls are in the generic file.
Comment 1 James E. King, III 2011-07-19 16:19:40 UTC
Created attachment 61989 [details]
Additional fuse callback compatibility via command line argument.

Added --fuse-compatible as a command-line argument which turns on the MayBlock flag for the following calls:

fstatfs
fstatfs64
mknod
chmod
chown
lchown
close
fchdir
fchown
fchmod
newfstat
readlink
rename
utimes
Comment 2 Jeremy Fitzhardinge 2011-07-19 19:56:07 UTC
Those syscalls can block in a number of circumstances, not just fuse.  They're all considered to be "fast" syscalls (ie, they generally won't fail with EINTR when used on normal file objects), but network/fuse filesystems can and do break the rules (close, in particular, can block for unbounded times on some network filesystems).

It would be better to give the clo a more generic name along the lines of "blocking fast syscalls".
Comment 3 Mike Shal 2011-07-19 23:55:54 UTC
Created attachment 61998 [details]
Adds sys_chdir() and sys_stat64() to the fuse clo patch.

Updated attachment 61989 [details] to fix the syscalls that still block in my particular fuse file-system.
Comment 4 Mike Shal 2011-08-04 01:26:55 UTC
Created attachment 62521 [details]
Adds sys_newfstatat() and sys_fstatat64().

This updated patch adds new syscalls to work with x86_64, and fstatat().
Comment 5 Julian Seward 2011-08-10 10:04:25 UTC
(In reply to comment #4)
> This updated patch adds new syscalls to work with x86_64, and fstatat().

Looks good to me.  Only comment is, I'd prefer not to have another
command line argument, and instead use the existing --sim-hints=
option to request this minor modification of behaviour, as that's what
it's for.  Grep for clo_sim_hints.  In this case it'll be
--sim-hints=fuse-compatible, I suppose.  Hence:

* rm clo_fuse_compatible; use clo_sim_hints instead
* add a suitable 1-liner description of it in the --sim-hints section
  in docs/xml/manual-core.xml
* add it to the --help text

Good to land asap w/ the above changes.
Comment 6 Mike Shal 2011-08-12 21:39:57 UTC
Created attachment 62785 [details]
Add a 'fuse-compatible' sym-hint
Comment 7 Julian Seward 2011-08-18 15:13:29 UTC
Committed, r11993.  Thanks, and sorry for the delay.