[PR #680] (libretro/Vulkan) Fix glslang shader-related crashes #80

Open
opened 2026-01-29 19:06:19 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/stenzek/duckstation/pull/680

State: closed
Merged: Yes


As reported in #672, the libretro core crashes when loading more than one item of content within a single session when running under Linux with an Intel integrated GPU.

There were actually 2 issues here:

  1. glslang::FinalizeProcess() is attached via std::atexit(). This does not work as intended when running duckstation as a dynamic shared object library... (it only gets called when RetroArch quits, not when the core is unloaded)

  2. With Linux + Intel iGPU, I was getting hit by the same 'mysterious' corruption issue that affected RetroArch itself some time ago, and which was fixed in this commit: 4437cd1eac

This PR ensures that glslang::FinalizeProcess() is called when unloading the core (and not on RetroArch exit), and backports the changes in 4437cd1eac. This fixes all crashing issues on my systems.

This closes #672

@stenzek I am by no means an expert in this particular area, so please review this carefully before merging! :)

**Original Pull Request:** https://github.com/stenzek/duckstation/pull/680 **State:** closed **Merged:** Yes --- As reported in #672, the libretro core crashes when loading more than one item of content within a single session when running under Linux with an Intel integrated GPU. There were actually 2 issues here: 1) `glslang::FinalizeProcess()` is attached via `std::atexit()`. This does not work as intended when running duckstation as a dynamic shared object library... (it only gets called when RetroArch quits, not when the core is unloaded) 2) With Linux + Intel iGPU, I was getting hit by the same 'mysterious' corruption issue that affected RetroArch itself some time ago, and which was fixed in this commit: https://github.com/libretro/RetroArch/commit/4437cd1eac144f1a3b5acda54c128213e59ec0e1 This PR ensures that `glslang::FinalizeProcess()` is called when unloading the core (and not on RetroArch exit), and backports the changes in https://github.com/libretro/RetroArch/commit/4437cd1eac144f1a3b5acda54c128213e59ec0e1. This fixes all crashing issues on my systems. This closes #672 @stenzek I am by no means an expert in this particular area, so please review this carefully before merging! :)
claunia added the pull-request label 2026-01-29 19:06:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#80