panic: WARNING: circular locking detected: tmpfs.inodeMutex -> mm.mappingRWMutex: goroutine 1239 [running]: gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc0002db8e0, 0xc00157a918) bazel-out/k8-fastbuild/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x326 gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc0002db560, 0xc0002db8c0, {0xc001cab348, 0x1, 0x1}) pkg/sync/locking/lockdep.go:112 +0x505 gvisor.dev/gvisor/pkg/sync/locking.checkLock.func1(0xc0002db8c0, 0xc00157aaa8?) pkg/sync/locking/lockdep.go:115 +0x74 gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc0002db850, 0xc00157ab58) bazel-out/k8-fastbuild/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x326 gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc0002db560, 0xc0002db830, {0x0, 0x0, 0x0}) pkg/sync/locking/lockdep.go:112 +0x505 gvisor.dev/gvisor/pkg/sync/locking.AddGLock(0xc0002db560, 0xffffffffffffffff) pkg/sync/locking/lockdep.go:144 +0x390 gvisor.dev/gvisor/pkg/sentry/mm.(*mappingRWMutex).RLock(0xc00145805c) bazel-out/k8-fastbuild/bin/pkg/sentry/mm/mapping_mutex.go:59 +0x4d gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).withInternalMappings(0xc001458008, {0x2061a40, 0xc001453208}, {0x485195?, 0x2cc05a8?}, {0x1?, 0x0?, 0x0?}, 0x0, 0xc00157b080) pkg/sentry/mm/io.go:544 +0x145 gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).withVecInternalMappings(0xc001458008, {0x2061a40, 0xc001453208}, {0x0?, 0x0?, 0x0?, 0xc000a5cdc8?}, {0x1, 0x0, 0x0}, ...) pkg/sentry/mm/io.go:606 +0x8ae gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).CopyInTo(0xc001458008, {0x2061a40, 0xc001453208}, {0x0?, 0x4?, 0x484ca9?, 0xc00157b130?}, {0x203e3e0, 0xc000a5cdc8}, {0x0, ...}) pkg/sentry/mm/io.go:324 +0x2f0 gvisor.dev/gvisor/pkg/usermem.IOSequence.CopyInTo({{0x20586d8, 0xc001458008}, {0x0, 0x1, 0x7f2593200000, 0x2000}, {0x0, 0x1}}, {0x2061a40, 0xc001453208}, ...) pkg/usermem/usermem.go:516 +0xcf gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*regularFileFD).pwrite(0xc000b37e00, {0x2061a40, 0xc001453208}, {{0x20586d8, 0xc001458008}, {0x0, 0x1, 0x7f2593200000, 0x2000}, {0x0, ...}}, ...) pkg/sentry/fsimpl/tmpfs/regular_file.go:553 +0x91b gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*regularFileFD).Write(0xc000b37e00, {0x2061a40, 0xc001453208}, {{0x20586d8, 0xc001458008}, {0x0, 0x1, 0x7f2593200000, 0x2000}, {0x0, ...}}, ...) pkg/sentry/fsimpl/tmpfs/regular_file.go:570 +0x12a gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).Write(0xc000b37e00, {0x2061a40, 0xc001453208}, {{0x20586d8, 0xc001458008}, {0x0, 0x1, 0x7f2593200000, 0x2000}, {0x0, ...}}, ...) pkg/sentry/vfs/file_description.go:679 +0x145 gvisor.dev/gvisor/pkg/sentry/syscalls/linux.write(0xc001453208, 0xc000b37e00, {{0x20586d8, 0xc001458008}, {0x0, 0x1, 0x7f2593200000, 0x2000}, {0x0, 0x1}}, ...) pkg/sentry/syscalls/linux/sys_read_write.go:347 +0xa5 gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Write(0xc001453208, 0x0?, {{0x5}, {0x7f2593200000}, {0x2000}, {0xc4}, {0x0}, {0x171}}) pkg/sentry/syscalls/linux/sys_read_write.go:316 +0x38f gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc001453208, 0x1, {{0x5}, {0x7f2593200000}, {0x2000}, {0xc4}, {0x0}, {0x171}}) pkg/sentry/kernel/task_syscall.go:143 +0xb9f gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc001453208, 0x1, {{0x5}, {0x7f2593200000}, {0x2000}, {0xc4}, {0x0}, {0x171}}) pkg/sentry/kernel/task_syscall.go:323 +0x85 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc001453208, 0x1, {{0x5}, {0x7f2593200000}, {0x2000}, {0xc4}, {0x0}, {0x171}}) pkg/sentry/kernel/task_syscall.go:283 +0xc7 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc001453208) pkg/sentry/kernel/task_syscall.go:258 +0x54a gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc001453208?, 0xc001453208) pkg/sentry/kernel/task_run.go:269 +0x2295 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc001453208, 0x89) pkg/sentry/kernel/task_run.go:97 +0x41b created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start in goroutine 942 pkg/sentry/kernel/task_start.go:400 +0x185 known lock chain: mm.mappingRWMutex -> tmpfs.filesystemRWMutex -> tmpfs.iterMutex -> tmpfs.inodeMutex ====== mm.mappingRWMutex -> tmpfs.filesystemRWMutex ===== goroutine 789 [running]: gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*filesystemRWMutex).RLock(0xc0006dec98) bazel-out/k8-fastbuild/bin/pkg/sentry/fsimpl/tmpfs/filesystem_mutex.go:59 +0x4d gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*filesystem).StatAt(0xc0006dec30, {0x2061bf0, 0xc000a50750}, 0xc0008f2488, {0x1421128?, 0x30000000?}) pkg/sentry/fsimpl/tmpfs/filesystem.go:760 +0xa8 gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).Stat(0xc001186070, {0x2061bf0, 0xc000a50750}, {0x1a6c050?, 0x0?}) pkg/sentry/vfs/file_description.go:540 +0x322 gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DeviceID(0xc001186070) pkg/sentry/vfs/file_description.go:823 +0x65 gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).appendVMAMapsEntryLocked(0x485195?, {0x2061bf0, 0xc000a50750}, {0xc0019cc008?, 0xc000b61368?}, 0xc0019b9780) pkg/sentry/mm/procfs.go:118 +0x19d gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).vmaMapsEntryLocked(0xc001603008, {0x2061bf0, 0xc000a50750}, {0xc0019cc008?, 0x47906e?}) pkg/sentry/mm/procfs.go:104 +0xcf gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).DebugString(0xc001603008, {0x2061bf0, 0xc000a50750}) pkg/sentry/mm/debug.go:49 +0x1a5 gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).String(0xc001603008) pkg/sentry/mm/debug.go:38 +0x45 fmt.(*pp).handleMethods(0xc001420f70, 0x73) bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/stdlib_/src/fmt/print.go:673 +0x6eb fmt.(*pp).printArg(0xc001420f70, {0x1e350e0, 0xc001603008}, 0x73) bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/stdlib_/src/fmt/print.go:756 +0xb4c fmt.(*pp).doPrintf(0xc001420f70, {0xc000544a50, 0x24}, {0xc0019b9710, 0x1, 0x1}) bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/stdlib_/src/fmt/print.go:1074 +0x5d0 fmt.Sprintf({0xc000544a50, 0x24}, {0xc0019b9710, 0x1, 0x1}) bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/stdlib_/src/fmt/print.go:239 +0x5d gvisor.dev/gvisor/pkg/log.GoogleEmitter.Emit({0xc000b61ab0?}, 0x3, 0x2, {0x2cc0160?, 0x1?, 0x2de31c0?}, {0xc000544a50, 0x24}, {0xc0019b9710, 0x1, ...}) pkg/log/glog.go:82 +0x32a gvisor.dev/gvisor/pkg/log.(*BasicLogger).DebugfAtDepth(0xc0001c3680, 0x2, {0xc000544a50, 0x24}, {0xc0019b9710, 0x1, 0x1}) pkg/log/log.go:220 +0x128 gvisor.dev/gvisor/pkg/log.DebugfAtDepth(0x1, {0xc000544a50, 0x24}, {0xc0019b9710, 0x1, 0x1}) pkg/log/log.go:295 +0x72 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Debugf(0xc001612c88, {0x1e48a08, 0xc}, {0xc0019b9710, 0x1, 0x1}) pkg/sentry/kernel/task_log.go:54 +0xcd gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).DebugDumpState(0xc001612c88) pkg/sentry/kernel/task_log.go:71 +0x11c gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc001612c88?, 0xc001612c88) pkg/sentry/kernel/task_run.go:313 +0x2025 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc001612c88, 0x3d) pkg/sentry/kernel/task_run.go:97 +0x41b created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start in goroutine 457 pkg/sentry/kernel/task_start.go:400 +0x185 ====== tmpfs.filesystemRWMutex -> tmpfs.iterMutex ===== goroutine 1 [running]: gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*iterMutex).Lock(0xc0006e77e0) bazel-out/k8-fastbuild/bin/pkg/sentry/fsimpl/tmpfs/iter_mutex.go:33 +0x4d gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*directory).insertChildLocked(0xc0006e7408, 0xc000260c30, {0x1e3feef, 0x2}) pkg/sentry/fsimpl/tmpfs/directory.go:69 +0x1c5 gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*filesystem).SymlinkAt.func1(0xc0006e7408, {0x1e3feef, 0x2}) pkg/sentry/fsimpl/tmpfs/filesystem.go:794 +0x159 gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*filesystem).doCreateAt(0xc0006dec30, {0x2061d10, 0xc000c24100}, 0xc00052c908, 0x0, 0xc00075fc68) pkg/sentry/fsimpl/tmpfs/filesystem.go:210 +0x584 gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*filesystem).SymlinkAt(0xc0006dec30, {0x2061d10, 0xc000c24100}, 0xc00052c908, {0x1e49b75, 0xd}) pkg/sentry/fsimpl/tmpfs/filesystem.go:783 +0xf3 gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).SymlinkAt(0xc0002771e0, {0x2061d10, 0xc000c24100}, 0xc0003bb080, 0xc000260be0, {0x1e49b75, 0xd}) pkg/sentry/vfs/vfs.go:695 +0x303 gvisor.dev/gvisor/pkg/sentry/fsimpl/dev.userspaceInit({0x2061d10, 0xc000c24100}, 0xc0002771e0, 0xc0003bb080, {0xc000242f20?, 0xc0006e7408?}, 0x0) pkg/sentry/fsimpl/dev/dev.go:164 +0x33e gvisor.dev/gvisor/pkg/sentry/fsimpl/dev.FilesystemType.GetFilesystem({}, {0x2061d10, 0xc000c24100}, 0xc0002771e0, 0xc0003bb080, {0x0, 0x0}, {0x1, {0x0, 0x0}, ...}) pkg/sentry/fsimpl/dev/dev.go:60 +0x36e gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).NewFilesystem(0xc0002771e0, {0x2061d10, 0xc000c24100}, 0xc0003bb080, {0x0, 0x0}, {0x1e4017d, 0x3}, 0xc0006e13c0) pkg/sentry/vfs/mount.go:252 +0x1d4 gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).MountDisconnected(0xc0002771e0, {0x2061d10, 0xc000c24100}, 0xc0003bb080, {0x0, 0x0}, {0x1e4017d, 0x3}, 0xc0006e13c0) pkg/sentry/vfs/mount.go:271 +0xc5 gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).MountAt(0xc0002771e0, {0x2061d10, 0xc000c24100}, 0xc0003bb080, {0x0, 0x0}, 0xc000760520, {0x1e4017d, 0x3}, 0xc0006e13c0) pkg/sentry/vfs/mount.go:632 +0xe5 gvisor.dev/gvisor/runsc/boot.(*containerMounter).mountSubmount(0xc000c1e750, {0x2061d10, 0xc000c24100}, 0xc0002da750, 0xc0003ea008, 0xc000c08ff0, 0xc0003bb080, 0xc00089e0c8) runsc/boot/vfs.go:850 +0xb52 gvisor.dev/gvisor/runsc/boot.(*containerMounter).mountSubmounts(0xc000c1e750, {0x2061d10, 0xc000c24100}, 0xc0002da750, 0xc0003ea008, 0xc000c08ff0, 0xc0003bb080) runsc/boot/vfs.go:739 +0x9ed gvisor.dev/gvisor/runsc/boot.(*containerMounter).mountAll(0xc000c1e750, {0x2061d10, 0xc000c24100}, 0xc0003bb080, 0xc0002da750, 0xc0003ea008, 0xc000c1e820) runsc/boot/vfs.go:468 +0x585 gvisor.dev/gvisor/runsc/boot.setupContainerVFS({0x2061d10, 0xc000a42080}, 0xc000262f18, 0xc000c1e750, 0xc000262f48) runsc/boot/vfs.go:177 +0x2ce gvisor.dev/gvisor/runsc/boot.(*Loader).createContainerProcess(0xc000262f08, 0xc000262f18) runsc/boot/loader.go:1159 +0xb1b gvisor.dev/gvisor/runsc/boot.(*Loader).run(0xc000262f08) runsc/boot/loader.go:917 +0x372 gvisor.dev/gvisor/runsc/boot.(*Loader).Run(0xc000262f08) runsc/boot/loader.go:865 +0x2f gvisor.dev/gvisor/runsc/cmd.(*Boot).Execute(0xc00052ba40, {0xc0002260f0?, 0x11?}, 0xc0003f8000, {0xc000264060, 0x2, 0xc000264060?}) runsc/cmd/boot.go:564 +0x3525 github.com/google/subcommands.(*Commander).Execute(0xc000250000, {0x2051310, 0x3d43c60}, {0xc000264060, 0x2, 0x2}) external/com_github_google_subcommands/subcommands.go:200 +0x684 github.com/google/subcommands.Execute(...) external/com_github_google_subcommands/subcommands.go:481 gvisor.dev/gvisor/runsc/cli.Main() runsc/cli/main.go:216 +0x210f main.main() runsc/main.go:31 +0x1d ====== tmpfs.iterMutex -> tmpfs.inodeMutex ===== goroutine 283 [running]: gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*inodeMutex).Lock(0xc001171088) bazel-out/k8-fastbuild/bin/pkg/sentry/fsimpl/tmpfs/inode_mutex.go:33 +0x4d gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*inode).touchAtime(0xc001171058, 0xc00102edc0) pkg/sentry/fsimpl/tmpfs/tmpfs.go:807 +0x168 gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.(*directoryFD).IterDirents(0xc0007d4e00, {0x485195?, 0x2c90a14?}, {0x203d1e0, 0xc001196280}) pkg/sentry/fsimpl/tmpfs/directory.go:125 +0x24b gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).IterDirents(0xc0007d4e00, {0x2061a40, 0xc000755908}, {0x203d1e0, 0xc001196280}) pkg/sentry/vfs/file_description.go:691 +0x17f gvisor.dev/gvisor/pkg/sentry/syscalls/linux.getdents(0xc000755908, {{0x3}, {0x5631be3ca4a0}, {0x8000}, {0x1000}, {0x33606e9c}, {0xa}}, 0x1) pkg/sentry/syscalls/linux/sys_getdents.go:69 +0x29c gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Getdents64(0xc000755908, 0x0?, {{0x3}, {0x5631be3ca4a0}, {0x8000}, {0x1000}, {0x33606e9c}, {0xa}}) pkg/sentry/syscalls/linux/sys_getdents.go:36 +0x6b gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc000755908, 0xd9, {{0x3}, {0x5631be3ca4a0}, {0x8000}, {0x1000}, {0x33606e9c}, {0xa}}) pkg/sentry/kernel/task_syscall.go:143 +0xb9f gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc000755908, 0xd9, {{0x3}, {0x5631be3ca4a0}, {0x8000}, {0x1000}, {0x33606e9c}, {0xa}}) pkg/sentry/kernel/task_syscall.go:323 +0x85 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc000755908, 0xd9, {{0x3}, {0x5631be3ca4a0}, {0x8000}, {0x1000}, {0x33606e9c}, {0xa}}) pkg/sentry/kernel/task_syscall.go:283 +0xc7 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc000755908) pkg/sentry/kernel/task_syscall.go:258 +0x54a gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc000755908?, 0xc000755908) pkg/sentry/kernel/task_run.go:269 +0x2295 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc000755908, 0xa) pkg/sentry/kernel/task_run.go:97 +0x41b created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start in goroutine 308 pkg/sentry/kernel/task_start.go:400 +0x185