mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.28k stars 574 forks source link

Ver 3.3.7 segfault on Raspberry Pi #1108

Closed moodeaudio closed 3 years ago

moodeaudio commented 3 years ago

Hi,

Getting a segfault after compiling on a Pi. Below is a log of the compile session which looks OK to my eye. I'm using a .conf file from 3.3.6 version.

pi@rp3:~ $ sudo unzip -q ./shairport-sync-3.3.7.zip
pi@rp3:~ $ cd ./shairport-sync-3.3.7

pi@rp3:~/shairport-sync-3.3.7 $ sudo autoreconf -i -f
configure.ac:21: installing './compile'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing './depcomp'

pi@rp3:~/shairport-sync-3.3.7 $ sudo ./configure --with-alsa --with-avahi --with-ssl=openssl --with-soxr --with-metadata --with-mqtt-client --with-stdout --with-systemd --with-dbus-interface --sysconfdir=/etc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for ranlib... ranlib
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for clock_gettime in -lrt... yes
checking for pthread_create in -lpthread... yes
checking for exp in -lm... yes
>>Including libpopt
checking for POPT... yes
>>Including the stdout audio back end
checking for LIBCONFIG... yes
checking encryption libraries chosen... checking for SSL... yes
>>Including support for soxr-based interpolation
checking for SOXR... yes
>>Including Avahi mDNS support
checking for avahi_client_new in -lavahi-client... yes
checking for avahi_strerror in -lavahi-common... yes
>>Including an ALSA back end
checking for ALSA... yes
>>Including dbus support
checking for GIO_UNIX... yes
>>Including MQTT support
checking for mosquitto_lib_init in -lmosquitto... yes
>>Including extended metadata and DACP client support
>>Including metadata support
checking for xmltoman... no
configure: WARNING: >>xmltoman not found - not rebuilding man pages
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking getopt_long.h usability... no
checking getopt_long.h presence... no
checking for getopt_long.h... no
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking mach/mach.h usability... no
checking mach/mach.h presence... no
checking for mach/mach.h... no
checking for memory.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for error_at_line... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for atexit... yes
checking for clock_gettime... yes
checking for gethostname... yes
checking for inet_ntoa... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for mkfifo... yes
checking for pow... yes
checking for select... yes
checking for socket... yes
checking for stpcpy... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoul... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating man/Makefile
config.status: creating scripts/shairport-sync.service
config.status: creating scripts/shairport-sync
config.status: creating config.h
config.status: executing depfiles commands

