akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.35k stars 60 forks source link

Crashes with OpenGL error on Ubuntu 20.10 #228

Open alysbrooks opened 3 years ago

alysbrooks commented 3 years ago

After using Goneovim for a while, it will crash without warning. It seems to happen regardless of what. Trying to open the minimap reliably causes a crash. I tried with -u NONE, and it seems to crash less often but the minimap still causes an issue.

I'm using 0.4.11 on Ubuntu 20.10 with Awesome and the following version of Neovim:

NVIM v0.4.4
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-u4YhjF/neovim-0.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-u4YhjF/neovim-0.4.4/build/config -I/build/neovim-u4YhjF/neovim-0.4.4/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-u4YhjF/neovim-0.4.4/build/src/nvim/auto -I/build/neovim-u4YhjF/neovim-0.4.4/build/include
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Here's the full error:

Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
SIGABRT: abort
PC=0x7f5e08d498cb m=0 sigcode=18446744073709551610
signal arrived during cgo execution

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0xf22d60, 0xc000a7b270, 0x0)
    runtime/cgocall.go:128 +0x5b fp=0xc000a7b240 sp=0xc000a7b208 pc=0x5816ab
github.com/therecipe/qt/widgets._Cfunc_QWidget_Grab(0x3bbfed0, 0x63c9c20, 0x0)
    _cgo_gotypes.go:20014 +0x4e fp=0xc000a7b270 sp=0xc000a7b240 pc=0x81241e
github.com/therecipe/qt/widgets.(*QWidget).Grab.func1(0xc000182500, 0x1359260, 0xc000846218, 0x11bf318)
    github.com/therecipe/qt/widgets/widgets-minimal.go:24855 +0xb6 fp=0xc000a7b2b8 sp=0xc000a7b270 pc=0x8f1b36
github.com/therecipe/qt/widgets.(*QWidget).Grab(0xc000182500, 0x1359260, 0xc000846218, 0xc000a7b301)
    github.com/therecipe/qt/widgets/widgets-minimal.go:24855 +0x59 fp=0xc000a7b2f8 sp=0xc000a7b2b8 pc=0x89fa59
github.com/akiyosi/goneovim/editor.(*Editor).keyRelease(0xc000179900, 0xc000846210)
    github.com/akiyosi/goneovim/editor/editor.go:814 +0xc2 fp=0xc000a7b330 sp=0xc000a7b2f8 pc=0xdc8072
github.com/akiyosi/goneovim/editor.(*Editor).keyRelease-fm(0xc000846210)
    github.com/akiyosi/goneovim/editor/editor.go:804 +0x34 fp=0xc000a7b350 sp=0xc000a7b330 pc=0xe6b7b4
github.com/akiyosi/goqtframelesswindow.callbackQFramelessWindowbaaf11_KeyReleaseEvent(0x3b9c4e0, 0x7fff888015a0)
    github.com/akiyosi/goqtframelesswindow/moc.go:858 +0x9e fp=0xc000a7b398 sp=0xc000a7b350 pc=0x99cbfe
github.com/akiyosi/goqtframelesswindow._cgoexpwrap_f07c9478f5c9_callbackQFramelessWindowbaaf11_KeyReleaseEvent(0x3b9c4e0, 0x7fff888015a0)
    _cgo_gotypes.go:1981 +0x35 fp=0xc000a7b3b8 sp=0xc000a7b398 pc=0x997315
runtime.call32(0x0, 0x7fff88800e50, 0x7fff88800ee0, 0x10)
    runtime/asm_amd64.s:539 +0x3b fp=0xc000a7b3e8 sp=0xc000a7b3b8 pc=0x5d6c4b
runtime.cgocallbackg1(0x0)
    runtime/cgocall.go:314 +0x1b7 fp=0xc000a7b4d0 sp=0xc000a7b3e8 pc=0x581a57
runtime.cgocallbackg(0x0)
    runtime/cgocall.go:191 +0xc1 fp=0xc000a7b538 sp=0xc000a7b4d0 pc=0x581801
runtime.cgocallback_gofunc(0x5816cf, 0xf5f660, 0xc000a7b5c8, 0xc000a7b5b8)
    runtime/asm_amd64.s:793 +0x9b fp=0xc000a7b558 sp=0xc000a7b538 pc=0x5d821b
runtime.asmcgocall(0xf5f660, 0xc000a7b5c8)
    runtime/asm_amd64.s:640 +0x42 fp=0xc000a7b560 sp=0xc000a7b558 pc=0x5d80b2
runtime.cgocall(0xf5f660, 0xc000a7b5c8, 0x8)
    runtime/cgocall.go:131 +0x7f fp=0xc000a7b598 sp=0xc000a7b560 pc=0x5816cf
github.com/akiyosi/goqtframelesswindow._Cfunc_QFramelessWindowbaaf11_EventDefault(0x3b9c4e0, 0x7fff888015a0, 0x0)
    _cgo_gotypes.go:350 +0x4a fp=0xc000a7b5c8 sp=0xc000a7b598 pc=0x99373a
github.com/akiyosi/goqtframelesswindow.(*QFramelessWindow).EventDefault.func1(0xc0005857a0, 0x1359180, 0xc000846208, 0xc000846208)
    github.com/akiyosi/goqtframelesswindow/moc.go:466 +0xb8 fp=0xc000a7b610 sp=0xc000a7b5c8 pc=0x9a21e8
github.com/akiyosi/goqtframelesswindow.(*QFramelessWindow).EventDefault(0xc0005857a0, 0x1359180, 0xc000846208, 0x5)
    github.com/akiyosi/goqtframelesswindow/moc.go:466 +0x4f fp=0xc000a7b640 sp=0xc000a7b610 pc=0x99a63f
github.com/akiyosi/goqtframelesswindow.callbackQFramelessWindowbaaf11_Event(0x3b9c4e0, 0x7fff888015a0, 0x11c1b58)
    github.com/akiyosi/goqtframelesswindow/moc.go:461 +0x11e fp=0xc000a7b688 sp=0xc000a7b640 pc=0x99a5be
github.com/akiyosi/goqtframelesswindow._cgoexpwrap_f07c9478f5c9_callbackQFramelessWindowbaaf11_Event(0x3b9c4e0, 0x7fff888015a0, 0x7fff88801801)
    _cgo_gotypes.go:1614 +0x35 fp=0xc000a7b6b0 sp=0xc000a7b688 pc=0x995f85
runtime.call32(0x0, 0x7fff88801090, 0x7fff88801120, 0x18)
    runtime/asm_amd64.s:539 +0x3b fp=0xc000a7b6e0 sp=0xc000a7b6b0 pc=0x5d6c4b
runtime.cgocallbackg1(0x0)
    runtime/cgocall.go:314 +0x1b7 fp=0xc000a7b7c8 sp=0xc000a7b6e0 pc=0x581a57
runtime.cgocallbackg(0x0)
    runtime/cgocall.go:191 +0xc1 fp=0xc000a7b830 sp=0xc000a7b7c8 pc=0x581801
runtime.cgocallback_gofunc(0x5816cf, 0xf182a0, 0xc000a7b8c0, 0x3bab8a0)
    runtime/asm_amd64.s:793 +0x9b fp=0xc000a7b850 sp=0xc000a7b830 pc=0x5d821b
runtime.asmcgocall(0xf182a0, 0xc000a7b8c0)
    runtime/asm_amd64.s:640 +0x42 fp=0xc000a7b858 sp=0xc000a7b850 pc=0x5d80b2
runtime.cgocall(0xf182a0, 0xc000a7b8c0, 0x8a8f01)
    runtime/cgocall.go:131 +0x7f fp=0xc000a7b890 sp=0xc000a7b858 pc=0x5816cf
github.com/therecipe/qt/widgets._Cfunc_QApplication_QApplication_Exec(0xc000000000)
    _cgo_gotypes.go:2600 +0x49 fp=0xc000a7b8c0 sp=0xc000a7b890 pc=0x7e9a99
github.com/therecipe/qt/widgets.QApplication_Exec(...)
    github.com/therecipe/qt/widgets/widgets-minimal.go:2983
github.com/akiyosi/goneovim/editor.InitEditor(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    github.com/akiyosi/goneovim/editor/editor.go:341 +0xe5e fp=0xc000a7be88 sp=0xc000a7b8c0 pc=0xdc4dfe
main.main()
    github.com/akiyosi/goneovim/cmd/goneovim/main.go:30 +0xa3 fp=0xc000a7bf60 sp=0xc000a7be88 pc=0xe86063
runtime.main()
    runtime/proc.go:203 +0x21e fp=0xc000a7bfe0 sp=0xc000a7bf60 pc=0x5ad95e
runtime.goexit()
    runtime/asm_amd64.s:1357 +0x1 fp=0xc000a7bfe8 sp=0xc000a7bfe0 pc=0x5d8961

goroutine 10 [chan receive, 1 minutes]:
github.com/akiyosi/goneovim/editor.InitEditor.func4(0xc000179900)
    github.com/akiyosi/goneovim/editor/editor.go:313 +0x3b
created by github.com/akiyosi/goneovim/editor.InitEditor
    github.com/akiyosi/goneovim/editor/editor.go:312 +0xd9c

goroutine 34 [select, 1 minutes]:
os/exec.(*Cmd).Start.func2(0xc00027e000)
    os/exec/exec.go:443 +0xc4
created by os/exec.(*Cmd).Start
    os/exec/exec.go:442 +0x6a6

goroutine 35 [IO wait]:
internal/poll.runtime_pollWait(0x7f5e0047eda8, 0x72, 0xffffffffffffffff)
    runtime/netpoll.go:184 +0x55
internal/poll.(*pollDesc).wait(0xc0000a6258, 0x72, 0x1001, 0x1000, 0xffffffffffffffff)
    internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
    internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0000a6240, 0xc0001c7000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    internal/poll/fd_unix.go:169 +0x1cf
os.(*File).read(...)
    os/file_unix.go:259
os.(*File).Read(0xc0000a4040, 0xc0001c7000, 0x1000, 0x1000, 0xc000047dd0, 0xd28ca5, 0xc0001435c0)
    os/file.go:116 +0x71
bufio.(*Reader).fill(0xc0000a6360)
    bufio/bufio.go:100 +0x103
bufio.(*Reader).ReadByte(0xc0000a6360, 0xc000047e78, 0xd28961, 0xc0001ac820)
    bufio/bufio.go:252 +0x39
github.com/neovim/go-client/msgpack.(*Decoder).Unpack(0xc0001ba0a0, 0x3, 0x0)
    github.com/neovim/go-client/msgpack/unpack.go:164 +0x55
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).Serve(0xc0001ac820, 0x0, 0x0)
    github.com/neovim/go-client/msgpack/rpc/rpc.go:195 +0xfc
github.com/neovim/go-client/nvim.(*Nvim).Serve(0xc0005151a0, 0x0, 0x0)
    github.com/neovim/go-client/nvim/nvim.go:53 +0x81
github.com/neovim/go-client/nvim.(*Nvim).startServe.func1(0xc0005151a0)
    github.com/neovim/go-client/nvim/nvim.go:59 +0x2b
created by github.com/neovim/go-client/nvim.(*Nvim).startServe
    github.com/neovim/go-client/nvim/nvim.go:58 +0x6c

goroutine 36 [semacquire, 1 minutes]:
sync.runtime_SemacquireMutex(0xc0005151cc, 0x0, 0x1)
    runtime/sema.go:71 +0x47
sync.(*Mutex).lockSlow(0xc0005151c8)
    sync/mutex.go:138 +0xfc
sync.(*Mutex).Lock(...)
    sync/mutex.go:81
github.com/neovim/go-client/nvim.(*Nvim).Serve(0xc0005151a0, 0x0, 0x0)
    github.com/neovim/go-client/nvim/nvim.go:51 +0xc3
github.com/akiyosi/goneovim/editor.(*Workspace).startNvim.func3(0xc000173880)
    github.com/akiyosi/goneovim/editor/workspace.go:519 +0x36
created by github.com/akiyosi/goneovim/editor.(*Workspace).startNvim
    github.com/akiyosi/goneovim/editor/workspace.go:518 +0x55f

goroutine 40 [sync.Cond.Wait]:
runtime.goparkunlock(...)
    runtime/proc.go:310
sync.runtime_notifyListWait(0xc0001435d0, 0xc000000155)
    runtime/sema.go:510 +0xf8
sync.(*Cond).Wait(0xc0001435c0)
    sync/cond.go:56 +0x9d
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).dequeueNotifications(0xc0001ac820, 0x1, 0x1, 0x0)
    github.com/neovim/go-client/msgpack/rpc/rpc.go:659 +0x5a
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).runNotifications(0xc0001ac820)
    github.com/neovim/go-client/msgpack/rpc/rpc.go:671 +0x20b
created by github.com/neovim/go-client/msgpack/rpc.(*Endpoint).Serve
    github.com/neovim/go-client/msgpack/rpc/rpc.go:192 +0xe7

goroutine 25 [select, 1 minutes]:
os/exec.(*Cmd).Start.func2(0xc0004ba000)
    os/exec/exec.go:443 +0xc4
created by os/exec.(*Cmd).Start
    os/exec/exec.go:442 +0x6a6

goroutine 26 [semacquire, 1 minutes]:
sync.runtime_SemacquireMutex(0xc0005d17fc, 0x0, 0x1)
    runtime/sema.go:71 +0x47
sync.(*Mutex).lockSlow(0xc0005d17f8)
    sync/mutex.go:138 +0xfc
sync.(*Mutex).Lock(...)
    sync/mutex.go:81
github.com/neovim/go-client/nvim.(*Nvim).Serve(0xc0005d17d0, 0x0, 0x0)
    github.com/neovim/go-client/nvim/nvim.go:51 +0xc3
github.com/neovim/go-client/nvim.(*Nvim).startServe.func1(0xc0005d17d0)
    github.com/neovim/go-client/nvim/nvim.go:59 +0x2b
created by github.com/neovim/go-client/nvim.(*Nvim).startServe
    github.com/neovim/go-client/nvim/nvim.go:58 +0x6c

goroutine 27 [IO wait]:
internal/poll.runtime_pollWait(0x7f5e0047ec08, 0x72, 0xffffffffffffffff)
    runtime/netpoll.go:184 +0x55
internal/poll.(*pollDesc).wait(0xc00033e438, 0x72, 0x1001, 0x1000, 0xffffffffffffffff)
    internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
    internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc00033e420, 0xc000350000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    internal/poll/fd_unix.go:169 +0x1cf
os.(*File).read(...)
    os/file_unix.go:259
os.(*File).Read(0xc0002f5a40, 0xc000350000, 0x1000, 0x1000, 0xd24421, 0xc00033e780, 0xc000356d68)
    os/file.go:116 +0x71
bufio.(*Reader).fill(0xc00033e540)
    bufio/bufio.go:100 +0x103
bufio.(*Reader).ReadByte(0xc00033e540, 0xc00034aea0, 0x1359c20, 0xc00042a830)
    bufio/bufio.go:252 +0x39
github.com/neovim/go-client/msgpack.(*Decoder).Unpack(0xc0002b6320, 0x4, 0x0)
    github.com/neovim/go-client/msgpack/unpack.go:164 +0x55
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).Serve(0xc00034aea0, 0x0, 0x0)
    github.com/neovim/go-client/msgpack/rpc/rpc.go:195 +0xfc
github.com/neovim/go-client/nvim.(*Nvim).Serve(0xc0005d17d0, 0x0, 0x0)
    github.com/neovim/go-client/nvim/nvim.go:53 +0x81
github.com/akiyosi/goneovim/editor.(*MiniMap).startMinimapProc.func2(0xc0005d17d0, 0xc0003c05c0, 0xc000520160)
    github.com/akiyosi/goneovim/editor/minimap.go:136 +0x2f
created by github.com/akiyosi/goneovim/editor.(*MiniMap).startMinimapProc
    github.com/akiyosi/goneovim/editor/minimap.go:135 +0x355

goroutine 28 [sync.Cond.Wait]:
runtime.goparkunlock(...)
    runtime/proc.go:310
sync.runtime_notifyListWait(0xc000623a90, 0x4)
    runtime/sema.go:510 +0xf8
sync.(*Cond).Wait(0xc000623a80)
    sync/cond.go:56 +0x9d
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).dequeueNotifications(0xc00034aea0, 0x1, 0x1, 0x0)
    github.com/neovim/go-client/msgpack/rpc/rpc.go:659 +0x5a
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).runNotifications(0xc00034aea0)
    github.com/neovim/go-client/msgpack/rpc/rpc.go:671 +0x20b
created by github.com/neovim/go-client/msgpack/rpc.(*Endpoint).Serve
    github.com/neovim/go-client/msgpack/rpc/rpc.go:192 +0xe7

rax    0x0
rbx    0x7f5e04906880
rcx    0x7f5e08d498cb
rdx    0x0
rdi    0x2
rsi    0x7fff887ffe10
rbp    0x49e0fc0
rsp    0x7fff887ffe10
r8     0x0
r9     0x7fff887ffe10
r10    0x8
r11    0x246
r12    0x7fff88800140
r13    0x49e0fc0
r14    0x49e0fc0
r15    0x7fff888006a0
rip    0x7f5e08d498cb
rflags 0x246
cs     0x33
fs     0x0
gs     0x0
akiyosi commented 3 years ago

Hi :D Thanks for the report.

Regarding the issue, it looks like a weird problem, since Goneovim doesn't implement OpenGL based rendering etc. I will continue to investigate this error.

However, according to the stack trace, it appears to be crashing beyond the widgets.(*QWidget).Grab() function. Since this is a process that is involved in smooth scrolling behavior and is not necessary in an environment where smooth scrolling is disabled, I created a fix to suppress the execution of this function when smooth scrolling is disabled. I would be happy if you could check if this fix suppresses the crash.

https://github.com/akiyosi/goneovim/actions/runs/908511389

Also, note that Goneovim uses the features provided in neovim 0.5.0, and most of the testing has been done with neovim 0.5.0. The basic functionality will still work with 0.4.4, but I would recommend using neovim 0.5.0.