SabakiHQ / Sabaki

An elegant Go board and SGF editor for a more civilized age.
https://sabaki.yichuanshen.de/
MIT License
2.39k stars 375 forks source link

The UI randomly freezes without any errors (possibly due to hardware acceleration enabled) #618

Open cipriancraciun opened 4 years ago

cipriancraciun commented 4 years ago

I'm using Linux OpenSUSE Tumbleweed and Sabaki v0.43.3 (64 bits) downloaded from the releases tab.

While playing (either human vs human, or vs computer) the UI freezes without any warnings or errors even in the console. After it freezes it doesn't recover, thus I need to kill the process. (The CPU doesn't go to 100%, it just sits idle.)

In order to replicate this all I need to do is play a little and eventually the UI will freeze.


I've tried to see if changing some options help, and from what I've seen disabling the hardware acceleration seems to solve the issue. (I'll report back if it freezes even in this situation.)

Given that it might be a hardware acceleration issue, bellow are a few dumps that might help. (I'm running Xorg with the i3 window manager, not Wayland.)

cat /proc/cpuinfo

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz
stepping    : 9
...
lshw -class display

  *-display                 
       description: VGA compatible controller
       product: 3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:35 memory:f0000000-f03fffff memory:e0000000-efffffff ioport:4000(size=64) memory:c0000-dffff
glxinfo  -B

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) Ivybridge Mobile  (0x166)
    Version: 19.2.6
    Accelerated: yes
    Video memory: 1536MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.2
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL core profile version string: 4.2 (Core Profile) Mesa 19.2.6
OpenGL core profile shading language version string: 4.20
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 19.2.6
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 19.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
cipriancraciun commented 4 years ago

As a followup I can confirm that even with hardware acceleration disabled the freeze does happen, although not as often.

Is there any "debugging" flag that I can turn on so we can perhaps have an idea of what could be the culprit?

yishn commented 4 years ago

You can activate the 'Developer' menu and thus opening Chrome's developer tools by following the steps from this guide.

cipriancraciun commented 4 years ago

OK, I've enabled the developer tools, opened the console and randomly played a little. It froze.

But interestingly -- I should have mentioned this in the initial report -- the UI freezes in the sense that the window is not repainted at all (i.e. hiding and re-showing the window gives a blank image). Thus in this case not even the developer tools was visible. I've tried to resize the window, make it full screen (from the window manager), press F11 (hoping it would go full screen from Electron), etc. Nothing snapped it out of it.

Then I've tried another experiment: start Sabaki, and just hide / show the window without doing anything special. (With i3 I achieved this by switching to and from another window.) This yielded the same result: a blank window, thus "frozen" application.

Perhaps this is an Electron issue?

cipriancraciun commented 4 years ago

Regarding Electron, I've looked at the Electron version in Sabaki and it's 5.0.1, although if I look in package.json for the master it is now ^6.0.1 (thus hopefully the next build will take the last one); however the latest official version of Electron is 7.1.9, which might suggest that Sabaki is quite "behind" Electron's development. (I don't know much about Electron development, and perhaps 6.x is a LTS or something, but perhaps Sabaki's build is missing some critical fixes.)

(BTW, in case you are using yarn or npm with lock file support, committing that file would also allow people to get a "repeatable" build, because if now I would to checkout the repo and build Sabaki myself I'll get a "random-ish" selection of dependency versions that might or might not work due to unrelated reasons. I know about "semantic-versioning", but in practice sometimes even a minor version change can break something...) :)


In related news I've searched Electron's issues for similar reports and I've found:

I'll keep an eye on that report also.

yishn commented 4 years ago

Very interesting, thank you very much for your detailed report!

You can try building master branch of Sabaki yourself to see if this issue persists with Electron v6, or even building Sabaki with the latest Electron version and see if you can still encounter this issue.