-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapserver + Librespot on Alpine = Segfault #1026
Comments
Have you tried running librespot on its own? Does it crash in the same situation? |
Snapserver seems to crash while parsing the librespot stdout logs. |
I've run librespot in the same container by itself and it doesn't crash - you can also see the librespot version at the top of the log here:
Just in case it helps, here is the dockerfile I've used to test this (it builds snapserver from source): FROM alpine:edge
WORKDIR /app
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
RUN apk add --no-cache bash librespot git alpine-sdk libvorbis-dev soxr-dev flac-dev avahi-dev expat-dev boost-dev opus-dev alsa-lib-dev
RUN git clone https://github.com/badaix/snapcast.git /snapcast
WORKDIR /snapcast
RUN make server DEBUG=1
RUN cp /snapcast/server/snapserver /usr/bin/
COPY snapserver.conf /etc/snapserver.conf
EXPOSE 1704 1705 1780
ENTRYPOINT /usr/bin/snapserver $EXTRA_ARGS |
Running the same librespot command on a working debian-based image and the non-working alpine one: The only difference I can see is that the alpine container prints this message twice in a row:
Debian:
Alpine:
|
Does snapcast also crash on debian? |
Nope it works fine with the debian container. |
I've added an Alpine dev container to the project 4d9a2b7, which enables development and debugging transparently in the container using the vscode Remote - Containers extension. |
I've tried the develop branch and it appears fixed =D Thanks very much for finding a workaround for this, I'm excited to make some really small alpine images for snapcast + librespot |
Replaces regexp parsing with simple string compares to avoid snapcast to sporadically crash when used with librespot as the audio stream source. The issue is described here: badaix/snapcast#1026 Upstream patch used: badaix/snapcast@4907fb4
I confirm that this patch works and has been added to the Alpine package (edge) until a new release is available. This also solves my issues with the Snapcast Addon for Home Assistant. Thank you. |
I ran into another segfault last night when a friend was trying to connect to the same librespot/snapcast instance as me. They were using an iPhone and I can't reproduce it now with the two android phones I have at home. If anyone's able to test I was using the alpine package and had connected the android phone to the librespot instance, then used the android phone to invite the iphone to control via QR code (using the spotify app). Music would play fine until someone added songs to the queue / skipped / played a new song and it would crash. Interestingly afterwards I had to force-pull my snapserver image again, otherwise it would immediately crash when I connected to it again. You can use |
FWIW I've done so more testing and realized I was running librespot with a username and password, which isn't really the best for sharing, and is why I was the only one who could see the librespot instance from my phone. I've since updated my container to include everything for avahi to run correctly, meaning I can run without a user/pass and everyone can see the instance. I'll try to get an iphone to test asap. |
Can confirm that librespot/snapcast segfaults as soon as an iphone tries to connect to librespot. |
Got another proper log of the crashes I am still getting with my laptop. These happen less often now, but are still occurring. I should have a log from the iphone issue soon:
|
I've just got 2 more dumps using the iPhone in question, and they're all very similar to the dump above. They all end in this same block which is the same as above:
|
Fixed in snapcast v0.27.0 |
fixes badaix#1026 (cherry picked from commit 4907fb4)
Describe the bug
When using snapserver + librespot on alpine linux, snapserver segfaults when a spotify client connects.
Steps to Reproduce
stream = spotify:///librespot?name=Spotify&username=REDACTED&password=REDACTED&devicename=MySnapcastServer&bitrate=320
Environment details
GDB Log from the segfault:
output of GDB
where
(some lines removed, it's huge)Output of GDB
list
I don't really know what I'm looking at with the GDB output, so I hope this makes sense to someone :)
The text was updated successfully, but these errors were encountered: