micro-editor / micro-editor/micro

Panic upon opening file with fzf

Open
#1,795 1 comment 3 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

When I use the fzf plugin to open a file, on some files it works fine, while on others it produces a panic. It seems like the code that panics is not in fzf itself. Opening the same file directly (using > open) works fine.

  1. Start micro
  2. > fzf, optionally type a search query, and pick a file
Plugin diff: runtime error: invalid memory address or nil pointer dereference
stack traceback:
        status:41: in function <status:35>
        [G]: in function 'ExecCommand'
        diff:13: in main chunk
        [G]: ?

Press enter to continueMicro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:212 (0x55eab506ea1e)
runtime/panic.go:211 (0x55eab506e86d)
github.com/zyedidia/micro/v2/internal/screen/screen.go:105 (0x55eab550b1fe)
github.com/zyedidia/micro/v2/internal/display/statusline.go:186 (0x55eab556f308)
github.com/zyedidia/micro/v2/internal/display/bufwindow.go:697 (0x55eab556ce04)
github.com/zyedidia/micro/v2/internal/display/bufwindow.go:747 (0x55eab556d07d)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:370 (0x55eab55b7cdd)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:347 (0x55eab55b7ae3)
runtime/proc.go:203 (0x55eab505a972)
runtime/asm_amd64.s:1373 (0x55eab5088d21)

It seems a bit random in terms of which files it will panic on, and it changes between runs of micro. Would this be an instability in fzf, or is this an issue somewhere else which I could help debug?

Specifications

Version: 2.0.6
Commit hash: 60846f54
Compiled on July 03, 2020
OS: Manjaro KDE
Terminal: Konsole

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

Reproduce the panic by starting micro and running > fzf, then inspect the stack locations named in internal/screen/screen.go, internal/display/statusline.go, and internal/display/bufwindow.go. Compare the fzf path with direct > open handling; done means opening files through fzf no longer causes the nil-pointer panic.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.