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 82 forks source link

when setting font use basic example in freebsd 14.1 setting dialog crash #999

Open runsys opened 4 months ago

runsys commented 4 months ago

Describe the bug

when setting font use basic example in freebsd 14.1 setting dialog crash

How to reproduce

just scroll and view the font selection dialog.

Example code

No response

Relevant output

/da/go/src/cogentcore.org/core/examples/basic/basic  [/da/go/src/cogentcore.org/core/examples/basic]
2024/07/02 12:50:54 panic: runtime error: slice bounds out of range [-2147474456:]
2024/07/02 12:50:54 
2024/07/02 12:50:54 ----- START OF STACK TRACE: -----
2024/07/02 12:50:54 goroutine 291 [running]:
runtime/debug.Stack()
    /usr/local/go122/src/runtime/debug/stack.go:24 +0x5e
cogentcore.org/core/system.HandleRecoverBase({0x30d2e0, 0x8c0efc000})
    /da/go/src/cogentcore.org/core/system/recover.go:50 +0x4b
cogentcore.org/core/core.HandleRecover({0x30d2e0, 0x8c0efc000})
    /da/go/src/cogentcore.org/core/core/recover.go:33 +0x4b
cogentcore.org/core/core.(*RenderWindow).EventLoop.func1()
    /da/go/src/cogentcore.org/core/core/renderwindow.go:442 +0x24
panic({0x30d2e0?, 0x8c0efc000?})
    /usr/local/go122/src/runtime/panic.go:770 +0x132
golang.org/x/image/vector.(*Rasterizer).floatingLineTo(0x8c0e65050, 0x1?, 0x0?)
    /da/go/src/golang.org/x/image/vector/raster_floating.go:74 +0x637
golang.org/x/image/vector.(*Rasterizer).LineTo(0x872c69c00?, 0x0?, 0x0?)
    /da/go/src/golang.org/x/image/vector/vector.go:189 +0x19
golang.org/x/image/font/opentype.(*Face).Glyph(0x8c0e64a08, {0x0?, 0x0?}, 0xc0e650b0?)
    /da/go/src/golang.org/x/image/font/opentype/opentype.go:230 +0x46d
cogentcore.org/core/paint.(*Text).Render(0x871733848, 0x87162caf0, {0x70039770?, 0x8?})
    /da/go/src/cogentcore.org/core/paint/text.go:197 +0x17dd
cogentcore.org/core/core.(*TextField).Render(0x871732c88)
    /da/go/src/cogentcore.org/core/core/textfield.go:1947 +0x526
cogentcore.org/core/core.(*Frame).RenderWidget(0x871732c88)
    /da/go/src/cogentcore.org/core/core/frame.go:194 +0x9d
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x7d1278?, 0x871732c88?}, 0x0?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x13a9cc5?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x871662408?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x871662408)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x268ca6a08098?, 0x871662408?}, 0x8716361d8?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x14de73e?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x1627190?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x871636008)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x7d1d70?, 0x871636008?}, 0x8716221d8?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x147f99e?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x1627190?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x871622008)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x7d15d8?, 0x871622008?}, 0x87162c1d8?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x146e09e?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x1627190?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x87162c008)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Scene).LayoutRenderScene(0x87162c008)
    /da/go/src/cogentcore.org/core/core/render.go:177 +0x25
cogentcore.org/core/core.(*Scene).DoUpdate(0x87162c008)
    /da/go/src/cogentcore.org/core/core/render.go:243 +0x1fa
cogentcore.org/core/core.(*Stage).DoUpdate(0x8702fab48?)
    /da/go/src/cogentcore.org/core/core/stage.go:324 +0x57
cogentcore.org/core/core.(*Stages).UpdateAll(0x87114e120)
    /da/go/src/cogentcore.org/core/core/stages.go:288 +0xc5
cogentcore.org/core/core.(*RenderWindow).RenderWindow(0x87114e0f0)
    /da/go/src/cogentcore.org/core/core/renderwindow.go:823 +0xb6
cogentcore.org/core/core.(*RenderWindow).HandleWindowEvents(0x87114e0f0, {0x7d56b8, 0x8c0949dc0})
    /da/go/src/cogentcore.org/core/core/renderwindow.go:504 +0x479
cogentcore.org/core/core.(*RenderWindow).HandleEvent(0x87114e0f0, {0x7d56b8, 0x8c0949dc0})
    /da/go/src/cogentcore.org/core/core/renderwindow.go:488 +0x11c
cogentcore.org/core/core.(*RenderWindow).EventLoop(0x87114e0f0)
    /da/go/src/cogentcore.org/core/core/renderwindow.go:456 +0x87
created by cogentcore.org/core/core.(*RenderWindow).GoStartEventLoop in goroutine 14
    /da/go/src/cogentcore.org/core/core/renderwindow.go:415 +0x65

2024/07/02 12:50:54 ----- END OF STACK TRACE -----
2024/07/02 12:50:54 SAVED CRASH LOG TO /root/.config/Hello/crash-logs/crash_2024-07-02_12-50-54
2024/07/02 12:52:33 panic: runtime error: slice bounds out of range [-2147474456:]
2024/07/02 12:52:33 
2024/07/02 12:52:33 ----- START OF STACK TRACE: -----
2024/07/02 12:52:33 goroutine 689 [running]:
runtime/debug.Stack()
    /usr/local/go122/src/runtime/debug/stack.go:24 +0x5e
cogentcore.org/core/system.HandleRecoverBase({0x30d2e0, 0x8c36a7530})
    /da/go/src/cogentcore.org/core/system/recover.go:50 +0x4b
cogentcore.org/core/core.HandleRecover({0x30d2e0, 0x8c36a7530})
    /da/go/src/cogentcore.org/core/core/recover.go:33 +0x4b
cogentcore.org/core/core.(*RenderWindow).EventLoop.func1()
    /da/go/src/cogentcore.org/core/core/renderwindow.go:442 +0x24
panic({0x30d2e0?, 0x8c36a7530?})
    /usr/local/go122/src/runtime/panic.go:770 +0x132
golang.org/x/image/vector.(*Rasterizer).floatingLineTo(0x8c0e65050, 0x0?, 0x0?)
    /da/go/src/golang.org/x/image/vector/raster_floating.go:74 +0x637
golang.org/x/image/vector.(*Rasterizer).LineTo(0x8c0e65050?, 0x45c49960?, 0x4739c714?)
    /da/go/src/golang.org/x/image/vector/vector.go:189 +0x19
golang.org/x/image/font/opentype.(*Face).Glyph(0x8c0e64a08, {0x0?, 0x0?}, 0xc0e650b0?)
    /da/go/src/golang.org/x/image/font/opentype/opentype.go:230 +0x46d
cogentcore.org/core/paint.(*Text).Render(0x8c07d1dc8, 0x873e34e70, {0xc23bb770?, 0x8?})
    /da/go/src/cogentcore.org/core/paint/text.go:197 +0x17dd
cogentcore.org/core/core.(*TextField).Render(0x8c07d1208)
    /da/go/src/cogentcore.org/core/core/textfield.go:1947 +0x526
cogentcore.org/core/core.(*Frame).RenderWidget(0x8c07d1208)
    /da/go/src/cogentcore.org/core/core/frame.go:194 +0x9d
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x7d1278?, 0x8c07d1208?}, 0x0?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x13a9cc5?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x8c05fd008?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x8c05fd008)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x268ca6a08098?, 0x8c05fd008?}, 0x8baf059d8?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x14de73e?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x1627190?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x8baf05808)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x7d1d70?, 0x8baf05808?}, 0x8baead6d8?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x147f99e?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x1627190?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x8baead508)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Frame).RenderChildren.func1(0x16290d0?, {0x7d15d8?, 0x8baead508?}, 0x873e34558?)
    /da/go/src/cogentcore.org/core/core/frame.go:187 +0x24
cogentcore.org/core/core.(*WidgetBase).WidgetKidsIter(0x146e09e?, 0x701bf0)
    /da/go/src/cogentcore.org/core/core/widget.go:463 +0xc3
cogentcore.org/core/core.(*Frame).RenderChildren(0x1627190?)
    /da/go/src/cogentcore.org/core/core/frame.go:186 +0x45
cogentcore.org/core/core.(*Frame).RenderWidget(0x873e34388)
    /da/go/src/cogentcore.org/core/core/frame.go:196 +0xc5
cogentcore.org/core/core.(*Scene).LayoutRenderScene(0x873e34388)
    /da/go/src/cogentcore.org/core/core/render.go:177 +0x25
cogentcore.org/core/core.(*Scene).DoUpdate(0x873e34388)
    /da/go/src/cogentcore.org/core/core/render.go:243 +0x1fa
cogentcore.org/core/core.(*Stage).DoUpdate(0x8baf71208?)
    /da/go/src/cogentcore.org/core/core/stage.go:324 +0x57
cogentcore.org/core/core.(*Stages).UpdateAll(0x8baeaf7a0)
    /da/go/src/cogentcore.org/core/core/stages.go:288 +0xc5
cogentcore.org/core/core.(*RenderWindow).RenderWindow(0x8baeaf770)
    /da/go/src/cogentcore.org/core/core/renderwindow.go:823 +0xb6
cogentcore.org/core/core.(*RenderWindow).HandleWindowEvents(0x8baeaf770, {0x7d56b8, 0x8c2fc1ea0})
    /da/go/src/cogentcore.org/core/core/renderwindow.go:504 +0x479
cogentcore.org/core/core.(*RenderWindow).HandleEvent(0x8baeaf770, {0x7d56b8, 0x8c2fc1ea0})
    /da/go/src/cogentcore.org/core/core/renderwindow.go:488 +0x11c
cogentcore.org/core/core.(*RenderWindow).EventLoop(0x8baeaf770)
    /da/go/src/cogentcore.org/core/core/renderwindow.go:456 +0x87
created by cogentcore.org/core/core.(*RenderWindow).GoStartEventLoop in goroutine 733
    /da/go/src/cogentcore.org/core/core/renderwindow.go:415 +0x65

2024/07/02 12:52:33 ----- END OF STACK TRACE -----
2024/07/02 12:52:33 SAVED CRASH LOG TO /root/.config/Hello/crash-logs/crash_2024-07-02_12-52-33

Platform

macOS

kkoreilly commented 4 months ago

I will look into this.

gedw99 commented 2 months ago

I run freebsd with UTM on a MAC btw. works great.

make it easy to debug across OS systems.

Even windows xp, 10 and 11 runs fine as ARM and AMD versions

kkoreilly commented 2 months ago

Yes, I will try this using UTM once I have the time.