matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.49k stars 643 forks source link

Crash when using `image=[base64]` #837

Open rossburton opened 2 years ago

rossburton commented 2 years ago

I wanted to display a row in the dropdown with an icon, so did foo | image=[base64 string]. This crashed xbar:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x5cc7c47e0e80 pc=0x1a9eb04b0]

runtime stack:
runtime.throw({0x1028774c1, 0x2a})
        /usr/local/go/src/runtime/panic.go:1198 +0x54
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:719 +0x230

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x1028488b0, 0x14000223d08)
        /usr/local/go/src/runtime/cgocall.go:156 +0x50 fp=0x14000223cc0 sp=0x14000223c80 pc=0x1024b8530
github.com/wailsapp/wails/v2/internal/ffenestri._Cfunc_Run(0x147f04c00, 0x0, 0x0)
        _cgo_gotypes.go:371 +0x40 fp=0x14000223d00 sp=0x14000223cc0 pc=0x10282c310
github.com/wailsapp/wails/v2/internal/ffenestri.(*Application).Run.func7(0x147f04c00)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/ffenestri/ffenestri.go:162 +0x58 fp=0x14000223d40 sp=0x14000223d00 pc=0x10282db18
github.com/wailsapp/wails/v2/internal/ffenestri.(*Application).Run(0x1400015c8c0, {0x102ce13a0, 0x14000139540}, {0x14000185500, 0xa5c}, 0x0)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/ffenestri/ffenestri.go:162 +0x42c fp=0x14000223db0 sp=0x14000223d40 pc=0x10282da4c
github.com/wailsapp/wails/v2/internal/app.(*App).Run(0x140001611e0)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/app/desktop.go:234 +0x620 fp=0x14000223e60 sp=0x14000223db0 pc=0x10283b300
github.com/wailsapp/wails/v2.Run(0x14000210000)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/wails.go:31 +0x58 fp=0x14000223e90 sp=0x14000223e60 pc=0x10283b658
main.run()
        /Users/matryer/Code/go/src/github.com/matryer/xbar/app/main.go:37 +0x478 fp=0x14000223f00 sp=0x14000223e90 pc=0x102842e38
main.main()
        /Users/matryer/Code/go/src/github.com/matryer/xbar/app/main.go:20 +0x60 fp=0x14000223f70 sp=0x14000223f00 pc=0x102842910
runtime.main()
        /usr/local/go/src/runtime/proc.go:255 +0x284 fp=0x14000223fd0 sp=0x14000223f70 pc=0x1024ecb74
runtime.goexit()
        /usr/local/go/src/runtime/asm_arm64.s:1133 +0x4 fp=0x14000223fd0 sp=0x14000223fd0 pc=0x10251cd14

goroutine 21 [select]:
github.com/wailsapp/wails/v2/internal/servicebus.(*ServiceBus).Start.func1(0x140001348a0)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/servicebus/servicebus.go:83 +0xf8
created by github.com/wailsapp/wails/v2/internal/servicebus.(*ServiceBus).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/servicebus/servicebus.go:77 +0xb4

goroutine 50 [syscall]:
os/signal.signal_recv()
        /usr/local/go/src/runtime/sigqueue.go:166 +0x34
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:24 +0x20
created by os/signal.Notify.func1.1
        /usr/local/go/src/os/signal/signal.go:151 +0x38

goroutine 22 [select]:
github.com/wailsapp/wails/v2/internal/subsystem.(*Runtime).Start.func1(0x140001f37a0)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/runtime.go:76 +0x110
created by github.com/wailsapp/wails/v2/internal/subsystem.(*Runtime).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/runtime.go:73 +0x3c

goroutine 23 [select]:
github.com/wailsapp/wails/v2/internal/subsystem.(*Log).Start.func1(0x14000108550)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/log.go:68 +0xf0
created by github.com/wailsapp/wails/v2/internal/subsystem.(*Log).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/log.go:64 +0x58

goroutine 24 [select]:
github.com/wailsapp/wails/v2/internal/messagedispatcher.(*Dispatcher).Start.func1(0x14000139540)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/messagedispatcher/messagedispatcher.go:118 +0x16c
created by github.com/wailsapp/wails/v2/internal/messagedispatcher.(*Dispatcher).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/messagedispatcher/messagedispatcher.go:115 +0x88

