keybase / keybase/client

KBFS crashes with invalid memory address or nil pointer dereference

Open
#19,151 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

my log id: d9c9d1b8ea04ee5b0984341c

I recently made some membership changes in a team and KBFS stopped working.
I tried to restart keybase a few times

```
keybase fs ls /keybase
▶ ERROR Keybase services aren't running - KBFS client not found.
```

```
KBFS:
status: not running
version: 4.3.2-20190819174353+b1c5c7c912
installed: 4.3.2-20190819174353+b1c5c7c912
log: /Users/mkm/Library/Logs/keybase.kbfs.log
mount:
```

Excerpt from kbfs log:

```
...
2019-08-27T11:54:58.605535+02:00 ▶ [INFO kbfs mount_interrupter.go:56] 084 Mounting the filesystem was a success
2019-08-27T11:54:58.605896+02:00 ▶ [DEBU kbfs start.go:53] 085 Creating filesystem
2019-08-27T11:54:58.606232+02:00 ▶ [DEBU kbfs start.go:81] 086 Serving filesystem
2019-08-27T11:54:58.612890+02:00 ▶ [DEBU kbfs start.go:76] 093 Mount ready
...
2019-08-27T11:54:58.890683+02:00 ▶ [DEBU kbfs md_ops.go:917] 096 GetForHandle: /keybase/public/mkm merged
...
2019-08-27T11:54:59.380638+02:00 ▶ [INFO kbfs mdserver_remote.go:295] 0b7 authentication successful; ping interval: 30s
...
2019-08-27T11:54:59.552657+02:00 ▶ [DEBU kbfs mdserver_remote.go:315] 0bd requested list of folders for rekey
...
2019-08-27T11:54:59.580613+02:00 ▶ [DEBU kbfs(kbfsfuse) fs.go:355] 0c4 User changed: "" -> "mkm"
2019-08-27T11:54:59.580656+02:00 ▶ [DEBU kbfs kbfs_ops.go:249] 0c5 Forcing fast-forwards for 0 folders
2019-08-27T11:54:59.580674+02:00 ▶ [DEBU kbfs kbfs_ops.go:249] 0c6 Forcing fast-forwards for 0 folders
...
2019-08-27T11:55:01.468445+02:00 ▶ [DEBU kbfs(FBO cba4bc48) folder_branch_ops.go:7791] 0de [duration=159.734657ms] Registering for updates (curr rev = 308, fire now = true) done: [tags:FBOID=3UVzsv2XZ13qQgG74UHc6Q]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x4d6872f]

goroutine 673 [running]:
github.com/keybase/client/go/kbfs/libkbfs.(*nodeCacheStandard).PathFromNode(0xc422aab920, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/build/go/src/github.com/keybase/client/go/kbfs/libkbfs/node_cache.go:352 +0xaf
github.com/keybase/client/go/kbfs/libkbfs.(*folderBranchOps).syncOneNode(0xc4201c6f00, 0x56f4d00, 0xc4219f48c0, 0x0, 0x0, 0xc422b29680, 0xc421897a70, 0x21, 0xc422b22370, 0x46, ...)
/Users/build/go/src/github.com/keybase/client/go/kbfs/libkbfs/folder_branch_ops.go:1047 +0x9a
github.com/keybase/client/go/kbfs/libkbfs.(*folderBranchOps).doPartialSync(0xc4201c6f00, 0x56f4d00, 0xc4219f48c0, 0x0, 0xc4218e2ab0, 0x1, 0x1, 0xc422b29680, 0xc421897a70, 0x21, ...)
/Users/build/go/src/github.com/keybase/client/go/kbfs/libkbfs/folder_branch_ops.go:1183 +0x63d
github.com/keybase/client/go/kbfs/libkbfs.(*folderBranchOps).kickOffPartialSync.func1()
/Users/build/go/src/github.com/keybase/client/go/kbfs/libkbfs/folder_branch_ops.go:1245 +0x12a
github.com/keybase/client/go/kbfs/libkbfs.(*folderBranchOps).goTracked.func1(0xc4201c6f00, 0xc4229670e0)
/Users/build/go/src/github.com/keybase/client/go/kbfs/libkbfs/folder_branch_ops.go:518 +0x55
created by github.com/keybase/client/go/kbfs/libkbfs.(*folderBranchOps).goTracked
/Users/build/go/src/github.com/keybase/client/go/kbfs/libkbfs/folder_branch_ops.go:516 +0x69
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the panic in go/kbfs/libkbfs/node_cache.go:352, then trace the callers in folder_branch_ops.go at lines 1047, 1183, and 1245. Use the supplied KBFS log and stack trace to understand the nil node path; done means the reported membership-change scenario no longer crashes KBFS.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.