Bug 239831 - sysutils/fusefs-lkl: lklfuse hangs on SIGINT on CURRENT
Summary: sysutils/fusefs-lkl: lklfuse hangs on SIGINT on CURRENT
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Conrad Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-13 21:12 UTC by Alan Somers
Modified: 2023-01-25 17:51 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (cem)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2019-08-13 21:12:46 UTC
On a recent head, lklfuse hangs on SIGINT (but not on normal unmount).  The problem can be easily reproduced by running lklfuse in debug mode, then issueing CTRL-C.

> uname -a
FreeBSD arginine-fbsd-head 13.0-CURRENT FreeBSD 13.0-CURRENT #7 r350943M: Mon Aug 12 22:46:56 UTC 2019     somers@arginine-fbsd-head:/usr/obj/usr/home/somers/freebsd/base/head/amd64.amd64/sys/GENERIC  amd64
> 
lklfuse -o type=ext2,debug /tmp/ext2.img /tmp/mnt
FUSE library version: 2.9.9
nullpath_ok: 1
nopath: 1
utime_omit_ok: 1
[    0.000000] Linux version 4.16.0 (root@head-amd64-default-job-13) (gcc version 9.1.0 (FreeBSD Ports Collection)) #1 Sat Aug 3 20:01:57 UTC 2019
[    0.000000] bootmem address range: 0x802601000 - 0x806600000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16159
[    0.000000] Kernel command line: mem=64M virtio_mmio.device=292@0x1000000:1
[    0.000000] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Memory available: 64440k/65532k RAM
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 4096
[    0.000000] lkl: irqs initialized
[    0.000000] clocksource: lkl: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[    0.000007] lkl: time and timers initialized (irq2)
[    0.000033] pid_max: default: 4096 minimum: 301
[    0.000059] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.000068] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.006301] console [lkl_console0] enabled
[    0.006324] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.006336] xor: automatically using best checksumming function   8regs     
[    0.006393] random: get_random_u32 called from bucket_table_alloc+0x8b/0x240 with crng_init=0
[    0.006424] NET: Registered protocol family 16
[    0.334184] raid6: int64x1  gen()  9489 MB/s
[    0.674170] raid6: int64x1  xor()  5417 MB/s
[    1.014266] raid6: int64x2  gen() 11916 MB/s
[    1.354327] raid6: int64x2  xor()  6942 MB/s
[    1.694230] raid6: int64x4  gen()  8790 MB/s
[    2.034345] raid6: int64x4  xor()  6150 MB/s
[    2.374362] raid6: int64x8  gen()  8616 MB/s
[    2.554210] random: fast init done
[    2.714301] raid6: int64x8  xor()  6065 MB/s
[    2.714324] raid6: using algorithm int64x2 gen() 11916 MB/s
[    2.714334] raid6: .... xor() 6942 MB/s, rmw enabled
[    2.714343] raid6: using intx1 recovery algorithm
[    2.714526] clocksource: Switched to clocksource lkl
[    2.714702] NET: Registered protocol family 2
[    2.714934] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes)
[    2.714966] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    2.714994] TCP bind hash table entries: 512 (order: 0, 4096 bytes)
[    2.715023] TCP: Hash tables configured (established 512 bind 512)
[    2.715081] UDP hash table entries: 128 (order: 0, 4096 bytes)
[    2.715091] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
[    2.715198] virtio-mmio: Registering device virtio-mmio.0 at 0x1000000-0x1000123, IRQ 1.
[    2.716274] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[    2.717085] SGI XFS with ACLs, security attributes, no debug enabled
[    2.738308] io scheduler noop registered
[    2.738370] io scheduler deadline registered
[    2.738417] io scheduler cfq registered (default)
[    2.738430] io scheduler mq-deadline registered
[    2.738439] io scheduler kyber registered
[    2.738459] virtio-mmio virtio-mmio.0: Failed to enable 64-bit or 32-bit DMA.  Trying to continue, but this might not work.
[    2.741372] virtio_blk virtio0: [vda] 2097152 512-byte logical blocks (1.07 GB/1.00 GiB)
[    2.742789] NET: Registered protocol family 10
[    2.743873] Segment Routing with IPv6
[    2.743909] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.744330] Btrfs loaded, crc32c=crc32c-generic
[    2.744548] Warning: unable to open an initial console.
[    2.744604] This architecture does not have kernel memory protection.
[    2.746119] EXT4-fs (vda): mounting ext2 file system using the ext4 subsystem
[    2.747607] EXT4-fs (vda): mounted filesystem without journal. Opts: 
warning: multithreaded mode not supported
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 1862
INIT: 7.23
flags=0x00010033
max_readahead=0x00010000
   INIT: 7.19
   flags=0x00000011
   max_readahead=0x00010000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
^C[   10.800564] EXT4-fs (vda): re-mounted. Opts: (null)
[   10.800951] reboot: Restarting system
> procstat -kk 1860
  PID    TID COMM                TDNAME              KSTACK                       
 1860 100119 lklfuse             -                   mi_switch+0x494 sleepq_switch+0x348 sleepq_catch_signals+0x6e2 sleepq_timedwait_sig+0x1b _sleep+0x6e4 fdisp_wait_answ+0x164 fuse_vfsop_unmount+0x103 dounmount+0x675 sys_unmount+0x4bc syscallenter+0x4e1 amd64_syscall+0x1b fast_syscall_common+0x101 
 1860 100768 lklfuse             -                   mi_switch+0x494 sleepq_switch+0x348 sleepq_catch_signals+0x6e2 sleepq_wait_sig+0x1b _sleep+0x721 kern_sigtimedwait+0x521 sys_sigwaitinfo+0x8e syscallenter+0x4e1 amd64_syscall+0x1b fast_syscall_common+0x101

The procstat output shows that lklfuse is stuck in unmount while waiting for a reponse from the server (i.e. itself).  That suggests that there's an ordering bug in the shutdown procedure.  It's as if the FUSE thread shuts down before the unmount is complete.

This bug is also reproducible on 11.3-RELEASE-p1, so the bug lies in lklfuse, and not the new fusefs(5) driver.
Comment 1 Alan Somers freebsd_committer freebsd_triage 2019-08-14 20:38:35 UTC
Sorry: i renamed the wrong bug.
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-02-04 00:09:58 UTC
Reproducible with more recent CURRENT?
Comment 3 Alan Somers freebsd_committer freebsd_triage 2022-02-04 00:20:41 UTC
Yes, still reproducible on a CURRENT built from 19-Jan.