~taiite/public-inbox

1

[BUG] senpai: `panic: runtime error: slice bounds out of range`

Details
Message ID
<68edb2195a60dd6eed684df796538020239a4bca@disroot.org>
DKIM signature
missing
Download raw message
When I hit ^C a couple of times with a long message typed in (in the hope that it would discard the message, like in a shell), senpai panicked:

---
[I] /home/paren
ʃ senpai
panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
git.sr.ht/~taiite/senpai/ui.(*Editor).RemRune(0xc00000c2a8)
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/ui/editor.go:128 +0x106
git.sr.ht/~taiite/senpai/ui.(*UI).InputBackspace(...)
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/ui/ui.go:369
git.sr.ht/~taiite/senpai.(*App).handleKeyEvent(0xc0000016c0, 0x0)
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/app.go:565 +0xba5
git.sr.ht/~taiite/senpai.(*App).handleUIEvent(0xc000a7fb00, {0x6791c0, 0xc0001936c0})
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/app.go:424 +0x1bc
git.sr.ht/~taiite/senpai.(*App).handleEvent(0xc00000c1e0, {{0x6f6224, 0x64}, {0x6791c0, 0xc0001936c0}})
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/app.go:255 +0x3e
git.sr.ht/~taiite/senpai.(*App).eventLoop(0xc0000016c0)
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/app.go:204 +0x13a
git.sr.ht/~taiite/senpai.(*App).Run(0xc0000016c0)
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/app.go:177 +0x139
main.main()
	/tmp/guix-build-senpai-0.0.0-1.859b8fd.drv-0/src/git.sr.ht/~taiite/senpai/cmd/senpai/main.go:60 +0x59c
---

(The /tmp/guix-build-senpai is presumably because I'm using Guix and it's storing the location of the temporary build environment in the debug information.)

I cannot reproduce this issue, but it certainly exists (as the error message attests.) Hopefully it'll be helpful in finding the actual cause :)
Details
Message ID
<f1b1e9bf4862487b6753a5b2bd81c547@dille.cc>
In-Reply-To
<68edb2195a60dd6eed684df796538020239a4bca@disroot.org> (view parent)
DKIM signature
missing
Download raw message
Hi,

> I cannot reproduce this issue, but it certainly exists (as the error
> message attests.) Hopefully it'll be helpful in finding the actual
> cause :)

Thanks for sending me a panic trace! I just pushed a fix.

To git.sr.ht:~taiite/senpai
    7a9fe74..1c5d730  master -> master

The issue was actually related to backsearch (Ctrl+R) and backspace, not 
to Ctrl+C.

Cheers.
Reply to thread Export thread (mbox)