Crash after Ctrl-S, Ctrl-C
firelizzard18 opened this issue · comments
Ethan Reesor commented
Given this program:
package main
import (
"fmt"
"log"
"github.com/chzyer/readline"
)
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
rl, err := readline.New("> ")
if err != nil {
log.Fatal(err)
}
line, err := rl.Readline()
if err != nil {
log.Fatal(err)
}
fmt.Println(line)
}
Typing Ctrl-S
followed by Ctrl-C
will cause:
> panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x10b8912]
goroutine 35 [running]:
github.com/chzyer/readline.(*opSearch).ExitSearchMode(0xc0000c4080, 0xc000106101)
/XXX/pkg/mod/github.com/chzyer/readline@v0.0.0-20180603132655-2972be24d48e/search.go:118 +0x52
github.com/chzyer/readline.(*Operation).ioloop(0xc0000d4000)
/XXX/pkg/mod/github.com/chzyer/readline@v0.0.0-20180603132655-2972be24d48e/operation.go:302 +0x935
created by github.com/chzyer/readline.NewOperation
/XXX/pkg/mod/github.com/chzyer/readline@v0.0.0-20180603132655-2972be24d48e/operation.go:88 +0x2b1
exit status 2
Andrey Petrov commented
FWIW just tried this, but wasn't able to reproduce with the latest master.
unkn0wnsyst3m commented
reproduced in win11