micro-editor / micro-editor/micro

Micro encountered an error: runtime error: index out of range cellview.go:17

Open
#1,329 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

Run micro *
Directory contents:

client/
some.conf
first.p12
server/
other.conf
another.conf
second.p12
yetanother.conf

Micro opens, with the first file visible.
Tab bar at the top: [some.conf] first.p12 ...
clicking on the second tab crashes micro with:

[1]root@host# micro *
client is a directory

Press enter to continue
server is a directory

Press enter to continue
Micro encountered an error: runtime error: index out of range
runtime.errorString runtime error: index out of range
/home/zbyedidia/go/src/runtime/panic.go:491 (0x42bbc3)
/home/zbyedidia/go/src/runtime/panic.go:28 (0x42a89e)
/home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/cellview.go:171 (0x8b113f)
/home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/view.go:843 (0x913e15)
/home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/view.go:1097 (0x916469)
/home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/micro.go:240 (0x8d63c6)
/home/zbyedidia/gopath/src/github.com/zyedidia/micro/cmd/micro/micro.go:491 (0x8d7f3a)
/home/zbyedidia/go/src/runtime/proc.go:185 (0x42d9cd)
/home/zbyedidia/go/src/runtime/asm_amd64.s:2337 (0x45acc1)

[1]root@host# @:!#:!

⚠️ Notice the garbage @:!#:! on the shell

Specifications

Commit hash: 1856891

$ uname -a
Linux hostname 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)

Terminal: Windows 10, Xshell 6 SSH -> bash

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 crash by running micro * with the listed mix of directories and files, then selecting the second tab. Start in cmd/micro/cellview.go:171 and follow the calls through view.go and micro.go. Done means the tab can be selected without an index-out-of-range panic and the shell does not receive the garbage @:!#:!.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.