cogentcore / core

A free and open source framework for building powerful, fast, elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the web with a single Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.75k stars 83 forks source link

Cogent Core Docs stopped unexpectedly when waking browser from sleep #1284

Open runrc opened 1 week ago

runrc commented 1 week ago

Describe the bug

The website https://www.cogentcore.org/core crashed when the desktop computer was restored from a sleep state.

How to reproduce

Goto https://www.cogentcore.org/core Ensure computer goes into a sleep state Attempting to restore the browser causes the crash, see the stack trace.

Example code

No response

Relevant output

Cogent Core Docs stopped unexpectedly

There was an unexpected error and Cogent Core Docs stopped running.

Crash log saved in /home/me/.data/Cogent\ Core\ Docs/crash-logs

Platform: Web
System platform: MacOS
App version: dev
Core version:
Time: 2024-11-03 12:53:17
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15

panic: runtime error: index out of range [0] with length 0

goroutine 117 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.22.8/x64/src/runtime/debug/stack.go:24 +0x6
cogentcore.org/core/core.handleRecover({0x270c80, 0x1a515ba8})
/home/runner/work/core/core/core/recover.go:42 +0x5
cogentcore.org/core/core.(*renderWindow).eventLoop.func1()
/home/runner/work/core/core/core/renderwindow.go:376 +0x5
panic({0x270c80, 0x1a515ba8})
/opt/hostedtoolcache/go/1.22.8/x64/src/runtime/panic.go:770 +0x1a
github.com/cogentcore/webgpu/wgpu.BytesToJS({0x22f3a80, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/cogentcore/webgpu@v0.0.0-20240906154609-e35089e9a725/wgpu/util_js.go:14 +0xc
cogentcore.org/core/system/driver/web.(*Drawer).End(0x3c67b40)
/home/runner/work/core/core/system/driver/web/drawer.go:68 +0xd
cogentcore.org/core/core.(*renderWindow).renderWindow(0x3c680a0)
/home/runner/work/core/core/core/renderwindow.go:705 +0xc0
cogentcore.org/core/core.(*renderWindow).handleWindowEvents(0x3c680a0, {0xb2fdd0, 0x4f17180})
/home/runner/work/core/core/core/renderwindow.go:438 +0x6f
cogentcore.org/core/core.(*renderWindow).handleEvent(0x3c680a0, {0xb2fdd0, 0x4f17180})
/home/runner/work/core/core/core/renderwindow.go:422 +0x1f
cogentcore.org/core/core.(*renderWindow).eventLoop(0x3c680a0)
/home/runner/work/core/core/core/renderwindow.go:390 +0x10
created by cogentcore.org/core/core.(*renderWindow).goStartEventLoop in goroutine 1
/home/runner/work/core/core/core/renderwindow.go:361 +0x6

Platform

macOS

kkoreilly commented 1 week ago

Thank you for reporting this. I will work on fixing this soon.