null pointer dereference when using a link-factory in `context.objects`
- PipeWire version:
pipewire Compiled with libpipewire 0.3.43 Linked with libpipewire 0.3.43
- Distribution and distribution version:
NixOS 22.05 (Quokka)
- Desktop Environment:
Sway (Wayland)
- Kernel version:
5.15.11-zen1
Description of Problem:
I tried to use the undocumented link-factory
in my pipewire.conf
but it crashes due to (presumably) a null pointer dereference in create_object
when calling pw_resource_get_client
on a NULL
resource.
I suppose link-factory
is not meant to be used directly from context.objects
.
Here's the content of my pipewire.conf
:
{
"context.exec": [],
"context.modules": [
{
"args": {},
"flags": [
"ifexists",
"nofail"
],
"name": "libpipewire-module-rtkit"
},
{
"name": "libpipewire-module-protocol-native"
},
{
"name": "libpipewire-module-profiler"
},
{
"name": "libpipewire-module-metadata"
},
{
"name": "libpipewire-module-spa-device-factory"
},
{
"name": "libpipewire-module-spa-node-factory"
},
{
"name": "libpipewire-module-client-node"
},
{
"name": "libpipewire-module-client-device"
},
{
"flags": [
"ifexists",
"nofail"
],
"name": "libpipewire-module-portal"
},
{
"args": {},
"name": "libpipewire-module-access"
},
{
"name": "libpipewire-module-adapter"
},
{
"name": "libpipewire-module-link-factory"
},
{
"name": "libpipewire-module-session-manager"
}
],
"context.objects": [
{
"args": {
"factory.name": "support.node.driver",
"node.name": "dummy-driver",
"priority.driver": 8000
},
"factory": "spa-node-factory"
},
{
"args": {
"audio.position": "MONO",
"factory.name": "support.null-audio-sink",
"media.class": "Audio/Source/Virtual",
"node.description": "Microphone",
"node.name": "Microphone-Proxy",
"object.linger": true
},
"factory": "adapter"
},
{
"args": {
"audio.position": "FL,FR",
"factory.name": "support.null-audio-sink",
"media.class": "Audio/Sink",
"node.description": "Main Output",
"node.name": "Main-Output-Proxy",
"object.linger": true
},
"factory": "adapter"
},
{
"args": {
"factory.name": "link-factory",
"link.input.node": "Main-Output-Proxy",
"link.input.port": "monitor_FR",
"link.output.node": "alsa_output.usb-SteelSeries_SteelSeries_Arctis_7-00.stereo-game",
"link.output.port": "playback_FR",
"node.name": "Main-Output-Proxy",
"port.name": "monitor_FR",
"object.linger": true
},
"factory": "link-factory",
"flags": [
"nofail"
]
}
],
"context.properties": {
"core.daemon": true,
"core.name": "pipewire-0",
"link.max-buffers": 16,
"vm.overrides": {
"default.clock.min-quantum": 1024
}
},
"context.spa-libs": {
"api.alsa.*": "alsa/libspa-alsa",
"api.bluez5.*": "bluez5/libspa-bluez5",
"api.jack.*": "jack/libspa-jack",
"api.libcamera.*": "libcamera/libspa-libcamera",
"api.v4l2.*": "v4l2/libspa-v4l2",
"api.vulkan.*": "vulkan/libspa-vulkan",
"audio.convert.*": "audioconvert/libspa-audioconvert",
"support.*": "support/libspa-support"
},
"properties": {
"link.max.buffers": 16,
"log.level": 4
}
}
How Reproducible:
100%
Steps to Reproduce:
- Try to use the "undocumented"
link-factory
incontext.objects
- Run pipewire
Actual Results:
PID: 203285 (pipewire)
UID: 1000 (nicolas)
GID: 1000 (nicolas)
Signal: 11 (SEGV)
Timestamp: Wed 2022-02-02 02:40:32 EST (11h ago)
Command Line: /nix/store/r3i0ibbg6c4rm4992iw3hmwg964lm1im-pipewire-0.3.43/bin/pipewire
Executable: /nix/store/r3i0ibbg6c4rm4992iw3hmwg964lm1im-pipewire-0.3.43/bin/pipewire
Control Group: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
Unit: user@1000.service
User Unit: pipewire.service
Slice: user-1000.slice
Owner UID: 1000 (nicolas)
Boot ID: f66f4a3e7be543fb8037784313ad45fa
Machine ID: 28a8489d382e46739f3430446e449012
Hostname: mero
Storage: /var/lib/systemd/coredump/core.pipewire.1000.f66f4a3e7be543fb8037784313ad45fa.203285.1643787632000000.zst (present)
Disk Size: 184.6K
Message: Process 203285 (pipewire) of user 1000 dumped core.
Found module linux-vdso.so.1 with build-id: 127420d77290df746593a1bd5d05dfc1f09626ba
Found module libm.so.6 with build-id: d6b606266f360bba29637ca393f9f4147cbfdb4d
Found module libspa-audioconvert.so without build-id.
Found module libpipewire-module-session-manager.so without build-id.
Found module libpipewire-module-link-factory.so without build-id.
Found module libpipewire-module-adapter.so without build-id.
Found module libpipewire-module-access.so without build-id.
Found module libpipewire-module-portal.so without build-id.
Found module libpipewire-module-client-device.so without build-id.
Found module libpipewire-module-client-node.so without build-id.
Found module libpipewire-module-spa-node-factory.so without build-id.
Found module libpipewire-module-spa-device-factory.so without build-id.
Found module libpipewire-module-metadata.so without build-id.
Found module libpipewire-module-profiler.so without build-id.
Found module libpipewire-module-protocol-native.so without build-id.
Found module libpipewire-module-rtkit.so without build-id.
Found module libdbus-1.so.3 without build-id.
Found module libspa-dbus.so without build-id.
Found module libcap.so.2 without build-id.
Found module librt.so.1 with build-id: e4de41dbc4ced741cc6512fb56f5fc2f68202f20
Found module libsystemd.so.0 without build-id.
Found module libspa-journal.so without build-id.
Found module libspa-support.so without build-id.
Found module ld-linux-x86-64.so.2 with build-id: a799881c2c968a73ad9a4b97e58d47c1c4e22aaf
Found module libdl.so.2 with build-id: b25d5848157ba9d565c58fe501a769ca4b54dd39
Found module libc.so.6 with build-id: 1a840e5b29a4f81b213956c93c630308ee363f48
Found module libpthread.so.0 with build-id: 599dee78d5c0c99fd6dd14898d3eb9f8504d1e0e
Found module libpipewire-0.3.so.0 without build-id.
Found module pipewire without build-id.
Stack trace of thread 203285:
#0 0x00007fc9b51ad090 pw_resource_get_client (libpipewire-0.3.so.0 + 0x86090)
#1 0x00007fc9a659fb24 create_object (libpipewire-module-link-factory.so + 0x2b24)
#2 0x00007fc9b5161516 parse_objects (libpipewire-0.3.so.0 + 0x3a516)
#3 0x00007fc9b51635e3 pw_context_parse_conf_section (libpipewire-0.3.so.0 + 0x3c5e3)
#4 0x00007fc9b5164f17 pw_context_new (libpipewire-0.3.so.0 + 0x3df17)
#5 0x000055e251bdc403 main (pipewire + 0x1403)
#6 0x00007fc9b4f69780 __libc_start_main (libc.so.6 + 0x27780)
#7 0x000055e251bdc5da _start (pipewire + 0x15da)
Expected Results:
Ability to use link-factory
in the pipewire config without resorting to a shell script.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: