Skip to content

QuitAll crashes micro #4131

Description

@Neko-Box-Coder

Description

When you have a file open, performing QuitAll crashes micro with a segfault.

Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:336 (0x48b8d8)
runtime/panic.go:335 (0x48b8a6)
github.com/micro-editor/micro/v2/internal/buffer/buffer.go:691 (0x883dd4)
github.com/micro-editor/micro/v2/internal/buffer/buffer.go:690 (0x883daf)
github.com/micro-editor/micro/v2/internal/buffer/buffer.go:506 (0x8e6f78)
github.com/micro-editor/micro/v2/internal/buffer/buffer.go:504 (0x8e6f33)
github.com/micro-editor/micro/v2/internal/action/actions.go:1969 (0x8cc4b7)
github.com/micro-editor/micro/v2/internal/action/bufpane.go:567 (0x8d3ecd)
github.com/micro-editor/micro/v2/internal/action/tab.go:224 (0x8d22a6)
github.com/micro-editor/micro/v2/internal/action/bufpane.go:183 (0x8d20d9)
github.com/micro-editor/micro/v2/internal/action/bufpane.go:33 (0x8d2071)
github.com/micro-editor/micro/v2/internal/action/bufpane.go:546 (0x8d3c39)
github.com/micro-editor/micro/v2/internal/action/bufpane.go:464 (0x8d3729)
github.com/micro-editor/micro/v2/internal/action/tab.go:337 (0x8e5105)
github.com/micro-editor/micro/v2/internal/action/tab.go:141 (0x8e4245)
github.com/micro-editor/micro/v2/cmd/micro/micro.go:543 (0x90f72a)
github.com/micro-editor/micro/v2/cmd/micro/micro.go:482 (0x90f27b)
internal/runtime/atomic/types.go:194 (0x453c75)
runtime/asm_amd64.s:1771 (0x490f01)

If you can reproduce this error, please report it at https://github.com/micro-editor/micro/issues
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x90e61f]

Doing some quick bisecting reveals that the commit ef57bdc from #3997 had introduced this regression.

Adding QuitAll to a keybind and running that on any opened file will trigger this behavior.

@JoeKar

Environment

  • Version: master
  • OS: Linux
  • Terminal: WezTerm

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions