Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various FreeBSD issues #14

Open
novel opened this issue May 11, 2019 · 5 comments
Open

Various FreeBSD issues #14

novel opened this issue May 11, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@novel
Copy link

novel commented May 11, 2019

There are a number of issues with pyfuse3 on FreeBSD right now.

Buildtime issues:

  1. In src/pyfuse.pyx, there's def syncfs(path) function that calls libc_extra.syncfs(), which is expected to be available in unistd.h. However, there's no such function available on FreeBSD, and, in general, it appears to be Linux-only.
  2. In src/pyfuse3.pyx, it's expected that linux/fs.h contains RENAME_EXCHANGE and RENAME_NOREPLACE which's not the case on FreeBSD (there's no such header at all).

Runtime issues:

$ sudo python3 examples/tmpfs.py ~/fuse
Traceback (most recent call last):
  File "examples/tmpfs.py", line 451, in <module>
    trio.run(pyfuse3.main)
  File "/usr/local/lib/python3.6/site-packages/trio-0.11.0-py3.6.egg/trio/_core/_run.py", line 1444, in run
    raise runner.main_task_outcome.error
  File "/usr/home/novel/code/pyfuse3/src/_pyfuse3.py", line 30, in wrapper
    await fn(*args, **kwargs)
  File "src/pyfuse3.pyx", line 732, in main
    async with trio.open_nursery() as nursery:
  File "/usr/local/lib/python3.6/site-packages/trio-0.11.0-py3.6.egg/trio/_core/_run.py", line 506, in __aexit__
    raise combined_error_from_nursery
  File "/usr/home/novel/code/pyfuse3/src/_pyfuse3.py", line 30, in wrapper
    await fn(*args, **kwargs)
  File "src/internal.pxi", line 229, in _session_loop
    await _wait_fuse_readable()
  File "src/internal.pxi", line 205, in _wait_fuse_readable
    async with worker_data.read_lock:
  File "src/internal.pxi", line 207, in pyfuse3._wait_fuse_readable
    await trio.hazmat.wait_readable(session_fd)
  File "/usr/local/lib/python3.6/site-packages/trio-0.11.0-py3.6.egg/trio/_core/_io_kqueue.py", line 131, in wait_readable
    await self._wait_common(fd, select.KQ_FILTER_READ)
  File "/usr/local/lib/python3.6/site-packages/trio-0.11.0-py3.6.egg/trio/_core/_io_kqueue.py", line 120, in _wait_common
    self._kqueue.control([event], 0)
OSError: [Errno 19] Operation not supported by device
$

I'm yet to debug this traceback further.

@Nikratio Nikratio added the bug Something isn't working label May 12, 2019
@Nikratio
Copy link
Contributor

Thanks for the report! I've never tried to use pyfuse with BSD at all, so you may into all sorts of issues. Happy to accept patches if they not too invasive though.

@novel
Copy link
Author

novel commented May 12, 2019

I have workarounds for the build time issues, but probably it doesn't make a lot of sense to send patches before I can get it working.

Right now I'm not sure how to approach this traceback though. WIll be good to at least figure out if that's pyfuse or trio issue first. Ideas are welcome.

@Nikratio
Copy link
Contributor

I suspect the problem is that FreeBSD does not support polling on the fuse descriptor. So it's not an issue in one specific library, trio seems to be using kqueue for polling on FreeBSD, and pyfuse3 passes an fd to trio for which this isn't supported. Maybe trio could be changed to use a different polling primitive - or it may need kernel support.

@novel
Copy link
Author

novel commented May 12, 2019

I noticed that trio fails to poll even on files like /dev/random or /dev/null, while kqueue generally works fine with that: python-trio/trio#1050

Also, when I try to run some pyfuse examples and it fails, it leaves the mount point:

$ mount|grep fuse
/dev/fuse on /usr/home/novel/fuse (fusefs, local, synchronous)
$

And I can run my C test program I included in the trio issue on /dev/fuse:

$ ./a.out /dev/fuse
/dev/fuse ready to read
$

@ThomasWaldmann
Copy link
Collaborator

Are there any news for freebsd compatibility?

I am looking at pyfuse3 as a successor of unmaintained llfuse (which works on linux, freebsd, macOS, ...) but I need something with at least similar platform support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants