Forums » Bugs

VO crash on start 1.8.651

Jul 18, 2023 Xeha link
When wanting to start VO after the update, it crashes immediately.

config wise:
windowed mode, xf86vidmode=0, custom x/ysize

main: 0x430110
Setting up signal handlers...done.
loaded media.rlb
loaded media6.rlb
loaded demos.rlb
archive returned 0
build date Jul 6 2023 20:56:54
[Mon Jul 17 23:53:16 2023] Found driver: "OpenGL 4 GKGL driver". Type 5, Version 150.0. Load @0x021d0e80
[Mon Jul 17 23:53:16 2023] Instantiate address: 0x7f83a625c120
[Mon Jul 17 23:53:16 2023] Found driver: "OpenGL Reference GKGL driver". Type 5, Version 150.0. Load @0x021d5d10
[Mon Jul 17 23:53:16 2023] Instantiate address: 0x7f83a5c229e0
[Mon Jul 17 23:53:16 2023] Found driver: "ALSA driver". Type 1, Version 10.1. Load @0x021d76c0
[Mon Jul 17 23:53:16 2023] Instantiate address: 0x7f83a5802390
[Mon Jul 17 23:53:16 2023] Found driver: "Open Sound System driver". Type 1, Version 10.1. Load @0x021d8490
[Mon Jul 17 23:53:16 2023] Instantiate address: 0x7f83a5401bc0
sigsegv_trap

caught SIGSEGV; generating stack trace
fault address 0x8, 00000000, 00000001
cr2 0x0000000000000008 8
oldmask 0x0000000000000000 0
trapno 0x000000000000000e 14
err 0x0000000000000004 4
csgsfs 0x002b000000000033 12103423998558259
efl 0x0000000000010246 66118
rip 0x00007f83a5c35202 140203398484482
rsp 0x00007fffef0fadb0 140737204170160
rcx 0x0000000000000007 7
rax 0x0000000000000000 0
rdx 0x000000000228a9c1 36219329
rbx 0x00000000021d0210 35455504
rbp 0x0000000000000000 0
rsi 0x0000000000000006 6
rdi 0x0000000000000005 5
r15 0x00000000021d0320 35455776
r14 0x0000000000000006 6
r13 0x0000000000000030 48
r12 0x000000000234fd00 37027072
r11 0x0000000000000293 659
r10 0x8e327ddef845ade3 -8200353574886724125
r9 0x0000000002291220 36246048
r8 0x0000000000000007 7
Jul 18, 2023 Luxen link
What kind of system are you running to get this, Xeha?
Jul 18, 2023 raybondo link
Try adding xrandr=0 to your [gl4] or [refgl] config.ini settings (whichever one you're trying to use, or add it to both).
That will bypass the use of the X RandR extension, so we can see if that's the cause of your problem.
Jul 19, 2023 incarnate link
But, regardless of whether that workaround helps, please post specific details about your system.
Jul 19, 2023 Xeha link
disabling xrandr in refgl section worked.

Linux 4.19.284-x86_64 amd64
binary nvidia 470.199.02
libXrandr 1.5.3
xorg-server 21.1.8
gblic 2.37

xrandr itself works (manually, for wine, etc).
monitor config via xrandr:
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected primary (normal left inverted right x axis y axis)
DVI-I-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
1920x1080 60.00*+
1680x1050 59.95
1440x900 74.98 59.89
1280x1024 75.02 60.02
1280x960 60.00
1280x720 60.00
1152x864 75.00
1024x768 75.03 70.07 60.00
800x600 75.00 72.19 60.32 56.25
640x480 75.00 72.81 59.94
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
Jul 19, 2023 incarnate link
Could you please share what distribution and version you're using? A number of distributions offered the 4.19.284 kernel at some point (although that's a pretty old kernel these days).

Also, what kind of hardware are you using?
Jul 19, 2023 Xeha link
Gentoo (X11, not wayland) and a NVIDIA GK110 [GeForce GTX TITAN]
4.19.284 is from 30.05.2023, so not that old fix-wise. Tested a newer one (6.1.38) and its the same.

