libretro / libretro/ps2

Core segfaults when trying to use the software renderer with Vulkan video driver

Open
#41 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
85
Forks
26
Avg merge
6h 43m
Merged PRs (30d)
6

Description

Hi there,

I've just build an amd64 version on Debian with latest stable MESA, using latest RetroArch sources from github to run it, and I found it segfaults if I run it with the software renderer:


Thread 1 "retroarch" received signal SIGSEGV, Segmentation fault.
0x00007ffff3665f2c in GSDevice::ClearCurrent (this=0x0) at /root/src/libretro/ps2/pcsx2/GS/Renderers/Common/GSDevice.cpp:346
346             m_current = nullptr;
(gdb) bt
#0  0x00007ffff3665f2c in GSDevice::ClearCurrent (this=0x0) at /root/src/libretro/ps2/pcsx2/GS/Renderers/Common/GSDevice.cpp:346
#1  0x00007ffff3667567 in GSRenderer::Reset (this=0x5555560dd2e0, hardware_reset=true)
    at /root/src/libretro/ps2/pcsx2/GS/Renderers/Common/GSRenderer.cpp:38
#2  0x00007ffff347a3d5 in MTGS::MainLoop (flush_all=false) at /root/src/libretro/ps2/pcsx2/MTGS.cpp:248
#3  0x00007ffff3464264 in retro_run () at /root/src/libretro/ps2/libretro/main.cpp:1731
#4  0x00005555555dc8c1 in core_run ()
#5  0x00005555555df5fd in runloop_iterate ()
#6  0x00005555555d5bc5 in rarch_main ()
#7  0x00007ffff773ad68 in __libc_start_call_main (main=main@entry=0x5555555c7200 <main>, argc=argc@entry=4, 
    argv=argv@entry=0x7fffffffe288) at ../sysdeps/nptl/libc_start_call_main.h:58
#8  0x00007ffff773ae25 in __libc_start_main_impl (main=0x5555555c7200 <main>, argc=4, argv=0x7fffffffe288, init=<optimized out>, 
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe278) at ../csu/libc-start.c:360
#9  0x00005555555c72b1 in _start ()

OTOH, Vulkan and ParallelGS renderers both work fine, only the software renderer seems to be affected.

This is how I configure the souces to build:

cmake .. -DUSE_OPENGL=FALSE

Any ideas on what could be going on? It seems that, in general, software renderer should be working.
Maybe it doesn't work with the RetroArch Vulkan backend for some reason?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GSDevice::ClearCurrent in GS/Renderers/Common/GSDevice.cpp:346 and GSRenderer::Reset in GS/Renderers/Common/GSRenderer.cpp:38, using the supplied backtrace and software-renderer build configuration. Reproduce with the RetroArch Vulkan backend, then trace the initialization path through MTGS::MainLoop and libretro/main.cpp. Done means the software renderer no longer segfaults while Vulkan and ParallelGS behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.