Skip to content

MPD segfaults on play with HTTP stream output #2176

@LemonBreezes

Description

@LemonBreezes

Bug report

Describe the bug

When trying to play a song with the HTTP stream output, MPD segfaults.

Expected Behavior

I expect MPD to play the song without crashing.

Actual Behavior

MPD crashes with a segfault.

Version

~/.c/doom/modules/cae/modeline:(master-40dadd46e) λ mpd --verbose --version
Music Player Daemon 0.23.15 (0.23.15)
Copyright 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2021 Max Kellermann <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple

Storage plugins:
 local udisks

Neighbor plugins:
 udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps://
 [pcm]

Filters:


Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe pipewire pulse httpd

Encoder plugins:
 null vorbis opus lame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip

Input plugins:
 file io_uring archive curl ffmpeg

Playlist plugins:
 extm3u m3u pls flac cue embcue

Protocols:
 file:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// rtmp:// rtmps:// rtmpt:// rtmpts:// rtp:// rtsp:// rtsps:// srtp://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Configuration

# Recommended location for database
db_file            "~/.config/mpd/database"

# The music directory is by default the XDG directory, uncomment to amend and choose a different directory
music_directory "~/Music/"

# Uncomment to refresh the database whenever files in the music_directory are changed
auto_update "yes"

# Uncomment to enable the functionalities
playlist_directory "~/.config/mpd/playlists"
state_file         "~/.local/state/mpd/state"
sticker_file       "~/.config/mpd/sticker.sql"

audio_output {
type            "pipewire"
name            "PipeWire Sound Server"
#bitrate		"128000"			# do not define if quality is defined
format		"48000:16:2"
}
audio_output {
type		"httpd"
name		"My HTTP Stream"
encoder        "lame"        # optional, vorbis or lame
port        "3001"
bind_to_address    "0.0.0.0"        # optional, IPv4 or IPv6
#quality		"5.0"			# do not define if bitrate is defined
bitrate		"128000"			# do not define if quality is defined
format		"48000:16:2"
always_on       "yes"			# prevent MPD from disconnecting all listeners when playback is stopped.
tags            "yes"			# httpd supports sending tags to listening streams.
max_clients    "0"            # optional 0=no limit
}

bind_to_address "0.0.0.0"

Log

Current directory is /home/st/.config/mpd/
GNU gdb (Gentoo 9999 vanilla) 17.0.50.20250105-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from mpd...
Reading symbols from /usr/lib/debug/usr/bin/mpd.debug...
(gdb) r
Starting program: /usr/bin/mpd --verbose --no-daemon
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
config_file: loading file /home/st/.config/mpd/mpd.conf
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.5.2
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
simple_db: reading DB
curl: version 8.11.1
curl: with OpenSSL/3.3.2
[New Thread 0x7fffe11f36c0 (LWP 18866)]
[New Thread 0x7fffe08636c0 (LWP 18867)]
[New Thread 0x7fffdfed36c0 (LWP 18868)]
[New Thread 0x7fffdf5436c0 (LWP 18869)]
[New Thread 0x7fffde5ff6c0 (LWP 18870)]

Thread 6 "output:My HTTP " received signal SIGSEGV, Segmentation fault.
AudioOutputSource::Fill (this=0x555555be9590, mutex=@0x555555be96d0: {<std::__mutex_base> = {_M_mutex = {__data = {__lock = 2, __count = 0, __owner = 18870, __nusers = 1, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000\266I\000\000\001", '\000' <repeats 26 times>, __align = 2}}, <No data fields>}) at ../mpd-0.23.15/src/output/Source.cxx:228
228		pending_tag = current_chunk->tag.get();
(gdb) backtrace
Selected thread is running.
(gdb) t 6
[Switching to thread 6 (Thread 0x7fffde5ff6c0 (LWP 18870))]
#0  AudioOutputSource::Fill (this=0x555555be9590, mutex=@0x555555be96d0: {<std::__mutex_base> = {_M_mutex = {__data = {__lock = 2, __count = 0, __owner = 18870, __nusers = 1, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000\266I\000\000\001", '\000' <repeats 26 times>, __align = 2}}, <No data fields>}) at ../mpd-0.23.15/src/output/Source.cxx:228
228		pending_tag = current_chunk->tag.get();
(gdb) backtrace
#0  AudioOutputSource::Fill (this=0x555555be9590, mutex=@0x555555be96d0: {
  <std::__mutex_base> = {
    _M_mutex = {
      __data = {
        __lock = 2,
        __count = 0,
        __owner = 18870,
        __nusers = 1,
        __kind = 0,
        __spins = 0,
        __elision = 0,
        __list = {
          __prev = 0x0,
          __next = 0x0
        }
      },
      __size = "\002\000\000\000\000\000\000\000\266I\000\000\001", '\000' <repeats 26 times>,
      __align = 2
    }
  }, <No data fields>}) at ../mpd-0.23.15/src/output/Source.cxx:228
#1  AudioOutputControl::FillSourceOrClose (this=0x555555be9560) at ../mpd-0.23.15/src/output/Thread.cxx:226
#2  0x00005555555e3253 in AudioOutputControl::InternalPlay (this=0x555555be9560, lock=@0x7fffde5fea90: {
  _M_device = 0x555555be96d0,
  _M_owns = true
}) at ../mpd-0.23.15/src/output/Thread.cxx:296
#3  AudioOutputControl::Task (this=0x555555be9560) at ../mpd-0.23.15/src/output/Thread.cxx:447
#4  BindMethodDetail::WrapperGenerator<void (AudioOutputControl::*)() noexcept, &AudioOutputControl::Task>::Invoke(void*) (_instance=0x555555be9560) at ../mpd-0.23.15/src/util/BindMethod.hxx:130
#5  0x00005555555c4e67 in BoundMethod<void () noexcept>::operator()() const (this=0x555555be9628, this=<optimized out>) at ../mpd-0.23.15/src/util/BindMethod.hxx:77
#6  Thread::Run (this=0x555555be9628) at ../mpd-0.23.15/src/thread/Thread.cxx:63
#7  Thread::ThreadProc (ctx=0x555555be9628) at ../mpd-0.23.15/src/thread/Thread.cxx:92
#8  0x00007ffff40c367a in ??? () at /usr/lib64/libc.so.6
#9  0x00007ffff414216c in ??? () at /usr/lib64/libc.so.6
(gdb) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    waitingWaiting for more information from reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions