Find a file
Chengyi Zhao 2e00356c98 lib: core: add prepare_shutdown vfunc to fix Lua GC crash on exit
When WirePlumber exits, it crashes with SIGABRT. The backtrace shows:

  7  g_closure_invalidate
  10 g_object_unref
  15 g_value_unset
  16 _wplua_gvalue_userdata___gc
  26 close_state (lua_close)
  27 wp_plugin_deactivate
  33 wp_registry_clear
  34 wp_core_dispose

Root cause: lua_State is referenced by both the main plugin and each
WpLuaScript object. During registry cleanup, scripts call lua_close again
on an already-destroyed state, causing use-after-free.

Fix:
- Add a prepare_shutdown vfunc in WpPlugin. Call it from wp_core_dispose
  *before* clearing the registry.
- Lua plugin implements prepare_shutdown to close its lua_State early,
  allowing all __gc finalizers to run while GObjects are still alive.
- Then clear the lua_State pointer from every WpLuaScript object via
  wp_lua_script_clear_lua_state().
- Guard WpLuaScript finalize to skip if pointer is already NULL.
2026-05-08 14:44:44 +08:00
docs permission-manager: Add core_permissions support 2026-04-29 08:20:55 +02:00
lib lib: core: add prepare_shutdown vfunc to fix Lua GC crash on exit 2026-05-08 14:44:44 +08:00
modules lib: core: add prepare_shutdown vfunc to fix Lua GC crash on exit 2026-05-08 14:44:44 +08:00
po update zh_CN.po 2026-05-07 17:03:41 +08:00
src wpctl: Apply the same volume to all nodes when setting by PID 2026-05-05 07:43:21 -04:00
subprojects meson: update lua wrap to 5.5.0 2026-01-29 11:06:00 +01:00
tests m-lua-scripting: Handle both Properties and Lua tables in all Lua APIs 2025-11-24 19:42:07 +02:00
.editorconfig editorconfig: remove obsolete entry and add python script rules 2021-05-26 09:36:41 +03:00
.gitignore gitignore: remove obsolete entry 2021-05-26 09:38:03 +03:00
.gitlab-ci.yml ci: adapt pipewire build options based on the pw version we are building 2025-12-02 12:32:01 +02:00
AGENTS.md Add AGENTS.md 2025-10-10 18:03:07 +03:00
LICENSE LICENSE: update copyright years 2021-05-26 09:33:18 +03:00
Makefile Makefile: run valgrind with better arguments & environment 2021-10-15 14:00:05 +03:00
meson.build meson: fix tools build without daemon 2026-04-14 18:38:55 +03:00
meson_options.txt meson: make sure the boolean options have boolean values 2024-03-09 15:58:01 +02:00
NEWS.rst 0.5.14 2026-03-25 12:49:03 +02:00
README.rst README: remove broken badge 2024-02-10 11:44:19 +02:00
wp-uninstalled.sh wp-uninstalled: Allow to pass WIREPLUMBER_CONFIG_DIR 2026-03-18 17:29:42 +02:00

WirePlumber
===========

.. image:: https://gitlab.freedesktop.org/pipewire/wireplumber/badges/master/pipeline.svg
   :alt: Pipeline status

.. image:: https://scan.coverity.com/projects/21488/badge.svg
   :alt: Coverity Scan Build Status

.. image:: https://img.shields.io/badge/license-MIT-green
   :alt: License

.. image:: https://img.shields.io/badge/dynamic/json?color=informational&label=tag&query=%24%5B0%5D.name&url=https%3A%2F%2Fgitlab.freedesktop.org%2Fapi%2Fv4%2Fprojects%2F2941%2Frepository%2Ftags
   :alt: Tag

WirePlumber is a modular session / policy manager for
`PipeWire <https://pipewire.org>`_ and a GObject-based high-level library
that wraps PipeWire's API, providing convenience for writing the daemon's
modules as well as external tools for managing PipeWire.

The WirePlumber daemon implements the session & policy management service.
It follows a modular design, having plugins that implement the actual
management functionality.

The WirePlumber Library provides API that allows you to extend the WirePlumber
daemon, to write management or status tools for PipeWire
(apps that don't do actual media streaming) and to write custom session managers
for embedded devices.

Documentation
-------------

The latest version of the documentation is available online
`here <https://pipewire.pages.freedesktop.org/wireplumber/>`_