VT problem with mpv and links
alex3kov opened this issue · comments
I'm on Parabola (Arch). Links = this browser http://links.twibright.com/, it's in Arch repos.
In console:
Running mpv --gpu-context=drm video.mp4
and xlinks -g
both work fine, without warnings.
In yaft:
Running mpv --gpu-context=drm video.mp4
prints out this warning (I can provide verbose log as well) but otherwise works fine:
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
When I tried xlinks -g
first time it printed some warning about VT as well. Every time I tried after that it just completely locks up yaft - I can't switch to another TTY with Ctrl-Alt-Fx, Ctrl-C/Q/Esc doesn't work. The only way out is hard reset.
Yup, that seems like a bug alright! Here's a clip from valgrind/gdb session:
Program received signal SIGSEGV, Segmentation fault.
0x000000000010cadc in erase_cell (term=0x1ffef44c70, y=-9952, x=0) at /home/arch/tmp/yaft/terminal.h:7
7 cellp->glyphp = term->glyph[DEFAULT_CHAR];
...so, y is -9952? Doesn't seem right to me. The value is set in the scroll() function, line 105.
Seems like it's missing a bounds check.
EDIT: Do note that the Links fb init problem is a separate issue. VT_GETMODE bombs out with ENOTTY (I don't know why).
Links can be patched to ignore the return value of VT_GETMODE and VT_SETMODE (framebuf.c, just use ioctl() without the EINTRLOOP bit).
That doesn't fix the underlying issue, but at least Links gets a chance to run.