Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can trigger hangs in loopback FS with find and SIGINT on Sierra #314
On OS X El Capitan, this works fine. However, on Sierra, this causes the find to hang, causes any subsequent find to hang at around the same spot, and causes any attempted unmount (via
FYI, this is possibly the minimal repro of a problem we've been seeing in KBFS, so hopefully fixing this problem will fix our KBFS problem, but it's worth fixing anyway.
The hangs are caused by changes Apple made to the Sierra kernel (and FUSE using a kernel-private struct). The bad news is that Apple has not released the kernel sources for Sierra, yet. With the sources this would be an easy fix. I'm currently working on a workaround.
I haven't tried; the symptoms in kbfs and the hello bazil filesystem is that when the executable (which doesn't autodaemonize) runs, Ctrl-C'ing it causes a hang, similar to the find hang in this repro.
However, the kbfs / hellofs executable itself doesn't seem to hang, and processes requests fine -- it seems like the kernel itself hangs when the executable exits.
I don't know if the above is helpful -- should I try reproing with other file system operations?
added a commit
Sep 26, 2016
I've looked into this for a couple of days now but, at this point, all I can offer is a workaround that should work for most users.
Apple seems to have changed the way the kernel handles interrupts. So far I have not found a way using only public API to get interrupt handling to work on Sierra. This is one part of the problem.
The other part is that Apple has made changes to the (private) thread_t data structure in the kernel. The offset of the relevant field FUSE needs to access has changed. Using lldb I was able to fix this. But the problem with this approach is that the offset actually differs between the production, debug and development kernels. The current workaround works for the production kernel, not the other two.
The new 3.5.2 release contains the workaround. Please let me know if it works for you.