It does call XRRQueryVersion and later it crashes in gkgl.so OpenGLRef::EnumerateModes. Cant say more as it obviously dosnt have debug symbols. I could send a coredump if need be? But not in the forums...
Jul 20, 2023 abortretryfail link
I was pinged on Discord to provide more information about this, since it's affecting me too.

~/.vendetta/errors.log:
====================================
main: 0x430110
Setting up signal handlers...done.
loaded media.rlb
loaded media6.rlb
loaded demos.rlb
archive returned 0
build date Jul 6 2023 20:56:54
[Thu Jul 20 12:43:19 2023] Found driver: "OpenGL Reference GKGL driver". Type 5, Version 150.0. Load @0x0263e9e0
[Thu Jul 20 12:43:19 2023] Instantiate address: 0x7f9fe46229e0
[Thu Jul 20 12:43:19 2023] Found driver: "OpenGL 4 GKGL driver". Type 5, Version 150.0. Load @0x02644400
[Thu Jul 20 12:43:19 2023] Instantiate address: 0x7f9fdfc5c120
[Thu Jul 20 12:43:19 2023] Found driver: "ALSA driver". Type 1, Version 10.1. Load @0x02644b70
[Thu Jul 20 12:43:19 2023] Instantiate address: 0x7f9fdf802390
[Thu Jul 20 12:43:19 2023] Found driver: "Open Sound System driver". Type 1, Version 10.1. Load @0x02646380
[Thu Jul 20 12:43:19 2023] Instantiate address: 0x7f9fdf401bc0
sigsegv_trap

caught SIGSEGV; generating stack trace
fault address 0x8, 00000000, 00000001
cr2 0x0000000000000008 8
oldmask 0x0000000000000000 0
trapno 0x000000000000000e 14
err 0x0000000000000004 4
csgsfs 0x002b000000000033 12103423998558259
efl 0x0000000000010246 66118
rip 0x00007f9fdfc92c52 140324631030866
rsp 0x00007ffd9f051cb0 140727271365808
rcx 0x00000000026fe334 40887092
rax 0x0000000000000000 0
rdx 0x0000000000000005 5
rbx 0x000000000263dd40 40099136
rbp 0x0000000000000000 0
rsi 0x00000000024f9010 38768656
rdi 0x0000000000000007 7
r15 0x000000000263e500 40101120
r14 0x0000000000000002 2
r13 0x0000000000000010 16
r12 0x00000000029d2e10 43855376
r11 0x2129f3b274fe1dd0 2389709025089297872
r10 0x000000000000001f 31
r9 0x0000000000000000 0
r8 0x0000000002704aa0 40913568
====================================

xrandr --query
====================================
Screen 0: minimum 16 x 16, current 2820 x 1440, maximum 32767 x 32767
DVI-D-1 connected 900x1440+1920+0 left (normal left inverted right x axis y axis) 410mm x 260mm
1440x900 74.85*+
1152x864 74.82
1024x768 74.90
800x600 74.91
640x480 74.77
320x240 73.82
1280x800 74.93
1152x720 74.72
960x600 74.84
928x580 74.58
800x500 74.87
768x480 74.71
720x480 74.51
640x400 74.23
320x200 73.70
1368x768 74.90
1280x720 74.78
1024x576 74.80
864x486 74.45
720x400 74.23
640x350 74.53
DP-2 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 520mm x 320mm
1920x1200 59.88*+
1600x1200 59.87
1440x1080 59.87
1400x1050 59.86
1280x1024 59.76
1280x960 59.94
1152x864 59.78
1024x768 59.68
800x600 59.86
640x480 59.38
320x240 59.52
1680x1050 59.85
1440x900 59.89
1280x800 59.81
1152x720 59.75
960x600 59.63
928x580 59.88
800x500 59.50
768x480 59.38
720x480 59.71
640x400 59.20
320x200 58.96
1920x1080 59.88
1600x900 59.82
1368x768 59.88
1280x720 59.86
1024x576 59.90
864x486 59.45
720x400 59.55
640x350 59.77
====================================

Relevant config.ini:
====================================
[gl4]
usenonshader=0
textureresolution=-1
aa_mode=1
windowmode=1
vsync=1
numdynamiclights=10
doshadows=1
dossao=0
xrandr=1

[Vendetta]
...
VideoDriver=OpenGL 4 GKGL driver
xres=1920
yres=1200
bpp=24
...
====================================

Changing it to xrandr=0 lets the game run as before, as a 1920x1200 full-screen window.

Software I am running:
- Linux kernel: 6.4.3-arch1-2 (ArchLinux x86-64)
- GL: Mesa 23.1.3
- Wayland compositor: Sway 1.8.1
- X11: Xwayland 23.1.2
Jul 20, 2023 incarnate link
We fixed this yesterday, and it'll be released in tonight's patch.
Jul 21, 2023 Xeha link
Its not working yet for me.
No changes errors.log wise.

X Error of failed request: BadRRCrtc (invalid Crtc parameter)
Major opcode of failed request: 139 (RANDR)
Minor opcode of failed request: 20 (RRGetCrtcInfo)
Crtc id in failed request: 0x0
Serial number of failed request: 34
Current serial number in output stream: 34
Jul 21, 2023 Xeha link
This annoyed me, so i dug a bit deeper into the XRR stuff.

After a bit of fun, i found out whats the issue. If the current screen is not the --primary (or if there's none), it tries to get settings for a disconnected display.

To do this xrandr stuff properly, here's whats needed:
- Get screen config: XRRScreenResources *res = XRRGetScreenResourcesCurrent(disp, win)
- Get and check for a primary monitor: RROutput primary = XRRGetOutputPrimary(disp, win)
- If no primary exists, iterate over res->noutput
- Get output info: XRROutputInfo *output_info XRRGetOutputInfo(disp, res, res->outputs[ i ])
- Find out if its an active display that we can manage: if (output_info->connection == RR_Connected || output_info->crtc != 0)
- Finally call XRRGetCrtcInfo with the right disp

For testing yourself, set an incative display as primary or ensure no primary exists.
Jul 21, 2023 Xeha link
^
also obviously check if there's a display connected to primary...
Jul 21, 2023 incarnate link
Did you patch to 1.8.652? This was fixed yesterday.
Jul 21, 2023 Xeha link
Yes i did. You fixed the segfault issue, but now there's improper use of xrandr.
Jul 21, 2023 incarnate link
Okay, we'll take a look.

For what it's worth, this has tested out properly on all of our Linux hardware and VMs, back to Ubuntu 16. We have tested it against a variety of distributions and "eras".

I don't know if Gentoo has some different, stricter implementation.

There are certainly some unusual aspects to our implementation, which were directly based on working around unusual problems that came up in testing, like window managers that cease to take keyboard input if modes change too quickly. We also have our own fallbacks to xf86vidmode in some cases.

But, we will see if we can improve the implementation for your use case.
Jul 21, 2023 Xeha link
Sorry, took some time... I've tried the same thing on a ubuntu machine (20.04) with binary drivers.

I can still reproduce it this way:
primary isnt set to the active one AND the first display isnt connected (this was the missing key).

So no, im sorry, thats not related to Gentoo. If i force my first entry to be the active one, it works too.

The Crtc ID is either an index in the list, or the XID. Since you use the ID of 0x0 and dont check others (from what i saw of the X11 calls), if the first one isnt connected or there is no active primary, then it will fail.

It might work with nouveau/mesa, i didnt test that now. But i could if thats really necessary.
Jul 21, 2023 storm_titty link
Thank you guys for all this work! Really appreciated from an amateur linux ubuntu user, who most of the time probably doesn't know what they are doing.

Best regards to all parties involved!
Jul 21, 2023 raybondo link
We released update 1.8.652.1 that should work better.
Jul 21, 2023 incarnate link
Thanks for the detailed report, Xeha, that was helpful. We had not tested for cases where the primary display is inactive and the first display isn't connected.

As Ray says, this new version should be improved for your use case.
Jul 22, 2023 Xeha link
Now it works as expected :)