pi@rp3:~/shairport-sync-3.3.7 $ sudo make
gdbus-codegen --interface-prefix org.gnome --generate-c-code dbus-interface org.gnome.ShairportSync.xml
touch dbus-interface.h
make  all-recursive
make[1]: Entering directory '/home/pi/shairport-sync-3.3.7'
Making all in man
make[2]: Entering directory '/home/pi/shairport-sync-3.3.7/man'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/shairport-sync-3.3.7/man'
make[2]: Entering directory '/home/pi/shairport-sync-3.3.7'
depbase=`echo shairport.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT shairport.o -MD -MP -MF $depbase.Tpo -c -o shairport.o shairport.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rtsp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT rtsp.o -MD -MP -MF $depbase.Tpo -c -o rtsp.o rtsp.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo mdns.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT mdns.o -MD -MP -MF $depbase.Tpo -c -o mdns.o mdns.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo common.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT common.o -MD -MP -MF $depbase.Tpo -c -o common.o common.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rtp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT rtp.o -MD -MP -MF $depbase.Tpo -c -o rtp.o rtp.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo player.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT player.o -MD -MP -MF $depbase.Tpo -c -o player.o player.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo alac.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT alac.o -MD -MP -MF $depbase.Tpo -c -o alac.o alac.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo audio.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT audio.o -MD -MP -MF $depbase.Tpo -c -o audio.o audio.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo loudness.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT loudness.o -MD -MP -MF $depbase.Tpo -c -o loudness.o loudness.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo activity_monitor.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT activity_monitor.o -MD -MP -MF $depbase.Tpo -c -o activity_monitor.o activity_monitor.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo mdns_avahi.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT mdns_avahi.o -MD -MP -MF $depbase.Tpo -c -o mdns_avahi.o mdns_avahi.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo audio_alsa.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT audio_alsa.o -MD -MP -MF $depbase.Tpo -c -o audio_alsa.o audio_alsa.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo audio_stdout.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT audio_stdout.o -MD -MP -MF $depbase.Tpo -c -o audio_stdout.o audio_stdout.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo metadata_hub.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT metadata_hub.o -MD -MP -MF $depbase.Tpo -c -o metadata_hub.o metadata_hub.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo mqtt.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT mqtt.o -MD -MP -MF $depbase.Tpo -c -o mqtt.o mqtt.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo dacp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT dacp.o -MD -MP -MF $depbase.Tpo -c -o dacp.o dacp.c &&\
 -MP -MF $depbase.Tpo -c -o dacp.o dacp.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo tinyhttp/chunk.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT tinyhttp/chunk.o -MD -MP -MF $depbase.Tpo -c -o tinyhttp/chunk.o tinyhttp/chunk.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo tinyhttp/header.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT tinyhttp/header.o -MD -MP -MF $depbase.Tpo -c -o tinyhttp/header.o tinyhttp/header.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo tinyhttp/http.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT tinyhttp/http.o -MD -MP -MF $depbase.Tpo -c -o tinyhttp/http.o tinyhttp/http.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo dbus-service.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.    -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT dbus-service.o -MD -MP -MF $depbase.Tpo -c -o dbus-service.o dbus-service.c &&\
mv -f $depbase.Tpo $depbase.Po
gcc -DHAVE_CONFIG_H -I.    -pthread -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -g -O2 -MT lib_dbus_interface_a-dbus-interface.o -MD -MP -MF .deps/lib_dbus_interface_a-dbus-interface.Tpo -c -o lib_dbus_interface_a-dbus-interface.o `test -f 'dbus-interface.c' || echo './'`dbus-interface.c
mv -f .deps/lib_dbus_interface_a-dbus-interface.Tpo .deps/lib_dbus_interface_a-dbus-interface.Po
rm -f lib_dbus_interface.a
ar cr lib_dbus_interface.a lib_dbus_interface_a-dbus-interface.o 
ranlib lib_dbus_interface.a
g++ -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\"  -g -O2   -o shairport-sync shairport.o rtsp.o mdns.o common.o rtp.o player.o alac.o audio.o loudness.o activity_monitor.o  mdns_avahi.o   audio_alsa.o   audio_stdout.o        metadata_hub.o mqtt.o dacp.o tinyhttp/chunk.o tinyhttp/header.o tinyhttp/http.o dbus-service.o  lib_dbus_interface.a  -lmosquitto -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lasound -lavahi-common -lavahi-client -lsoxr -lssl -lcrypto -lconfig -lpopt -lm -lpthread -lrt 
make[2]: Leaving directory '/home/pi/shairport-sync-3.3.7'
make[1]: Leaving directory '/home/pi/shairport-sync-3.3.7'

pi@rp3:~/shairport-sync-3.3.7 $ ./shairport-sync -V
3.3.7-OpenSSL-Avahi-ALSA-stdout-soxr-metadata-mqtt-dbus-sysconfdir:/etc

pi@rp3:~/shairport-sync-3.3.7 $ ./shairport-sync 
Segmentation fault
Ircama commented 3 years ago

I also get a segmentation fault:

         0.000031222 "player.c:3090" pfls
         0.000053129 "rtsp.c:2696" Connection 1: RTSP Response:
         0.000021610 "rtsp.c:507"   Type: "CSeq", content: "15"
         0.000018500 "rtsp.c:507"   Type: "Server", content: "AirTunes/105.1"
         0.000020592 "rtsp.c:507"   Type: "Audio-Latency", content: "11025"
         0.003195832 "rtsp.c:2653" Connection 1: Received an RTSP Packet of type "SET_PARAMETER":
         0.000069295 "rtsp.c:507"   Type: "User-Agent", content: "iTunes/11.3.1 (Macintosh; OS X 10.9.4) AppleWebKit/537.77.4"
         0.000019611 "rtsp.c:507"   Type: "Client-Instance", content: "341A854D71D42842"
         0.000019518 "rtsp.c:507"   Type: "CSeq", content: "16"
         0.000019888 "rtsp.c:507"   Type: "Content-Length", content: "32"
         0.000019222 "rtsp.c:507"   Type: "Session", content: "1"
         0.000018870 "rtsp.c:507"   Type: "Content-Type", content: "text/parameters"
         0.000084462 "metadata_hub.c:548" MH Progress String set to: "341113/341113/341113"
         0.000002851 "dacp.c:410" set_dacp_server_information set IP to "192.168.4.137" and DACP id to "".
         0.000041278 "rtsp.c:2696" Connection 1: RTSP Response:
         0.000083128 "rtsp.c:507"   Type: "CSeq", content: "16"
Segmentation fault

And possibly the problem could be near a strdup which might be temporarily commented out until the problem is fixed.

mikebrady commented 3 years ago

Thanks for this. I'll check it ASAP.

mikebrady commented 3 years ago

Hi, pi@rp3:~/shairport-sync-3.3.7 $ ./shairport-sync Segmentation fault

Would you be kind enough to post the configuration file, please?

moodeaudio commented 3 years ago

Here is the launch string we use and the 3.3.6 conf file.

/usr/local/bin/shairport-sync -vv -a "RP3 Airplay" -- -d plughw:2 > /var/log/shairport-sync.log 2>&1 &
pi@rp3:~ $ cat /etc/shairport-sync.conf 
// Sample Configuration File for Shairport Sync
// Commented out settings are generally the defaults, except where noted.
// Some sections are operative only if Shairport Sync has been built with the right configuration flags.
// See the individual sections for details.

// General Settings
general =
{
//      name = "%H"; // This means "Hostname" -- see below. This is the name the service will advertise to iTunes.
//              The default is "Hostname" -- i.e. the machine's hostname with the first letter capitalised (ASCII only.)
//              You can use the following substitutions:
//                              %h for the hostname,
//                              %H for the Hostname (i.e. with first letter capitalised (ASCII only)),
//                              %v for the version number, e.g. 3.0 and
//                              %V for the full version string, e.g. 3.3-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/etc
//              Overall length can not exceed 50 characters. Example: "Shairport Sync %v on %H".
//      password = "secret"; // leave this commented out if you don't want to require a password
interpolation = "soxr"; // aka "stuffing". Default is "auto". Alternatives are "basic" or "soxr". Choose "soxr" only if you have a reasonably fast processor and Shairport Sync has been built with "soxr" support.
//      output_backend = "alsa"; // Run "shairport-sync -h" to get a list of all output_backends, e.g. "alsa", "pipe", "stdout". The default is the first one.
//      mdns_backend = "avahi"; // Run "shairport-sync -h" to get a list of all mdns_backends. The default is the first one.
//      port = 5000; // Listen for service requests on this port
//      udp_port_base = 6001; // start allocating UDP ports from this port number when needed
//      udp_port_range = 10; // look for free ports in this number of places, starting at the UDP port base. Allow at least 10, though only three are needed in a steady state.
//      drift_tolerance_in_seconds = 0.002; // allow a timing error of this number of seconds of drift away from exact synchronisation before attempting to correct it
//      resync_threshold_in_seconds = 0.050; // a synchronisation error greater than this number of seconds will cause resynchronisation; 0 disables it
//      ignore_volume_control = "no"; // set this to "yes" if you want the volume to be at 100% no matter what the source's volume control is set to.
//      volume_range_db = 60 ; // use this advanced setting to set the range, in dB, you want between the maximum volume and the minimum volume. Range is 30 to 150 dB. Leave it commented out to use mixer's native range.
//      volume_max_db = 0.0 ; // use this advanced setting, which must have a decimal point in it, to set the maximum volume, in dB, you wish to use.
//              The setting is for the hardware mixer, if chosen, or the software mixer otherwise. The value must be in the mixer's range (0.0 to -96.2 for the software mixer).
//              Leave it commented out to use mixer's maximum volume.
//      volume_control_profile = "standard" ; // use this advanced setting to specify how the airplay volume is transferred to the mixer volume.
//              "standard" makes the volume change more quickly at lower volumes and slower at higher volumes.
//              "flat" makes the volume change at the same rate at all volumes.
//      volume_range_combined_hardware_priority = "no"; // when extending the volume range by combining the built-in software attenuator with the hardware mixer attenuator, set this to "yes" to reduce volume by using the hardware mixer first, then the built-in software attenuator.
//      run_this_when_volume_is_set = "/full/path/to/application/and/args"; //  Run the specified application whenever the volume control is set or changed.
//              The desired AirPlay volume is appended to the end of the command line – leave a space if you want it treated as an extra argument.
//              AirPlay volume goes from 0 to -30 and -144 means "mute".

//      regtype = "_raop._tcp"; // Use this advanced setting to set the service type and transport to be advertised by Zeroconf/Bonjour. Default is "_raop._tcp".
//      playback_mode = "stereo"; // This can be "stereo", "mono", "reverse stereo", "both left" or "both right". Default is "stereo".
//      alac_decoder = "hammerton"; // This can be "hammerton" or "apple". This advanced setting allows you to choose
//              the original Shairport decoder by David Hammerton or the Apple Lossless Audio Codec (ALAC) decoder written by Apple.
//              If you build Shairport Sync with the flag --with-apple-alac, the Apple ALAC decoder will be chosen by default.
//      interface = "name"; // Use this advanced setting to specify the interface on which Shairport Sync should provide its service. Leave it commented out to get the default, which is to select the interface(s) automatically.
audio_backend_latency_offset_in_seconds = 0.0; // Set this offset to compensate for a fixed delay in the audio back end. E.g. if the output device delays by 100 ms, set this to -0.1.
audio_backend_buffer_desired_length_in_seconds = 0.2; // If set too small, buffer underflow occurs on low-powered machines. Too long and the response time to volume changes becomes annoying. Default is 0.15 seconds in the alsa backend, 0.35 seconds in the pa backend and 1.0 seconds otherwise.
//      audio_backend_buffer_interpolation_threshold_in_seconds = 0.075; // Advanced feature. If the buffer size drops below this, stop using time-consuming interpolation like soxr to avoid dropouts due to underrun.
//      audio_backend_silent_lead_in_time = 2.0; // This optional advanced setting, from 0.0 and 4.0 seconds, sets the length of the period of silence that precedes the start of the audio. The default is the latency, usually 2.0 seconds. Values greater than the latency are ignored. Values that are too low will affect initial synchronisation.
//      dbus_service_bus = "system"; // The Shairport Sync dbus interface, if selected at compilation, will appear
//              as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session".
//      mpris_service_bus = "system"; // The Shairport Sync mpris interface, if selected at compilation, will appear
//              as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session".
};

// Advanced parameters for controlling how Shairport Sync stays active and how it runs a session
sessioncontrol =
{
//      run_this_before_play_begins = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
//      run_this_after_play_ends = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line

//      "active" state starts when play begins and ends when the active_state_timeout has elapsed after play ends, unless another play session starts before the timeout has fully elapsed.
run_this_before_entering_active_state = "/var/local/www/commandw/spspre.sh"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
run_this_after_exiting_active_state = "/var/local/www/commandw/spspost.sh"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
active_state_timeout = 10.0; // wait for this number of seconds after play ends before leaving the active state, unless another play session begins.

//      run_this_if_an_unfixable_error_is_detected = "/full/path/to/application and args"; // if a problem occurs that can't be cleared by Shairport Sync itself, hook a program on here to deal with it. An error code-string is passed as the last argument.
//        Many of these "unfixable" problems are caused by malfunctioning output devices, and sometimes it is necessary to restart the whole device to clear the problem.
//        You could hook on a program to do this automatically, but beware -- the device may then power off and restart without warning!
wait_for_completion = "yes"; // set to "yes" to get Shairport Sync to wait until the "run_this..." applications have terminated before continuing

// set to "yes" to allow another device to interrupt Shairport Sync while it's playing from an existing audio source
allow_session_interruption = "no";
// wait for this number of seconds after a source disappears before terminating the session and becoming available again.
session_timeout = 120;
};

// Back End Settings

// These are parameters for the "alsa" audio back end.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-alsa
alsa =
{
//      output_device = "default"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc.
//      mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
//      mixer_device = "default"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this.
output_rate = 44100; // can be "auto", 44100, 88200, 176400 or 352800, but the device must have the capability.
output_format = "S16"; // can be "auto", "U8", "S8", "S16", "S16_LE", "S16_BE", "S24", "S24_LE", "S24_BE", "S24_3LE", "S24_3BE", "S32", "S32_LE" or "S32_BE" but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor.
//      disable_synchronization = "no"; // Set to "yes" to disable synchronization. Default is "no".
//      period_size = <number>; // Use this optional advanced setting to set the alsa period size near to this value
//      buffer_size = <number>; // Use this optional advanced setting to set the alsa buffer size near to this value
//      use_mmap_if_available = "yes"; // Use this optional advanced setting to control whether MMAP-based output is used to communicate  with the DAC. Default is "yes"
//      use_hardware_mute_if_available = "no"; // Use this optional advanced setting to control whether the hardware in the DAC is used for muting. Default is "no", for compatibility with other audio players.
//      maximum_stall_time = 0.200; // Use this optional advanced setting to control how long to wait for data to be consumed by the output device before considering it an error. It should never approach 200 ms.
//      use_precision_timing = "auto"; // Use this optional advanced setting to control how Shairport Sync gathers timing information. When set to "auto", if the output device is a real hardware device, precision timing will be used. Choose "no" for more compatible standard timing, choose "yes" to force the use of precision timing, which may cause problems.
disable_standby_mode = "auto"; // This setting prevents the DAC from entering the standby mode. Some DACs make small "popping" noises when they go in and out of standby mode. Settings can be: "always", "auto" or "never". Default is "never", but only for backwards compatibility. The "auto" setting prevents entry to standby mode while Shairport Sync is in the "active" mode. You can use "yes" instead of "always" and "no" instead of "never".
//      disable_standby_mode_silence_threshold = 0.040; // Use this optional advanced setting to control how little audio should remain in the output buffer before the disable_standby code should start sending silence to the output device.
//      disable_standby_mode_silence_scan_interval = 0.004; // Use this optional advanced setting to control how often the amount of audio remaining in the output buffer should be checked.
};

// Parameters for the "sndio" audio back end. All are optional.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-sndio
sndio =
{
//      device = "snd/0"; // optional setting to set the name of the output device. Default is the sndio system default.
//      rate = 44100; // optional setting  which can be 44100, 88200, 176400 or 352800, but the device must have the capability. Default is 44100.
//      format = "S16"; // optional setting  which can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor.
//      round = <number>; // advanced optional setting to set the period size near to this value
//      bufsz = <number>; // advanced optional setting to set the buffer size near to this value
};

// Parameters for the "pa" PulseAudio  backend.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-pa
pa =
{
//      application_name = "Shairport Sync"; //Set this to the name that should appear in the Sounds "Applications" tab when Shairport Sync is active.
};

// Parameters for the "jack" JACK Audio Connection Kit backend.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-jack
jack =
{
//      client_name = "shairport-sync"; // Set this to the name of the client that should appear in "Connections" when Shairport Sync is active.
//      autoconnect_pattern = ""; // Set this to a POSIX regular expression pattern that describes the ports you would like to connect to
//                                   automatically. Examples:
//                                   "system:playback_[12]"
//                                   "some_app_[0-9]*:in-[LR]"
//                                   "jack_mixer:in_2[78]"
//                                   Beware: if you make a syntax error, libjack might crash. In that case, fix it and start over.
//                                   For a good overview, look here: https://www.ibm.com/support/knowledgecenter/SS8NLW_11.0.1/com.ibm.swg.im.infosphere.dataexpl.engine.doc/c_posix-regex-examples.html
};

// Parameters for the "pipe" audio back end, a back end that directs raw CD-style audio output to a pipe. No interpolation is done.
// For this section to be operative, Shairport Sync must have been built with the following configuration flag:
// --with-pipe
pipe =
{
//      name = "/path/to/pipe"; // there is no default pipe name for the output
};

// There are no configuration file parameters for the "stdout" audio back end. No interpolation is done.
// To include support for the "stdout" backend, Shairport Sync must be built with the following configuration flag:
// --with-stdout

// There are no configuration file parameters for the "ao" audio back end. No interpolation is done.
// To include support for the "ao" backend, Shairport Sync must be built with the following configuration flag:
// --with-ao

// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-convolution
dsp =
{

//////////////////////////////////////////
// This convolution filter can be used to apply almost any correction to the audio signal, like frequency and phase correction.
// For example you could measure (with a good microphone and a sweep-sine) the frequency response of your speakers + room,
// and apply a correction to get a flat response curve.
//////////////////////////////////////////
//
//      convolution = "no";                   // Set this to "yes" to activate the convolution filter.
//      convolution_ir_file = "impulse.wav";  // Impulse Response file to be convolved to the audio stream
//      convolution_gain = -4.0;              // Static gain applied to prevent clipping during the convolution process
//      convolution_max_length = 44100;       // Truncate the input file to this length in order to save CPU.

//////////////////////////////////////////
// This loudness filter is used to compensate for human ear non linearity.
// When the volume decreases, our ears loose more sentisitivity in the low range frequencies than in the mid range ones.
// This filter aims at compensating for this loss, applying a variable gain to low frequencies depending on the volume.
// More info can be found here: https://en.wikipedia.org/wiki/Equal-loudness_contour
// For this filter to work properly, you should disable (or set to a fix value) all other volume control and only let shairport-sync control your volume.
// The setting "loudness_reference_volume_db" should be set at the volume reported by shairport-sync when listening to music at a normal listening volume.
//////////////////////////////////////////
//
//      loudness = "no";                      // Set this to "yes" to activate the loudness filter
//      loudness_reference_volume_db = -20.0; // Above this level the filter will have no effect anymore. Below this level it will gradually boost the low frequencies.

};

// How to deal with metadata, including artwork
// For this section to be operative, Shairport Sync must be built with at one (or more) of the following configuration flags:
// --with-metadata, --with-dbus-interface, --with-mpris-interface or --with-mqtt-client.
// In those cases, "enabled" and "include_cover_art" will both be "yes" by default
metadata =
{
enabled = "no"; // set this to yes to get Shairport Sync to solicit metadata from the source and to pass it on via a pipe
include_cover_art = "no"; // set to "yes" to get Shairport Sync to solicit cover art from the source and pass it via the pipe. You must also set "enabled" to "yes".
//      pipe_name = "/tmp/shairport-sync-metadata";
//      pipe_timeout = 5000; // wait for this number of milliseconds for a blocked pipe to unblock before giving up
//      socket_address = "226.0.0.1"; // if set to a host name or IP address, UDP packets containing metadata will be sent to this address. May be a multicast address. "socket-port" must be non-zero and "enabled" must be set to yes"
//      socket_port = 5555; // if socket_address is set, the port to send UDP packets to
//      socket_msglength = 65000; // the maximum packet size for any UDP metadata. This will be clipped to be between 500 or 65000. The default is 500.
};

// How to enable the MQTT-metadata/remote-service
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-mqtt-client
mqtt =
{
//      enabled = "no"; // set this to yes to enable the mqtt-metadata-service
//      hostname = "iot.eclipse.org"; // Hostname of the MQTT Broker
//      port = 1883; // Port on the MQTT Broker to connect to
//      username = NULL; //set this to a string to your username in order to enable username authentication
//      password = NULL; //set this to a string you your password in order to enable username & password authentication
//      capath = NULL; //set this to the folder with the CA-Certificates to be accepted for the server certificate. If not set, TLS is not used
//      cafile = NULL; //this may be used as an (exclusive) alternative to capath with a single file for all ca-certificates
//      certfile = NULL; //set this to a string to a user certificate to enable MQTT Client certificates. keyfile must also be set!
//      keyfile = NULL; //private key for MQTT Client authentication
//      topic = NULL; //MQTT topic where this instance of shairport-sync should publish. If not set, the general.name value is used.
//      publish_raw = "no"; //whether to publish all available metadata under the codes given in the 'metadata' docs.
//      publish_parsed = "no"; //whether to publish a small (but useful) subset of metadata under human-understandable topics
//      Currently published topics:artist,album,title,genre,format,songalbum,volume,client_ip,
//      Additionally, empty messages at the topics play_start,play_end,play_flush,play_resume are published
//      publish_cover = "no"; //whether to publish the cover over mqtt in binary form. This may lead to a bit of load on the broker
//      enable_remote = "no"; //whether to remote control via MQTT. RC is available under `topic`/remote.
//      Available commands are "command", "beginff", "beginrew", "mutetoggle", "nextitem", "previtem", "pause", "playpause", "play", "stop", "playresume", "shuffle_songs", "volumedown", "volumeup"
}

// Diagnostic settings. These are for diagnostic and debugging only. Normally you should leave them commented out
diagnostics =
{
//      disable_resend_requests = "no"; // set this to yes to stop Shairport Sync from requesting the retransmission of missing packets. Default is "no".
//      statistics = "no"; // set to "yes" to print statistics in the log
//      log_verbosity = 0; // "0" means no debug verbosity, "3" is most verbose.
//      log_show_time_since_startup = "no"; // set this to yes if you want the time since startup in the debug message -- seconds down to nanoseconds
//      log_show_time_since_last_message = "yes"; // set this to yes if you want the time since the last debug message in the debug message -- seconds down to nanoseconds
//      drop_this_fraction_of_audio_packets = 0.0; // use this to simulate a noisy network where this fraction of UDP packets are lost in transmission. E.g. a value of 0.001 would mean an average of 0.1% of packets are lost, which is actually quite a high figure.
};
pi@rp3:~ $ 
mikebrady commented 3 years ago

Fantastic, thanks -- it causes the segmentation fault. That means it should be quick to find. (Famous last words, I know...)

mikebrady commented 3 years ago

It's a logic error -- a combination I hadn't tested. If metadata support is included in the build but disabled in the config, it causes the segfault. I have a fix, but I'd like to check it with a clear head. I'll post it tomorrow, all going well.

To get around it for the present, don't set enabled to "no" in the metadata stanza -- comment it out or set it to "yes".

moodeaudio commented 3 years ago

Ok cool. I can confirm that with metadata = "yes" there is no segfault and everything else seems to work just fine :-)

mikebrady commented 3 years ago

Thanks Tim. Apologies for the sloppiness.

mikebrady commented 3 years ago

I just pushed 3.3.8rc0 in the master branch. It fixes that bug, I believe. If you tested it and let us know if it works, that would be great.

Ircama commented 3 years ago

I realized that mine was a different problem and still exists with 3.3.8rc0. It happens when the used Airplay client is the Android AirMusic app (also the trial version) and does not occur with an iPhone. The fix that I mentioned temporarily overcomes the issue.

mikebrady commented 3 years ago

I realized that mine was a different problem and still exists with 3.3.8rc0. It happens when the used Airplay client is the Android AirMusic app (also the trial version) and does not occur with an iPhone. The fix that I mentioned temporarily overcomes the issue.

Thanks. It might take a while to test this out...

Ircama commented 3 years ago

Thanks. It might take a while to test this out...

Not urgent at all, thanks.

moodeaudio commented 3 years ago

Hi Mike,

Just tested and the fix works perfectly :-)

mikebrady commented 3 years ago

Hi Mike,

Just tested and the fix works perfectly :-)

Super, thanks. I might just take another day or two to check it out.

mikebrady commented 3 years ago

Thanks. It might take a while to test this out...

Not urgent at all, thanks.

Actually, by good fortune, I was able to test it, and yep, I can cause the crash. I hope to have a fix soon.

mikebrady commented 3 years ago

Thanks. It might take a while to test this out...

Not urgent at all, thanks.

Actually, by good fortune, I was able to test it, and yep, I can cause the crash. I hope to have a fix soon.

@Ircama, I have just pushed an update which I believe fixes the AirPower crash. Whenever you get a chance to test it, I'd be glad of the feedback.

Ircama commented 3 years ago

Thanks. It might take a while to test this out...

Not urgent at all, thanks.

Actually, by good fortune, I was able to test it, and yep, I can cause the crash. I hope to have a fix soon.

@Ircama, I have just pushed an update which I believe fixes the AirPower crash. Whenever you get a chance to test it, I'd be glad of the feedback.

@mikebrady, I confirm that now it works perfectly, thanks very much!

mikebrady commented 3 years ago

@Ircama, I have just pushed an update which I believe fixes the AirPower crash. Whenever you get a chance to test it, I'd be glad of the feedback.

@mikebrady, I confirm that now it works perfectly, thanks very much!

Super, thanks.

github-actions[bot] commented 3 years ago

This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.