#14105 closed defect (fixed)

GRAPHICS: ScummVM crash when I activate Opengl for GUI

Reported by: legluondunet Owned by: lephilousophe
Priority: normal Component: Graphics
Version: Keywords:
Cc: Game:

Description

Hello,
If I activate Opengl for ScummVM gui, it immediatly crashes.

I joind log.

My config:
OS: Manjaro 22.0.2 Sikaris
Kernel: x86_64 Linux 6.1.9-1-MANJARO
CPU: AMD Ryzen 9 5900HX with Radeon Graphics @ 16x 3.3GHz
GPU: AMD Radeon RX 6600M (navi23, LLVM 15.0.7, DRM 3.49, 6.1.9-1-MANJARO)
Video drivers: Mesa 22.3.4

Attachments (2)

scummvm.log (6.9 KB ) - added by legluondunet 15 months ago.
scummvm logs.zip (5.7 KB ) - added by legluondunet 15 months ago.

Download all attachments as: .zip

Change History (15)

comment:1 by legluondunet, 15 months ago

$ ./scummvm -d 2
Debuglevel (from command line): 2
WARNING: Couldn't initialize text to speech through speech-dispatcher!
Using SDL Video Driver "x11"
Using SDL Audio Driver "pulseaudio"
Output sample rate: 44100 Hz
Output buffer size: 1024 samples
Output channels: 2
HardwareInput with ID 'JOY_START' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y-' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y+' not known
HardwareInput with ID 'JOY_LEFT_STICK_X-' not known
HardwareInput with ID 'JOY_LEFT_STICK_X+' not known
HardwareInput with ID 'JOY_RIGHT_SHOULDER' not known
generateZipSet: Loaded pack file: gui-icons-20221010.dat
generateZipSet: Loaded pack file: gui-icons-20220802.dat
generateZipSet: Loaded pack file: gui-icons-20220602.dat
generateZipSet: Loaded pack file: gui-icons-20211112.dat
WARNING: generateZipSet: Could not find 'gui-icons.dat'!
HardwareInput with ID 'JOY_A' not known
HardwareInput with ID 'JOY_Y' not known
HardwareInput with ID 'JOY_UP' not known
HardwareInput with ID 'JOY_DOWN' not known
HardwareInput with ID 'JOY_LEFT' not known
HardwareInput with ID 'JOY_RIGHT' not known
HardwareInput with ID 'JOY_START' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y-' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y+' not known
HardwareInput with ID 'JOY_LEFT_STICK_X-' not known
HardwareInput with ID 'JOY_LEFT_STICK_X+' not known
HardwareInput with ID 'JOY_RIGHT_SHOULDER' not known
HardwareInput with ID 'JOY_A' not known
HardwareInput with ID 'JOY_Y' not known
HardwareInput with ID 'JOY_UP' not known
HardwareInput with ID 'JOY_DOWN' not known
HardwareInput with ID 'JOY_LEFT' not known
HardwareInput with ID 'JOY_RIGHT' not known
HardwareInput with ID 'JOY_START' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y-' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y+' not known
HardwareInput with ID 'JOY_LEFT_STICK_X-' not known
HardwareInput with ID 'JOY_LEFT_STICK_X+' not known
HardwareInput with ID 'JOY_RIGHT_SHOULDER' not known
HardwareInput with ID 'JOY_A' not known
HardwareInput with ID 'JOY_Y' not known
HardwareInput with ID 'JOY_UP' not known
HardwareInput with ID 'JOY_DOWN' not known
HardwareInput with ID 'JOY_LEFT' not known
HardwareInput with ID 'JOY_RIGHT' not known
switching to OpenGL graphics
WARNING: generateZipSet: Could not find 'shaders.dat'!
WARNING: generateZipSet: Could not find 'shaders.dat'!
WARNING: generateZipSet: Could not find 'shaders.dat'!
HardwareInput with ID 'JOY_START' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y-' not known
HardwareInput with ID 'JOY_LEFT_STICK_Y+' not known
HardwareInput with ID 'JOY_LEFT_STICK_X-' not known
HardwareInput with ID 'JOY_LEFT_STICK_X+' not known
HardwareInput with ID 'JOY_RIGHT_SHOULDER' not known
HardwareInput with ID 'JOY_A' not known
HardwareInput with ID 'JOY_Y' not known
HardwareInput with ID 'JOY_UP' not known
HardwareInput with ID 'JOY_DOWN' not known
HardwareInput with ID 'JOY_LEFT' not known
HardwareInput with ID 'JOY_RIGHT' not known
scummvm: ./common/rect.h :160 : Common::Rect::Rect(int16, int16, int16, int16): l'assertion « isValidRect() » a échoué.
Abandon (core dumped)

comment:2 by legluondunet, 15 months ago

scummvm git version form today 04/03/2023

comment:3 by legluondunet, 15 months ago

Last edited 15 months ago by legluondunet (previous) (diff)

comment:4 by dwatteau, 15 months ago

Hi,

Can you attach a log with the output from "./scummvm -d6" instead? This will give us more OpenGL information, which could be helpful.

Thank you.

comment:5 by dwatteau, 15 months ago

Component: --Unset--Graphics
Summary: ScummVM crash when I activate Opengl for GUIGRAPHICS: ScummVM crash when I activate Opengl for GUI

by legluondunet, 15 months ago

Attachment: scummvm.log added

comment:6 by legluondunet, 15 months ago

issue reproduced with command scummvm -d 6, log joined

comment:7 by lephilousophe, 15 months ago

The log has no backtrace so it's difficult to say where it aborts.
Could you:

  • add --enable-asan to your configure command? (This would help us to make sure everything is properly initialized)
  • run ScummVM under GDB?

For GDB, run the command gdb ./scummvm
At the gdb prompt, type run -d6 --gfx-mode=opengl.
When the program crash, gdb will give the invite back and here type bt.
Copy everything in a log file.

Thanks.

comment:8 by legluondunet, 15 months ago

without gdb:

./scummvm
WARNING: Couldn't initialize text to speech through speech-dispatcher!

=================================================================
==64455==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 126 byte(s) in 1 object(s) allocated from:

#0 0x7fdee5ebfa89 in interceptor_malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7fdee4294758 (/usr/lib/libc.so.6+0x7b758)
#2 0xc97d3080f7b540ff (<unknown module>)

Direct leak of 88 byte(s) in 1 object(s) allocated from:

#0 0x7fdee5ebfa89 in interceptor_malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7fdee3b3957b in pa_xmalloc (/usr/lib/libpulse.so.0+0x3657b)

Direct leak of 14 byte(s) in 1 object(s) allocated from:

#0 0x7fdee5e72faa in interceptor_strdup /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_interceptors.cpp:439
#1 0x7fdedbd941a5 (/usr/lib/dri/radeonsi_dri.so+0x7941a5)

SUMMARY: AddressSanitizer: 228 byte(s) leaked in 3 allocation(s).

comment:9 by legluondunet, 15 months ago

Like you asked I compiled today's scummvm git using add --enable-asan to configure.

I joined you configure log and gdb log.

by legluondunet, 15 months ago

Attachment: scummvm logs.zip added

comment:10 by lephilousophe, 15 months ago

Owner: set to lephilousophe
Resolution: fixed
Status: newpending

I managed to replicate the bug and fix it in ecea1d5c396f51617ec4c55ae80d30979575e583 for master and 14d47b8b2c0abe925881d297ba0c8915c7bd4015 for stable.
Can you confirm?

Anyway, you have a strange DPI value, it is really low.
I suspect that the EDID provided by your display screen is bogus.
This is the reason why you were the first to be hit by the bug.

comment:11 by antoniou79, 15 months ago

I got a similar crash today while debugging on Windows 10 x64 with WSL2 (Ubuntu 20.04.5 LTS, kernel 5.10.16.3-microsoft-standard-WSL2).

My setup uses a "Windows X server" app (VcXsrv, version 1.20.14.0) to display the graphic windows launched from the WSL environment, and apparently it gets hit by the same bug.

It didn't crash as soon as I enabled OpenGL mode, but if I then clicked on "Global Options" button, it would crash.

From my side, I can confirm the issue fixed with lephilousophe's commit above.

Also, this is just for the record and anyone that might run into the same issue as me: since DPI was not reported correctly on my setup, I kept getting super small fonts in the ScummVM GUI and at first I had to manually set "gui_scale" from scummvm.ini (under ~/.config/scummvm/scummvm.ini) to something extreme like "600"). This would work, but as soon as I'd Ok anything under Global Options, it would again reset to one of the preset ScummVM values (which only go up to "150", as far as I can tell).
It turns out this was an issue with Windows high DPI scaling (or some such) and I resolved this by overriding Windows' High DPI Scaling, setting the scaling to be performed by "Application" for the "vcxsrv.exe" app (under Properties->Compatibility (Tab)->Change High DPI Settings").
For reference, this post helped me solved the scaling issue: https://sourceforge.net/p/vcxsrv/discussion/986201/thread/86c22a03/

comment:12 by legluondunet, 15 months ago

I can confirm that you fixed this bug, nice work.
But like you said and like Antoniou confirmed, it seems there is an issue with ScummVM and gui scaling with OpenGL, not only on Windows, but on Linux too.

I will open a new bug for this issue.

Thank you for your help "le Philousophe" j'aime beaucoup ton pseudo, je le trouve rigolo

comment:13 by sev-, 15 months ago

Status: pendingclosed
Note: See TracTickets for help on using tickets.