micro-editor / micro-editor/micro
Runtime error after answering “yes” to save with sudo
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
Description of the problem or steps to reproduce
- Open a file you don’t have write permission to
- Try to save the file
- Answer “y” to the prompt:
Permission denied. Do you want to save this file using sudo? - The program crashes and prints a message like this:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x4c pc=0x236db8]
goroutine 20 [running]:
panic(0x5c0880, 0x10b26030)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x330
github.com/zyedidia/micro/cmd/micro/vendor/github.com/zyedidia/tcell.(*tScreen).PollEvent(0x0, 0x0, 0x0)
/build/b68dc646faa0c5dccca78d8c5d88c0fa-xenial/parts/micro/go/src/github.com/zyedidia/micro/cmd/micro/vendor/github.com/zyedidia/tcell/tscreen.go:801 +0x20
main.main.func5()
/build/b68dc646faa0c5dccca78d8c5d88c0fa-xenial/parts/micro/go/src/github.com/zyedidia/micro/cmd/micro/micro.go:454 +0x3c
created by main.main
/build/b68dc646faa0c5dccca78d8c5d88c0fa-xenial/parts/micro/go/src/github.com/zyedidia/micro/cmd/micro/micro.go:457 +0x2400
The crash only occurs sometimes. I have not been able to pinpoint the cause.
I’m using micro over SSH.
Specifications
Micro version: 1.4.0 (commit af520cf), installed via snap
OS: Raspbian 9.8 Stretch (Linux 4.14.98-v7+)
Hardware: Raspberry Pi 3B (revision 1.2)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in cmd/micro/micro.go around the goroutine at line 454 and inspect the tcell PollEvent call reported in vendor/github.com/zyedidia/tcell/tscreen.go:801. Reproduce the sudo-save flow over SSH, then determine what prevents the nil-pointer panic from recurring and verify the editor remains usable after answering yes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100