-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
Description
This fix allows the current tab to be the one targeted by typing and commands: limetext/lime-qml@5416f3b
After that commit, it is now possible to crash lime-qml by opening a file, closing an older one and typing in it. It looks like the backend is destroying a buffer it shouldn't when the close command is issued.
Steps to reproduce:
- Run lime-qml
- Use File ->Open File... to open a file
- Click on the first "untitled" tab
- Click File -> CloseFile
- Type in the newly opened file
[07/25/16 11:07:49] [DEBG] frontend.HandleInput: text=a, key=41, modifiers=0
[07/25/16 11:07:49] [EROR] Panic in RunTextCommand: runtime error: invalid memory address or nil pointer dereference
View{id:10, buffer: %!s(<nil>)} "insert" backend.Args{"characters":"a"}
/home/matt/work/src/github.com/limetext/backend/commandhandler.go:123 (0x5178b5)
(*commandHandler).RunTextCommand.func1: log.Error("Panic in RunTextCommand: %v\n%v %#v %#v\n%s", r, view, name, args, string(debug.Stack()))
/home/matt/opt/go/src/runtime/asm_amd64.s:437 (0x4bd0ce)
call32: CALLFN(·call32, 32)
/home/matt/opt/go/src/runtime/panic.go:423 (0x48d709)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/home/matt/opt/go/src/runtime/panic.go:42 (0x48bdc9)
panicmem: panic(memoryError)
/home/matt/opt/go/src/runtime/sigpanic_unix.go:24 (0x4a246a)
sigpanic: panicmem()
/home/matt/work/src/github.com/limetext/backend/view.go:989 (0x514bd4)
(*View).ChangeCount: return v.buffer.ChangeCount()
/home/matt/work/src/github.com/limetext/backend/edit.go:34 (0x4fd090)
newEdit: savedCount: v.ChangeCount(),
/home/matt/work/src/github.com/limetext/backend/view.go:395 (0x50e615)
(*View).BeginEdit: e := newEdit(v)
/home/matt/work/src/github.com/limetext/backend/view.go:605 (0x51166d)
(*View).runCommand: e := v.BeginEdit()
/home/matt/work/src/github.com/limetext/backend/commandhandler.go:139 (0x4fb1db)
(*commandHandler).RunTextCommand: } else if err := view.runCommand(c, name); err != nil {
/home/matt/work/src/github.com/limetext/backend/editor.go:337 (0x518fda)
(*Editor).inputthread.func1: if err := e.CommandHandler().RunTextCommand(v, "insert", Args{"characters": kp.Text}); err != nil {
/home/matt/work/src/github.com/limetext/backend/editor.go:344 (0x5026e1)
(*Editor).inputthread: doinput(kp)
/home/matt/opt/go/src/runtime/asm_amd64.s:1721 (0x4bf421)
goexit: BYTE $0x90 // NOP