Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random crash doing undo -- something out of whack #270

Open
rcoreilly opened this issue Nov 21, 2020 · 2 comments
Open

random crash doing undo -- something out of whack #270

rcoreilly opened this issue Nov 21, 2020 · 2 comments

Comments

@rcoreilly
Copy link
Contributor

panic: runtime error: slice bounds out of range [98:88]

goroutine 15 [running]:
github.com/goki/gi/giv.(*TextBuf).DeleteTextImpl(0xc0d2802580, 0xf2, 0x5e, 0xf2, 0x62, 0xc06182ba70)
/Users/oreilly/go/src/github.com/goki/gi/giv/textbuf.go:1081 +0x778
github.com/goki/gi/giv.(*TextBuf).Undo(0xc0d2802580, 0x0)
/Users/oreilly/go/src/github.com/goki/gi/giv/textbuf.go:1873 +0x6b3
github.com/goki/gi/giv.(*TextView).Undo(0xc004bc4a00)
/Users/oreilly/go/src/github.com/goki/gi/giv/textview.go:1536 +0x7c
github.com/goki/gi/giv.(*TextView).KeyInput(0xc004bc4a00, 0xc11a47bc80)
/Users/oreilly/go/src/github.com/goki/gi/giv/textview.go:4279 +0x1059
github.com/goki/gide/gide.(*TextView).TextViewEvents.func2(0x520d5e0, 0xc004bc4a00, 0x51f7320, 0xc000825000, 0x7, 0x4ea3d80, 0xc11a47bc80)
/Users/oreilly/go/src/github.com/goki/gide/gide/textview.go:269 +0x8c
github.com/goki/gi/gi.(*WinEventRecv).Call(0xc06182bdb8, 0x51f7320, 0xc000825000, 0x7, 0x4ea3d80, 0xc11a47bc80)
/Users/oreilly/go/src/github.com/goki/gi/gi/events.go:116 +0x8c
github.com/goki/gi/gi.(*EventMgr).SendEventSignal(0xc000825198, 0x51ab0e0, 0xc11a47bc80, 0x1)
/Users/oreilly/go/src/github.com/goki/gi/gi/events.go:225 +0x39b
github.com/goki/gi/gi.(*Window).ProcessEvent(0xc000825000, 0x51ab0e0, 0xc11a47bc80)
/Users/oreilly/go/src/github.com/goki/gi/gi/window.go:1547 +0x845
github.com/goki/gi/gi.(*Window).EventLoop(0xc000825000)
/Users/oreilly/go/src/github.com/goki/gi/gi/window.go:1469 +0x36
created by github.com/goki/gi/gi.(*Window).GoStartEventLoop
/Users/oreilly/go/src/github.com/goki/gi/gi/window.go:876 +0xa7

@rcoreilly
Copy link
Contributor Author

similar -- just needs some basic bounds checking

panic: runtime error: slice bounds out of range [1:0]

goroutine 276 [running]:
github.com/goki/gi/giv.(*TextBuf).DeleteTextImpl(0xc0064bf900, 0x1ac, 0x0, 0x1ac, 0x1, 0xc03c37ba70)
/Users/oreilly/go/src/github.com/goki/gi/giv/textbuf.go:1082 +0x778
github.com/goki/gi/giv.(*TextBuf).Undo(0xc0064bf900, 0x0)
/Users/oreilly/go/src/github.com/goki/gi/giv/textbuf.go:1874 +0x6b3
github.com/goki/gi/giv.(*TextView).Undo(0xc004285500)
/Users/oreilly/go/src/github.com/goki/gi/giv/textview.go:1538 +0x7c
github.com/goki/gi/giv.(*TextView).KeyInput(0xc004285500, 0xc02f6cea80)
/Users/oreilly/go/src/github.com/goki/gi/giv/textview.go:4281 +0x1059
github.com/goki/gide/gide.(*TextView).TextViewEvents.func2(0x520f640, 0xc004285500, 0x51f9380, 0xc000f1a000, 0x7, 0x4eab3a0, 0xc02f6cea80)
/Users/oreilly/go/src/github.com/goki/gide/gide/textview.go:270 +0x8c
github.com/goki/gi/gi.(*WinEventRecv).Call(0xc03c37bdb8, 0x51f9380, 0xc000f1a000, 0x7, 0x4eab3a0, 0xc02f6cea80)
/Users/oreilly/go/src/github.com/goki/gi/gi/events.go:116 +0x8c
github.com/goki/gi/gi.(*EventMgr).SendEventSignal(0xc000f1a198, 0x51afbc0, 0xc02f6cea80, 0x1)
/Users/oreilly/go/src/github.com/goki/gi/gi/events.go:225 +0x39b
github.com/goki/gi/gi.(*Window).ProcessEvent(0xc000f1a000, 0x51afbc0, 0xc02f6cea80)
/Users/oreilly/go/src/github.com/goki/gi/gi/window.go:1547 +0x853
github.com/goki/gi/gi.(*Window).EventLoop(0xc000f1a000)
/Users/oreilly/go/src/github.com/goki/gi/gi/window.go:1469 +0x36
created by github.com/goki/gi/gi.(*Window).GoStartEventLoop
/Users/oreilly/go/src/github.com/goki/gi/gi/window.go:876 +0xa7

@rcoreilly
Copy link
Contributor Author

added some checks in RegionImpl -- may not be full fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant