tulir / gomuks

A Matrix client written in Go.
https://maunium.net/go/gomuks
GNU Affero General Public License v3.0
1.37k stars 123 forks source link

SIGSEGV when searching a chat #418

Closed foxyseta closed 1 week ago

foxyseta commented 1 year ago
$ gomuks --version
gomuks 0.3.0+dev.unknown (unknown)

When using Ctrl+K and then typing to look for a chat, I consistently get:

panic: runtime error: slice bounds out of range [27:25] [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x55d23e6dab65]

goroutine 1 [running]:
go.mau.fi/mauview.(*Application).ForceStop(...)
        go.mau.fi/mauview@v0.2.1/application.go:198
maunium.net/go/gomuks/ui.(*GomuksUI).Finish(0xc000668178?)
        maunium.net/go/gomuks/ui/ui.go:90 +0x25
maunium.net/go/gomuks/debug.Recover()
        maunium.net/go/gomuks/debug/debug.go:104 +0x42
panic({0x55d23eb70880, 0xc0023d3b78})
        runtime/panic.go:884 +0x213
golang.org/x/text/transform.String({0x55d23ebc3b88, 0x55d23f227b20}, {0xc000643d80, 0x19})
        golang.org/x/text@v0.4.0/transform/transform.go:650 +0xbe5
github.com/lithammer/fuzzysearch/fuzzy.stringTransform({0xc000643d80, 0x19}, {0x55d23ebc3b88?, 0x55d23f227b20?})
        github.com/lithammer/fuzzysearch@v1.1.5/fuzzy/fuzzy.go:243 +0x5a
github.com/lithammer/fuzzysearch/fuzzy.match({0xc002478ba8?, 0x3?}, {0xc000643d80, 0x19}, {0x55d23ebc3b88, 0x55d23f227b20})
        github.com/lithammer/fuzzysearch@v1.1.5/fuzzy/fuzzy.go:57 +0x71
github.com/lithammer/fuzzysearch/fuzzy.rankFind({0xc002478ba8, 0x1}, {0xc00046d500?, 0x240, 0x0?}, {0x55d23ebc3b88, 0x55d23f227b20})
        github.com/lithammer/fuzzysearch@v1.1.5/fuzzy/fuzzy.go:200 +0xe5
github.com/lithammer/fuzzysearch/fuzzy.RankFindFold(...)
        github.com/lithammer/fuzzysearch@v1.1.5/fuzzy/fuzzy.go:183
maunium.net/go/gomuks/ui.(*FuzzySearchModal).changeHandler(0xc000fdd480, {0xc002478ba8?, 0x1})
        maunium.net/go/gomuks/ui/fuzzy-search-modal.go:106 +0x66
go.mau.fi/mauview.(*InputArea).handleInputChanges(0xc000ff7340, {0x0?, 0x0?})
        go.mau.fi/mauview@v0.2.1/inputarea.go:910 +0x6f
go.mau.fi/mauview.(*InputArea).OnKeyEvent(0xc000ff7340, {0x55d23ebc5490, 0xc0023f88e0})
        go.mau.fi/mauview@v0.2.1/inputarea.go:1073 +0x5dc
maunium.net/go/gomuks/ui.(*FuzzySearchModal).OnKeyEvent(0xc000fdd480, {0x55d23ebc5490, 0xc0023f88e0})
        maunium.net/go/gomuks/ui/fuzzy-search-modal.go:164 +0x76d
maunium.net/go/gomuks/ui.(*MainView).OnKeyEvent(0xc000140370, {0x55d23ebc5490, 0xc0023f88e0})
        maunium.net/go/gomuks/ui/view-main.go:170 +0x402
go.mau.fi/mauview.(*Application).Start(0xc0002fd0e0)
        go.mau.fi/mauview@v0.2.1/application.go:122 +0x64a
maunium.net/go/gomuks/ui.(*GomuksUI).Start(0xc000562cc0?)
        maunium.net/go/gomuks/ui/ui.go:82 +0x1d
main.(*Gomuks).Start(0xc000468450)
        maunium.net/go/gomuks/gomuks.go:155 +0x137
main.main()
        maunium.net/go/gomuks/main.go:89 +0x605
foxyseta commented 1 year ago

Hi! Any updates on this?