Skip to content

[Problem]: segmentation fault when a frame sync error is too large #2055

@mdickers47

Description

@mdickers47

What happened?

Mainly, shairport-sync is working great. Thank you! I had a problem where it was seg faulting repeatedly. I can't reproduce it now, but it might be obvious given this description:

The last message was "warning: Failed to allocate memory for a final_adjustment_silence buffer of xxxx frames", where xxxx was a ridiculously large 9 or 10 digit number.

I found this was being caused by a desktop using libpipewire-module-raop-discover, which had been set to use the shairport-sync airplay target. Every time shairport-sync restarts, libpipewire-module-raop-discover immediately reconnects. I speculate that it then tries to resume the previously crashed stream, with invalid timestamps that caused shairport-sync to calculate a bogus correction offset, thus it tried to malloc a jillion bytes and seg faulted.

The relevant code looks like player.c 2786 to 2809. This is probably dumb behavior from pipewire, but maybe you see a way to handle it that is more graceful than seg fault.

Relevant log output

System Information.

Raspberry Pi 4b 2GB, Alpine Linux 3.22, hifiberry DAC

Configuration Information.

>> Display Config Start.

From "uname -a":
 Linux pi4b.domain.com 6.12.38-0-rpi #1-Alpine SMP PREEMPT Tue Jul 15 10:07:54 UTC 2025 aarch64 Linux

From /etc/os-release:
 Alpine Linux v3.22

From /sys/firmware/devicetree/base/model:
 Raspberry Pi 4 Model B Rev 1.1

Shairport Sync Version String:
 4.3.7-OpenSSL-Avahi-ALSA-pa-pw-stdout-pipe-soxr-metadata-dbus-mpris-sysconfdir:/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "Audiplex";
   default_airplay_volume = -6.0;
 };
 alsa : 
 {
   output_device = "hw:0";
 };
 pw : 
 {
 };

>> Display Config End.
>> Goodbye!

PulseAudio or PipeWire installed?

  • Check if your system uses a Sound Server.

How did you install Shairport Sync?

A package manager (apt, apt install, yum, pkg, etc.)

Check previous issues

  • Confirm

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions