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

Data race when opening inspect #1327

Open runrc opened 3 days ago

runrc commented 3 days ago

Describe the bug

Create a simple application that opens a window. Run the application with the data race checker enabled. Right-clicking on a window and select Inspect, a data race condition is detected.

How to reproduce

As above.

Example code

No response

Relevant output

==================
WARNING: DATA RACE
Write at 0x00c0001d1828 by goroutine 46:
  reflect.typedmemmove()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/mbarrier.go:225 +0x0
  reflect.Value.Set()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/reflect/value.go:2318 +0x144
  cogentcore.org/core/base/reflectx.SetRobust()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/base/reflectx/values.go:967 +0x310
  cogentcore.org/core/core.Bind[go.shape.c88485156b589a2d9638072e6789e46ef81bfc65d7474bce881ae5985b476a29].func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/value.go:56 +0xec
  cogentcore.org/core/core.(*WidgetBase).UpdateWidget()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:23 +0x58
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:33 +0x28
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.(*WidgetBase).WidgetWalkDown.func2()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:467 +0xb4
  cogentcore.org/core/tree.(*NodeBase).WalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/tree/nodebase.go:502 +0x158
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.(*WidgetBase).WidgetWalkDown.func2()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:467 +0xb4
  cogentcore.org/core/tree.(*NodeBase).WalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/tree/nodebase.go:502 +0x158
  cogentcore.org/core/core.(*WidgetBase).WidgetWalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:465 +0x8c
  cogentcore.org/core/core.(*WidgetBase).UpdateTree()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:32 +0x24
  cogentcore.org/core/core.(*Scene).updateScene()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:235 +0xb0
  cogentcore.org/core/core.(*Scene).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:283 +0x308
  cogentcore.org/core/core.(*stages).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stages.go:202 +0x108
  cogentcore.org/core/core.(*renderWindow).resized()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:293 +0x414
  cogentcore.org/core/core.(*renderWindow).handleWindowEvents()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:444 +0x614
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:422 +0x168
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Previous read at 0x00c0001d1828 by goroutine 35:
  cogentcore.org/core/core.(*renderWindow).renderWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:704 +0xc10
  cogentcore.org/core/core.(*renderWindow).handleWindowEvents()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:438 +0x5e4
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:422 +0x168
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*Events).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:169 +0x60
  cogentcore.org/core/core.(*Stage).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:209 +0xdc
  cogentcore.org/core/core.(*stages).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:251 +0x1e0
  cogentcore.org/core/core.(*Stage).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:395 +0x6c
  cogentcore.org/core/core.(*stages).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:411 +0xac
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:427 +0x198
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Goroutine 46 (running) created at:
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x94
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:258 +0x818
  cogentcore.org/core/core.(*Scene).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:283 +0x308
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:254 +0x7ec
  cogentcore.org/core/core.(*Scene).contentSize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:266 +0x10c
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:216 +0x3f0
  cogentcore.org/core/core.(*Scene).updateScene()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:235 +0xb0
  cogentcore.org/core/core.(*Stage).configMainStage()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:191 +0x268
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:204 +0x258
  cogentcore.org/core/core.(*Stage).run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:299 +0xb4
  cogentcore.org/core/core.(*Stage).Run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:278 +0xc8
  cogentcore.org/core/core.(*Body).RunWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:71 +0x98
  cogentcore.org/core/core.InspectorWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/inspector.go:291 +0xa4
  cogentcore.org/core/core.(*Scene).standardContextMenu.func3()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/menu.go:284 +0x34
  cogentcore.org/core/events.(*Listeners).Call()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/events/listeners.go:61 +0x12c
  cogentcore.org/core/core.(*WidgetBase).HandleEvent.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:244 +0x90
  cogentcore.org/core/base/tiered.(*Tiered[go.shape.map[cogentcore.org/core/events.Types][]func(cogentcore.org/core/events.Event)]).Do()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/base/tiered/tiered.go:30 +0x64
  cogentcore.org/core/core.(*WidgetBase).HandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:243 +0x1cc
  cogentcore.org/core/core.(*WidgetBase).Send()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:180 +0x134
  cogentcore.org/core/core.(*Events).handlePosEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:477 +0x20a0
  cogentcore.org/core/core.(*Events).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:169 +0x60
  cogentcore.org/core/core.(*Stage).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:209 +0xdc
  cogentcore.org/core/core.(*stages).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:251 +0x1e0
  cogentcore.org/core/core.(*Stage).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:395 +0x6c
  cogentcore.org/core/core.(*stages).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:411 +0xac
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:427 +0x198
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Goroutine 35 (running) created at:
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x94
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:258 +0x818
  cogentcore.org/core/core.(*Stage).run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:299 +0xb4
  cogentcore.org/core/core.(*Stage).Run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:278 +0xc8
  cogentcore.org/core/core.(*Body).RunWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:71 +0x98
  cogentcore.org/core/core.(*Body).RunMainWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:45 +0x58
  main.main()
      /Users/test/Dev/test/test.go:84 +0x86c
==================
==================
WARNING: DATA RACE
Read at 0x00c0001d1ab8 by goroutine 46:
  reflect.typedmemmove()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/mbarrier.go:225 +0x0
  reflect.Value.Set()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/reflect/value.go:2318 +0x144
  cogentcore.org/core/base/reflectx.SetRobust()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/base/reflectx/values.go:967 +0x310
  cogentcore.org/core/core.Bind[go.shape.c88485156b589a2d9638072e6789e46ef81bfc65d7474bce881ae5985b476a29].func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/value.go:56 +0xec
  cogentcore.org/core/core.(*WidgetBase).UpdateWidget()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:23 +0x58
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:33 +0x28
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.(*WidgetBase).WidgetWalkDown.func2()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:467 +0xb4
  cogentcore.org/core/tree.(*NodeBase).WalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/tree/nodebase.go:502 +0x158
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.(*WidgetBase).WidgetWalkDown.func2()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:467 +0xb4
  cogentcore.org/core/tree.(*NodeBase).WalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/tree/nodebase.go:502 +0x158
  cogentcore.org/core/core.(*WidgetBase).WidgetWalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:465 +0x8c
  cogentcore.org/core/core.(*WidgetBase).UpdateTree()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:32 +0x24
  cogentcore.org/core/core.(*Scene).updateScene()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:235 +0xb0
  cogentcore.org/core/core.(*Scene).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:283 +0x308
  cogentcore.org/core/core.(*stages).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stages.go:202 +0x108
  cogentcore.org/core/core.(*renderWindow).resized()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:293 +0x414
  cogentcore.org/core/core.(*renderWindow).handleWindowEvents()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:444 +0x614
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:422 +0x168
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Previous write at 0x00c0001d1ab8 by goroutine 35:
  ??()
      -:0 +0x102ca68f4
  sync/atomic.StoreInt64()
      <autogenerated>:1 +0x14
  cogentcore.org/core/core.(*sceneFlags).SetFlag()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/enumgen.go:230 +0x68
  cogentcore.org/core/core.(*Scene).setFlag()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:140 +0x4c
  cogentcore.org/core/core.(*Scene).doUpdate.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:175 +0x18
  runtime.deferreturn()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/panic.go:605 +0x5c
  cogentcore.org/core/core.(*Stage).doUpdate()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:317 +0xbc
  cogentcore.org/core/core.(*stages).updateAll()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stages.go:229 +0x160
  cogentcore.org/core/core.(*renderWindow).renderWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:624 +0xc0
  cogentcore.org/core/core.(*renderWindow).handleWindowEvents()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:438 +0x5e4
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:422 +0x168
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*Events).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:169 +0x60
  cogentcore.org/core/core.(*Stage).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:209 +0xdc
  cogentcore.org/core/core.(*stages).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:251 +0x1e0
  cogentcore.org/core/core.(*Stage).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:395 +0x6c
  cogentcore.org/core/core.(*stages).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:411 +0xac
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:427 +0x198
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Goroutine 46 (running) created at:
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x94
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:258 +0x818
  cogentcore.org/core/core.(*Scene).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:283 +0x308
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:254 +0x7ec
  cogentcore.org/core/core.(*Scene).contentSize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:266 +0x10c
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:216 +0x3f0
  cogentcore.org/core/core.(*Scene).updateScene()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:235 +0xb0
  cogentcore.org/core/core.(*Stage).configMainStage()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:191 +0x268
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:204 +0x258
  cogentcore.org/core/core.(*Stage).run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:299 +0xb4
  cogentcore.org/core/core.(*Stage).Run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:278 +0xc8
  cogentcore.org/core/core.(*Body).RunWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:71 +0x98
  cogentcore.org/core/core.InspectorWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/inspector.go:291 +0xa4
  cogentcore.org/core/core.(*Scene).standardContextMenu.func3()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/menu.go:284 +0x34
  cogentcore.org/core/events.(*Listeners).Call()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/events/listeners.go:61 +0x12c
  cogentcore.org/core/core.(*WidgetBase).HandleEvent.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:244 +0x90
  cogentcore.org/core/base/tiered.(*Tiered[go.shape.map[cogentcore.org/core/events.Types][]func(cogentcore.org/core/events.Event)]).Do()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/base/tiered/tiered.go:30 +0x64
  cogentcore.org/core/core.(*WidgetBase).HandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:243 +0x1cc
  cogentcore.org/core/core.(*WidgetBase).Send()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:180 +0x134
  cogentcore.org/core/core.(*Events).handlePosEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:477 +0x20a0
  cogentcore.org/core/core.(*Events).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:169 +0x60
  cogentcore.org/core/core.(*Stage).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:209 +0xdc
  cogentcore.org/core/core.(*stages).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:251 +0x1e0
  cogentcore.org/core/core.(*Stage).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:395 +0x6c
  cogentcore.org/core/core.(*stages).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:411 +0xac
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:427 +0x198
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Goroutine 35 (running) created at:
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x94
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:258 +0x818
  cogentcore.org/core/core.(*Stage).run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:299 +0xb4
  cogentcore.org/core/core.(*Stage).Run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:278 +0xc8
  cogentcore.org/core/core.(*Body).RunWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:71 +0x98
  cogentcore.org/core/core.(*Body).RunMainWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:45 +0x58
  main.main()
      /Users/test/Dev/test/test.go:84 +0x86c
==================
==================
WARNING: DATA RACE
Write at 0x00c0002fe000 by goroutine 46:
  reflect.typedmemmove()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/mbarrier.go:225 +0x0
  reflect.Value.Set()
      /opt/homebrew/Cellar/go/1.23.3/libexec/src/reflect/value.go:2318 +0x144
  cogentcore.org/core/base/reflectx.SetRobust()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/base/reflectx/values.go:967 +0x310
  cogentcore.org/core/core.Bind[go.shape.c88485156b589a2d9638072e6789e46ef81bfc65d7474bce881ae5985b476a29].func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/value.go:56 +0xec
  cogentcore.org/core/core.(*WidgetBase).UpdateWidget()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:23 +0x58
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:33 +0x28
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.(*WidgetBase).WidgetWalkDown.func2()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:467 +0xb4
  cogentcore.org/core/tree.(*NodeBase).WalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/tree/nodebase.go:502 +0x158
  cogentcore.org/core/core.(*WidgetBase).UpdateTree.(*WidgetBase).WidgetWalkDown.func2()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:467 +0xb4
  cogentcore.org/core/tree.(*NodeBase).WalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/tree/nodebase.go:502 +0x158
  cogentcore.org/core/core.(*WidgetBase).WidgetWalkDown()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widget.go:465 +0x8c
  cogentcore.org/core/core.(*WidgetBase).UpdateTree()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/update.go:32 +0x24
  cogentcore.org/core/core.(*Scene).updateScene()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:235 +0xb0
  cogentcore.org/core/core.(*Scene).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:283 +0x308
  cogentcore.org/core/core.(*stages).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stages.go:202 +0x108
  cogentcore.org/core/core.(*renderWindow).resized()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:293 +0x414
  cogentcore.org/core/core.(*renderWindow).handleWindowEvents()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:444 +0x614
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:422 +0x168
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Previous read at 0x00c0002fe000 by goroutine 35:
  cogentcore.org/core/core.(*Stage).doUpdate()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:314 +0x44
  cogentcore.org/core/core.(*stages).updateAll()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stages.go:229 +0x160
  cogentcore.org/core/core.(*renderWindow).renderWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:624 +0xc0
  cogentcore.org/core/core.(*renderWindow).handleWindowEvents()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:438 +0x5e4
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:422 +0x168
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*Events).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:169 +0x60
  cogentcore.org/core/core.(*Stage).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:209 +0xdc
  cogentcore.org/core/core.(*stages).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:251 +0x1e0
  cogentcore.org/core/core.(*Stage).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:395 +0x6c
  cogentcore.org/core/core.(*stages).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:411 +0xac
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:427 +0x198
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Goroutine 46 (running) created at:
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x94
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:258 +0x818
  cogentcore.org/core/core.(*Scene).resize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/scene.go:283 +0x308
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:254 +0x7ec
  cogentcore.org/core/core.(*Scene).contentSize()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:266 +0x10c
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:216 +0x3f0
  cogentcore.org/core/core.(*Scene).updateScene()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/render.go:235 +0xb0
  cogentcore.org/core/core.(*Stage).configMainStage()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:191 +0x268
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:204 +0x258
  cogentcore.org/core/core.(*Stage).run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:299 +0xb4
  cogentcore.org/core/core.(*Stage).Run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:278 +0xc8
  cogentcore.org/core/core.(*Body).RunWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:71 +0x98
  cogentcore.org/core/core.InspectorWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/inspector.go:291 +0xa4
  cogentcore.org/core/core.(*Scene).standardContextMenu.func3()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/menu.go:284 +0x34
  cogentcore.org/core/events.(*Listeners).Call()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/events/listeners.go:61 +0x12c
  cogentcore.org/core/core.(*WidgetBase).HandleEvent.func1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:244 +0x90
  cogentcore.org/core/base/tiered.(*Tiered[go.shape.map[cogentcore.org/core/events.Types][]func(cogentcore.org/core/events.Event)]).Do()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/base/tiered/tiered.go:30 +0x64
  cogentcore.org/core/core.(*WidgetBase).HandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:243 +0x1cc
  cogentcore.org/core/core.(*WidgetBase).Send()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/widgetevents.go:180 +0x134
  cogentcore.org/core/core.(*Events).handlePosEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:477 +0x20a0
  cogentcore.org/core/core.(*Events).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/events.go:169 +0x60
  cogentcore.org/core/core.(*Stage).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:209 +0xdc
  cogentcore.org/core/core.(*stages).popupHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/popupstage.go:251 +0x1e0
  cogentcore.org/core/core.(*Stage).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:395 +0x6c
  cogentcore.org/core/core.(*stages).mainHandleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:411 +0xac
  cogentcore.org/core/core.(*renderWindow).handleEvent()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:427 +0x198
  cogentcore.org/core/core.(*renderWindow).eventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:390 +0xd0
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop.gowrap1()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x34

Goroutine 35 (running) created at:
  cogentcore.org/core/core.(*renderWindow).goStartEventLoop()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/renderwindow.go:361 +0x94
  cogentcore.org/core/core.(*Stage).runWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:258 +0x818
  cogentcore.org/core/core.(*Stage).run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:299 +0xb4
  cogentcore.org/core/core.(*Stage).Run()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/stage.go:278 +0xc8
  cogentcore.org/core/core.(*Body).RunWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:71 +0x98
  cogentcore.org/core/core.(*Body).RunMainWindow()
      /Users/test/go/pkg/mod/cogentcore.org/core@v0.3.6-0.20241115203139-43c6bd60ac38/core/mainstage.go:45 +0x58
  main.main()
      /Users/test/Dev/test/test.go:84 +0x86c
==================


### Platform

macOS
kkoreilly commented 3 days ago

Thank you for reporting this; I will fix this soon.