Skip to content

micro crashes when the raw buffer contains more than 1000 lines #2991

@MSDcrafter

Description

@MSDcrafter

Description of the problem or steps to reproduce

micro crashes with an nil pointer dereference, when the raw buffer is opened and filled with more than 1000 lines of events.

max@X2:~/tmp/micro$ ./micro 
Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:220 (0x44ccb6)
runtime/panic.go:219 (0x44cc86)
github.com/zyedidia/micro/v2/internal/action/rawpane.go:37 (0x8a5c93)
github.com/zyedidia/micro/v2/internal/action/tab.go:269 (0x8a744e)
github.com/zyedidia/micro/v2/internal/action/tab.go:139 (0x8a69d6)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:476 (0x8d5fdc)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:394 (0x8d596e)
runtime/proc.go:250 (0x439152)
runtime/asm_amd64.s:1571 (0x467de1)
 
If you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues
max@X2:~/tmp/micro$ 

Steps to reproduce:

  1. open micro
  2. open the raw pane
  3. cause more than 1000 events (scrolling is the easiest method)

Specifications

As far as i can see, this is caused by DoEvent() in cmd/micro/micro.go:476:1 passing along a nil event. And there seems to be a line that checks for this situation at cmd/micro/micro.go:472:1.
However, that line is commented out and since i do now know why it is commented out, i did not want to submit a commit that uncomments it and potentially breaks something.

Commit hash: d8e9d61
OS: Linux Mint 21.1
Terminal: x-terminal-emulator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions