micro-editor / micro-editor/micro

Panic: runtime error: invalid memory address or nil pointer dereference

Open
#1,011 0 comments 0 reactions 0 assignees View on GitHub

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

Some sort of race condition or some other weirdness involving tcell makes it so that micro will sometimes crash after resuming from a suspended state. I've mapped ctrl+z to the Suspend action and use it to suspend my text editors often. After switching to micro, sometimes the following occurs:

bug3

  1. Start micro
  2. Type something (or not)
  3. Suspend micro
  4. Do something random
  5. Bring micro back to the foreground
  6. Sometimes the error occurs, sometimes it resumes successfully (in which case, repeat from 2)
[1]  + 8807 continued  micro testfile
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4c pc=0x20b2fc]

goroutine 9 [running]:
github.com/zyedidia/micro/cmd/micro/vendor/github.com/zyedidia/tcell.(*tScreen).PollEvent(0x0, 0x10f7bfe4, 0x0)
        /home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/vendor/github.com/zyedidia/tcell/tscreen.go:801 +0x14
main.main.func5()
        /home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/micro.go:454 +0x34
created by main.main
        /home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/micro.go:451 +0x1458

Specifications

Commit hash: af520cf (1.4.0)
OS: Windows (using WSL)
Terminal: Hyper

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the goroutine launched in cmd/micro/micro.go around lines 451-454 and inspect the tcell PollEvent call in vendor/github.com/zyedidia/tcell/tscreen.go:801. Reproduce the ctrl+z suspend-and-resume sequence under the reported WSL and Hyper setup; done means micro resumes without the nil-pointer panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.