goroutine 25 [select]:
github.com/wailsapp/wails/v2/internal/subsystem.(*URL).Start.func1(0x14000108820)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/url.go:66 +0xf8
created by github.com/wailsapp/wails/v2/internal/subsystem.(*URL).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/url.go:62 +0x58

goroutine 26 [select]:
github.com/wailsapp/wails/v2/internal/subsystem.(*Event).Start.func1(0x140001088c0)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/event.go:89 +0xf4
created by github.com/wailsapp/wails/v2/internal/subsystem.(*Event).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/event.go:86 +0x88

goroutine 27 [select]:
github.com/wailsapp/wails/v2/internal/subsystem.(*Menu).Start.func1(0x14000108960)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/menu.go:72 +0xf4
created by github.com/wailsapp/wails/v2/internal/subsystem.(*Menu).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/menu.go:69 +0x88

goroutine 28 [select]:
github.com/wailsapp/wails/v2/internal/subsystem.(*Call).Start.func1(0x14000108a00)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/call.go:77 +0x100
created by github.com/wailsapp/wails/v2/internal/subsystem.(*Call).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/call.go:74 +0x54

goroutine 35 [select]:
github.com/wailsapp/wails/v2/internal/signal.(*Manager).Start.func1(0x1400015d140)
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/signal/signal.go:59 +0x7c
created by github.com/wailsapp/wails/v2/internal/signal.(*Manager).Start
        /Users/matryer/Code/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/signal/signal.go:58 +0xb0

goroutine 84 [semacquire]:
sync.runtime_Semacquire(0x1400023e638)
        /usr/local/go/src/runtime/sema.go:56 +0x38
sync.(*WaitGroup).Wait(0x1400023e630)
        /usr/local/go/src/sync/waitgroup.go:130 +0xa4
github.com/matryer/xbar/pkg/plugins.(*Plugin).Run(0x14000210540, {0x102cea1f8, 0x1400015d440})
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:237 +0x230
github.com/matryer/xbar/pkg/plugins.Plugins.Run.func1({0x102cea1f8, 0x1400015d440}, 0x1400023f9a0, 0x14000210540)
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:112 +0x38
created by github.com/matryer/xbar/pkg/plugins.Plugins.Run
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:111 +0x90

goroutine 82 [semacquire]:
sync.runtime_Semacquire(0x1400023f9a8)
        /usr/local/go/src/runtime/sema.go:56 +0x38
sync.(*WaitGroup).Wait(0x1400023f9a0)
        /usr/local/go/src/sync/waitgroup.go:130 +0xa4
github.com/matryer/xbar/pkg/plugins.Plugins.Run({0x1400047a1c0, 0x1, 0x2}, {0x102cea1f8, 0x1400015d440})
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:116 +0xb0
main.(*app).RefreshAll.func1(0x140002004e0, {0x102cea1f8, 0x1400015d440})
        /Users/matryer/Code/go/src/github.com/matryer/xbar/app/app.go:254 +0x4c
created by main.(*app).RefreshAll
        /Users/matryer/Code/go/src/github.com/matryer/xbar/app/app.go:251 +0x7a0

goroutine 83 [sleep]:
time.Sleep(0x2540be400)
        /usr/local/go/src/runtime/time.go:193 +0x138
main.(*app).Start.func2(0x140002004e0)
        /Users/matryer/Code/go/src/github.com/matryer/xbar/app/app.go:186 +0x30
created by main.(*app).Start
        /Users/matryer/Code/go/src/github.com/matryer/xbar/app/app.go:184 +0x23c

goroutine 43 [select]:
github.com/matryer/xbar/pkg/plugins.(*Plugin).Run.func1(0x1400023e630, 0x1400008fb60, 0x14000210540, {0x102cea1f8, 0x1400015d440})
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:201 +0xd4
created by github.com/matryer/xbar/pkg/plugins.(*Plugin).Run
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:198 +0x1d0

goroutine 44 [select]:
github.com/matryer/xbar/pkg/plugins.(*Plugin).Run.func2(0x1400023e630, 0x14000210540, {0x102cea1f8, 0x1400015d440}, 0x1400008fb60)
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:223 +0x228
created by github.com/matryer/xbar/pkg/plugins.(*Plugin).Run
        /Users/matryer/Code/go/src/github.com/matryer/xbar/pkg/plugins/plugin.go:220 +0x224
rossburton commented 2 years ago

Ah, I think this is because the image is a SVG, switching to a PNG solved it.

leaanthony commented 2 years ago

Shouldn't crash though. Thanks for raising this