libvaxis icon indicating copy to clipboard operation
libvaxis copied to clipboard

fix: avoid deadlock on winsize signal

Open ShuP1 opened this issue 3 months ago • 3 comments

use an eventfd so than winsize event is sent from input thread

fixes https://github.com/rockorager/libvaxis/issues/218

ShuP1 avatar Sep 15 '25 17:09 ShuP1

What is the deadlock you are getting? I don't think this is the correct approach given that it provides a very specific path for Linux only. But I want to understand what the actual problem is better before reviewing much more.

rockorager avatar Sep 19 '25 22:09 rockorager

https://github.com/rockorager/libvaxis/issues/218#issuecomment-3275267505

ShuP1 avatar Sep 20 '25 10:09 ShuP1

I just got this trace when resizing the window rapidly on macOS 26.0.1 (M1 MacBook Pro):

thread 53557354 panic: Deadlock detected
???:?:?: 0x100f1b49f in _main.panic__struct_2437.panicMaybeToFile (???)
???:?:?: 0x100f22263 in _Thread.Mutex.lock (???)
???:?:?: 0x100ff5e2b in _queue.Queue(vxfw.vxfw.Event,512).push (???)
???:?:?: 0x100fda6af in _Loop.Loop(vxfw.vxfw.Event).postEvent (???)
???:?:?: 0x100fc8917 in _Loop.Loop(vxfw.vxfw.Event).winsizeCallback (???)
???:?:?: 0x100fb0cff in _tty.PosixTty.handleWinch (???)
???:?:?: 0x18e78e743 in ??? (libsystem_platform.dylib)
???:?:?: 0x100fb91d7 in _vxfw.App.run (???)
???:?:?: 0x100fb52a3 in _main.main (???)
???:?:?: 0x100fba983 in _main (???)
???:?:?: 0x18e3c5d53 in ??? (???)
???:?:?: 0x0 in ??? (???)

Justus2308 avatar Oct 20 '25 22:10 Justus2308