CRT SwitchRes broken in 1.18.0-2: buffer overflow error, crashes
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Description
CRT SwitchRes is broken in 1.18.0-2. In short, enabling CRT SwitchRes will always result in *** buffer overflow detected ***: terminated
zsh: IOT instruction (core dumped). RetroArch crashes and closes immediately.
Full log:
[INFO] [Config]: Looking for config in: "/home/gabriel/.config/retroarch/retroarch.cfg".
[INFO] RetroArch 1.18.0 (Git 06fa5325f8)
[INFO] === Build =======================================
[INFO] CPU Model Name: 13th Gen Intel(R) Core(TM) i7-13700K
[INFO] Capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE42 AES AVX AVX2
[INFO] Version: 1.18.0
[INFO] Git: 06fa5325f8
[INFO] Built: May 5 2024
[INFO] =================================================
[INFO] [Input]: Found input driver: "udev".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[INFO] [Core]: Geometry: 320x240, Aspect: 1.333, FPS: 60.00, Sample rate: 48000.00 Hz.
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Set video size to: fullscreen.
[ERROR] [Wayland]: Failed to connect to Wayland server.
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[INFO] [Vulkan]: Found vulkan context: "vk_x".
[INFO] [Vulkan]: Detecting screen resolution: 1024x768.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [X/Vulkan]: Using Xinerama on screen #0.
[INFO] [X/Vulkan]: X = 0, Y = 0, W = 1024, H = 768.
[INFO] [X/Vulkan]: Requesting compositor bypass.
[INFO] [X/Vulkan]: Using windowed fullscreen.
[INFO] [Vulkan]: Found GPU at index 0: "NVIDIA GeForce GTX 1660 SUPER".
[INFO] [Vulkan]: Found GPU at index 1: "Intel(R) Graphics (RPL-S)".
[INFO] [Vulkan]: Using GPU index 0.
[INFO] [Vulkan]: Using fences for WSI acquire.
[INFO] [Vulkan]: Using GPU: "NVIDIA GeForce GTX 1660 SUPER".
[INFO] [Vulkan]: Queue family 0 supports 16 sub-queues.
[INFO] [Vulkan]: Got 2 swapchain images.
[INFO] [Vulkan]: Got 2 swapchain images.
[INFO] [Vulkan]: Using resolution 1024x768.
[INFO] [Vulkan]: Using RGB565 format.
[INFO] [Vulkan]: Loading stock shader.
[INFO] [udev]: Keyboard #0: "Power Button" (/dev/input/event2).
[INFO] [udev]: Keyboard #1: "Video Bus" (/dev/input/event3).
[INFO] [udev]: Keyboard #2: "Power Button" (/dev/input/event1).
[INFO] [udev]: Keyboard #3: "Sleep Button" (/dev/input/event0).
[INFO] [udev]: Keyboard #4: "Zhuhai Hoksi Technology CO.LTD Durgod Mechanical Keyboard" (/dev/input/event24).
[INFO] [udev]: Keyboard #5: "Zhuhai Hoksi Technology CO.LTD Durgod Mechanical Keyboard System Control" (/dev/input/event25).
[INFO] [udev]: Keyboard #6: "Zhuhai Hoksi Technology CO.LTD Durgod Mechanical Keyboard Consumer Control" (/dev/input/event26).
[INFO] [udev]: Keyboard #7: "Zhuhai Hoksi Technology CO.LTD Durgod Mechanical Keyboard" (/dev/input/event27).
[INFO] [udev]: Keyboard #8: "Compx KYSONA M600" (/dev/input/event17).
[INFO] [udev]: Keyboard #9: "Compx KYSONA M600 Consumer Control" (/dev/input/event20).
[INFO] [udev]: Keyboard #10: "Compx KYSONA M600 System Control" (/dev/input/event21).
[INFO] [udev]: Keyboard #11: "Intel HID events" (/dev/input/event5).
[INFO] [udev]: Mouse/Touch #0: "Compx KYSONA M600" (REL) /dev/input/event23.
[INFO] [udev]: Pad #0 (/dev/input/event4) supports 0 force feedback effects.
[INFO] [Autoconf]: raphnet technologies PSX to USB v1.0 configured in port 1.
[INFO] [udev]: Pad #1 (/dev/input/event15) supports 0 force feedback effects.
[INFO] [Autoconf]: Matheus Fraguas RetroZord configured in port 2.
[INFO] [udev]: Pad #2 (/dev/input/event16) supports 0 force feedback effects.
[INFO] [Autoconf]: Matheus Fraguas RetroZord configured in port 3.
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [DBus]: Suspended screensaver via DBus.
[INFO] [Video]: Found display server: "x11".
[INFO] [ALSA]: Using ALSA version 1.2.11
[INFO] [ALSA]: Using FLOAT_LE sample format for PLAYBACK device "alsa_playback.retroarch"
[INFO] [ALSA]: Period: 4 periods per buffer (384 frames, 3072 bytes)
[INFO] [ALSA]: Buffer size: 1536 frames (12288 bytes)
[INFO] [ALSA]: Can pause: yes.
[INFO] [ALSA]: Initialized PLAYBACK device "alsa_playback.retroarch"
[INFO] [Audio]: Started synchronous audio driver.
[INFO] [Display]: Found display driver: "vulkan".
[INFO] [Playlist]: Loading history file: "/home/gabriel/.config/retroarch/content_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/gabriel/.config/retroarch/content_music_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/gabriel/.config/retroarch/content_video_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/gabriel/.config/retroarch/content_image_history.lpl".
[INFO] [Playlist]: Loading favorites file: "/home/gabriel/.config/retroarch/content_favorites.lpl".
[INFO] [X/Vulkan]: Resized fullscreen resolution to 1024x768.
[INFO] [CRT]: Requested Resolution: 320x240@60.000000 orientation: normal
[INFO] [CRT] Video context is: vk_x
*** buffer overflow detected ***: terminated
zsh: IOT instruction (core dumped)
Expected behavior
CRT SwitchRes should work properly (RetroArch should be capable of on-the-fly resolution switching), as it worked fine in 1.18.0-1.
Actual behavior
Everytime CRT SwitchRes is enabled, RetroArch crashes.
Steps to reproduce the bug
- Open RetroArch
- Enable CRT SwitchRes (Settings > Video > CRT SwitchRes > CRT SwitchRes > choose any option)
Bisect Results
This issue was introduced in 1.18.0-2. Downgrading to 1.18.0-1 fixes the issue completely and CRT SwitchRes works as intended.
Version/Commit
RetroArch Version: 1.18.0
Git version: 06fa5325f8
Build date: May 5 2024
Environment information
- OS: Manjaro Linux 6.6.30-2
- Graphics Driver: video-nvidia 550.78
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the crash with CRT SwitchRes enabled and compare RetroArch 1.18.0-2 against 1.18.0-1, using the provided log's CRT resolution-switching entry as the failure point. Done means CRT SwitchRes no longer reports a buffer overflow or crashes, and on-the-fly resolution switching works as it did in 1.18.0-1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100