Opened 9 months ago

Closed 5 weeks ago

#18849 closed bug (duplicate)

vfs refcount bug around shared_memory

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: - General Version: R1/beta4
Keywords: Cc:
Blocked By: #18805 Blocking:
Platform: All

Description (last modified by kallisti5)

Running a build of tcl on riscv64, I keep getting hung unmounts from haikuporter.

Looking through syslog, noticing a repeating:

fs_unmount(): inode 1 is still referenced

a quick search shows that /boot/system/var/shared_memory is inode 1.

looking over fdinfo, and the matching output from haikuporter, nothing seems to have anything related to any shared_memory paths open. In addition to that, nothing in any work-* directories is open.

waddlesplash pointed out this may be a regression (or an additional symptom of #18805)

riscv64 image running in qemu. hrev57641

Attachments (1)

haikuporter.png (100.2 KB ) - added by kallisti5 9 months ago.
fdinfo during event

Download all attachments as: .zip

Change History (8)

comment:1 by kallisti5, 9 months ago

Description: modified (diff)

by kallisti5, 9 months ago

Attachment: haikuporter.png added

fdinfo during event

comment:2 by kallisti5, 9 months ago

if that last number in fdinfo is the inode, 89 is /boot/system/bin/bzless, 158 is /boot/system/apps/Pe/Languages/RecipeExt.

comment:3 by kallisti5, 9 months ago

Just ran into it again building python.

~/haikuporter> df -h
 Type      Total     Free      Flags   Device                   Mounted on
--------- --------- --------- ------- ------------------------ -----------------
bfs        15.0 GiB   9.0 GiB QAM-P-W /dev/disk/virtual/virtio_block/0/1 /boot             
packagefs         0         0 QAM-P--                          /boot/system      
packagefs         0         0 QAM-P--                          /boot/home/config 
packagefs         0         0 QAM-P--                          /boot/home/haikuports/dev-lang/python/work-3.12.2/boot/system 


syslog:
KERN: fs_unmount(): inode 49 is still referenced

~> find /boot/system -inum 49
/boot/system/apps/Pe/Languages/JavaExt

~/haikuporter> unmount /boot/home/haikuports/dev-lang/python/work-3.12.2/boot/system
unmount: unmounting failed: Device/File/Resource busy

~/haikuporter> fdinfo | grep :49
Team: (25342) /bin/grep --color=auto :49

~/haikuporter> fdinfo | grep Java
Team: (25345) /bin/grep --color=auto Java

Last edited 9 months ago by kallisti5 (previous) (diff)

comment:4 by kallisti5, 9 months ago

hm. waddlesplash mentioned refcounts getting out of sync. Looking at this makes me suspect that refcounts are getting mixed up between the filesystems...

~/haikuporter> unmount /boot/system
unmount: unmounting failed: Device/File/Resource busy

~/haikuporter> unmount /boot/home/haikuports/dev-lang/python/work-3.12.2/boot/system
unmount: unmounting failed: Device/File/Resource busy

(obviously the first one is correct, but the second one is not)

comment:5 by waddlesplash, 9 months ago

Blocked By: 18805 added
Blocking: 18805 removed

comment:6 by pulkomandy, 9 months ago

Inode 1 is the root of any filesystem. So, you found the root of the shared_memory, but I think the message in the log is about the root of the packagefs mounted by haikuporter

Also, you are trying to lookup the inodes in /boot/system, that is not correct, you have to search for them in the filesystem that can't be unmounted (in this case, the haikuports packagefs in the work directory). Otherwise you don't get the right files.

comment:7 by waddlesplash, 5 weeks ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.