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

Crash due to index out of range while writing to data file #265

Open
fhs opened this issue Jul 27, 2019 · 2 comments
Open

Crash due to index out of range while writing to data file #265

fhs opened this issue Jul 27, 2019 · 2 comments

Comments

@fhs
Copy link
Contributor

fhs commented Jul 27, 2019

Edwood crashed while doing a Put on a .go file. Most likely the crash happened when Put triggered acme-lsp to format the .go file and show diagnostics.

panic: runtime error: index out of range [5] with length 5

goroutine 199 [running]:
panic(0x8f4fa0, 0xc00028cae0)
	/home/big/go/src/runtime/panic.go:722 +0x2c2 fp=0xc0004a9b20 sp=0xc0004a9a90 pc=0x430902
runtime.goPanicIndex(0x5, 0x5)
	/home/big/go/src/runtime/panic.go:75 +0xa3 fp=0xc0004a9b68 sp=0xc0004a9b20 pc=0x42ee83
main.(*Column).Grow(0xc0000bc840, 0xc0001eec00, 0x1)
	/home/fhs/go/pkg/mod/github.com/rjkroege/[email protected]/col.go:488 +0x114c fp=0xc0004a9cf0 sp=0xc0004a9b68 pc=0x7f3d2c
main.(*Text).Show(0xc0001eed18, 0x0, 0x0, 0x0)
	/home/fhs/go/pkg/mod/github.com/rjkroege/[email protected]/text.go:1222 +0x39c fp=0xc0004a9d70 sp=0xc0004a9cf0 pc=0x81fd4c
main.xfidwrite(0xc0000bcb00)
	/home/fhs/go/pkg/mod/github.com/rjkroege/[email protected]/xfid.go:577 +0xa6e fp=0xc0004a9f88 sp=0xc0004a9d70 pc=0x82b21e
main.xfidctl(0xc0000bcb00, 0x9e5960, 0xc0000f60d0)
	/home/fhs/go/pkg/mod/github.com/rjkroege/[email protected]/xfid.go:52 +0x9c fp=0xc0004a9fc8 sp=0xc0004a9f88 pc=0x8286cc
runtime.goexit()
	/home/big/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc0004a9fd0 sp=0xc0004a9fc8 pc=0x460911
created by main.xfidallocthread
	/home/fhs/go/pkg/mod/github.com/rjkroege/[email protected]/acme.go:624 +0x1d4

Full stack trace: edwood_crash.txt

@fhs
Copy link
Contributor Author

fhs commented Aug 4, 2019

I can reproduce this after putting a 5 seconds sleep before the loop where we're getting the "index out of range" panic in Column.Grow. Follow these steps to reproduce:

  1. Open acme with only one column.
  2. Open few windows. Let's call the topmost window T. Make sure nothing in the window body is showing (t.fr.GetFrameFillStatus().Maxlines == 0).
  3. This will trigger xfidwrite to call Text.Show, which will call Column.Grow:
echo -n '#0' | 9p write acme/T/addr
echo hello | 9p write acme/T/data
  1. Before the 5 seconds expire, create a new window with B some_file_not_open_yet. The crash will happen when the 5 seconds expire.

Basically, the crash is happening when we create a new window in a column while we're growing another window within the same column.

@rjkroege
Copy link
Owner

This seems similar to #57? Column changes while a window is being written to over the file system is suspect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants