~raff


#126 MacOS: panic when clicking on "Flat" button in kitchen example 2 days ago

Ticket created by ~raff on ~eliasnaur/gio

MacOS 10.15.6 Beta, latest gio. This is the stack trace:

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

goroutine 1 [running, locked to thread]: gioui.org/app/internal/window.nsstringToString.func3(0x7fff8a821f60, 0x452c630, 0x0, 0x0, 0x0) /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/internal/window/osdarwin.go:77 +0x63 gioui.org/app/internal/window.nsstringToString(0x7fff8a821f60, 0x0, 0x0) /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/internal/window/osdarwin.go:77 +0xb6 gioui.org/app/internal/window.(*window).ReadClipboard.func1() /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/internal/window/osmacos.go:97 +0x30 gioui.org/app/internal/window.giodispatchMainFuncs() /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/internal/window/osdarwin.go:64 +0x29 gioui.org/app/internal/window.cgoexpwrap319e3ce2285agio_dispatchMainFuncs() cgogotypes.go:451 +0x20 gioui.org/app/internal/window.Cfuncgio_main(0x4613950, 0x5b0de40, 0x4089000000000000, 0x4084500000000000) cgogotypes.go:234 +0x45 gioui.org/app/internal/window.Main.func2(0x4613950, 0x5b0de40, 0x320, 0x28a) /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/internal/window/osmacos.go:304 +0x5b gioui.org/app/internal/window.Main() /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/internal/window/osmacos.go:304 +0x1a7 gioui.org/app.Main(...) /Users/rsena/go/pkg/mod/gioui.org@v0.0.0-20200602130704-4cb96ccad910/app/app.go:45 main.main() /Users/rsena/go/src/gioui.org/example/kitchen/kitchen.go:78 +0x1ae exit status 2

This is the affected code:

func nsstringToString(str C.CFTypeRef) string {
    defer C.CFRelease(str)
    n := C.gio_nsstringLength(str)
    chars := make([]uint16, n)
    C.gio_nsstringGetCharacters(str, (*C.unichar) (unsafe.Pointer(&chars[0])), 0, n) // <==== panic
    utf8 := utf16.Decode(chars)
    return string(utf8)
}

It looks like nsstringToString is called with an empty str. Should probably add a check on string length and return "" if 0.

#49 Raspbian / Raspberry pi: floating point fbos not supported 3 months ago

Comment by ~raff on ~eliasnaur/gio

Same error on MacOS Catalina on MacBook Pro 15" 2016

#45 Mispelled direction 7 months ago

Ticket created by ~raff on ~eliasnaur/gio

#44 Invalid processing of "east" direction in layout.Format("stack") 7 months ago

Ticket created by ~raff on ~eliasnaur/gio

Because of the check in https://git.sr.ht/~eliasnaur/gio/tree/master/layout/format.go#L200 (case e), it's not possible to create a format stack(east, r(_). Getting error:

panic: expected e( [recovered] panic: Format: stack(✗east, r()):6: expected e( [recovered] panic: Format: stack(✗east, r()):6: expected e(