Skip to content
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

Snapclient v0.26 does not start: Segmentation fault #968

Closed
6i6i opened this issue Jan 4, 2022 · 25 comments
Closed

Snapclient v0.26 does not start: Segmentation fault #968

6i6i opened this issue Jan 4, 2022 · 25 comments
Labels
next release fixed in develop branch and will be part of the next release

Comments

@6i6i
Copy link

6i6i commented Jan 4, 2022

Describe the bug
After upgrading snapclient to version 0.26.0 the client does not start any more. It only displays "Segmentation faul"

Steps to Reproduce

  1. Install snapclient_0.26.0-1_without-pulse_armhf.deb on Rasbian 11 Bullseye
  2. Try to start the client with systemd script or on commandline
  3. Downgrade to snapclient_0.25.0-1_without-pulse_armhf.deb and it works again without problems

Environment details

  • OS: Raspbian 11 Bullseye Kernel 5.10.83
  • Snapcast version: 0.26.0
  • Installed from snapclient_0.26.0-1_without-pulse_armhf.deb
  • Snapserver is already version 0.26.0 running on AMD64 Ubuntu

gdb output:
_pi@garage:~ $ gdb snapclient
GNU gdb (Raspbian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 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 "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
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 snapclient...
(No debugging symbols found in snapclient)
(gdb) run
Starting program: /usr/bin/snapclient
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0048c24c in player::AlsaPlayer::worker() ()_

@abelmatser
Copy link

abelmatser commented Jan 4, 2022

I have the same problem. On two Raspberry Pi 1B's (running 0.25 before) 0.26.0-1_without-pulse_armhf.deb causes segmentation faults, however, on my Orange Pi Zero 0.26.0-1_without-pulse_armhf.deb does not cause them.

I'm unsure what is the difference between them, but I can give the output of uname- a && lsb_release -d with one clear differentiator being the architecture.

Raspberry Pi 1B:

Linux raspberrypi-abel 5.10.63+ #1496 Wed Dec 1 15:57:05 GMT 2021 armv6l GNU/Linux
Description:    Raspbian GNU/Linux 10 (buster)

Orange Pi Zero:

Linux orangepizero 5.10.34-sunxi #21.05.1 SMP Thu May 6 20:13:21 UTC 2021 armv7l GNU/Linux
Description:    Debian GNU/Linux 10 (buster)

This probably is not too helpful, so is there any way I can help debugging?

@fatg3erman
Copy link

fatg3erman commented Jan 6, 2022

Same here. I have 3 Pis all running Raspbian Bullseye Lite, all were running 0.25 before. Two (both 3Bs with 1GB RAM) are working with 0.26, one of them is also running snapserver 0.26 successfully. But one is a Pi Zero W (512 MB RAM) and that segfaults when I try to run 0.26 (using the without_pulse .deb). I've reverted it to 0.25 and it works fine.

I note that 0.26 had an additional dependency on libvorbisidec1, which wasn't required for 0.25. Don't know if this is relevant but thought it worth mentioning.

Looking at the above reply, I note that the two of mine that work are armv71 architecture, whereas the one that doesn't is armv61, which tallies with the above reply.

@Chaphasilor
Copy link

Same problem on a Pi B+ running Raspbian Buster (10)

@badaix
Copy link
Owner

badaix commented Jan 7, 2022

Hi,

the 0.26.0 debian packages are built on a bullseye docker container, hosted on a RaspberryPi 4. Previous builds were built on a native Raspian Buster powered RPi3.
You can find a new build from a dockerized bullseye, hosted on the old RPi3 as SnapOS build artifact here.
I didn't test it yet, but I hope it will run on armv61.

@fatg3erman
Copy link

Thanks for the quick response. Unfortunately that new build still segfaults on my Pi Zero.

$ uname -a
Linux zero 5.10.63+ #1488 Thu Nov 18 16:14:04 GMT 2021 armv6l GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

@fatg3erman
Copy link

I was suspicious about the fact the 0.26 has a new dependency on libvorbisidec1, which 0.25 didn't have. So I built a new version from source, after hacking the Makefile to remove all references to vorbis, ogg, and opus (and pulse, since I was using the without_pulse version before). I built this on an armv7l Raspberry Pi 3 with bullseye. I then transferred that binary to the Pi Zero, armv6l, device that would not run 0.26. This new version works. I'm playing PCM audio through it as I type this.

@70MM13
Copy link

70MM13 commented Jan 8, 2022

Same problem here on Raspberry Pi 1B and RPi Zero
Even snapclient -v gives the error.
But, the following development snapshot here works for me: https://github.com/badaix/snapcast/actions/runs/1618732990
which seems to be 2 days newer then release v0.26

Digging a little further, running file on the binaries gives a difference -
0.26 release :

/usr/bin/snapclient: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=bfe9c8f4ad1f67f6e4acc31ad19af48931cfad9b, stripped

the snapshot:

/usr/bin/snapclient: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=419937712947d1981566b1f1e2c73dff83918145, stripped

Don´t know if that hints to something...

@badaix
Copy link
Owner

badaix commented Jan 13, 2022

The debian containers on my rpi4 build machine are using a gcc armv7 compiler. I now found raspian containers for buster and bullseye which ship gcc armv6 compilers. The packages built with these raspian containers are working on my rpi1, you can find the builds in snapos.

@flowolf
Copy link

flowolf commented Jan 15, 2022

same problem. just upgraded my old setup to buster, upgraded to snapcast 0.26 and they are segfaulting as well.

both on two raspberry pi 2.

### first system (server and client)
root@soundwz:~# snapclient -v
Segmentation fault
root@soundwz:~# snapserver -v
Segmentation fault
root@soundwz:~# ls
snapclient_0.26.0-1_armhf.deb  snapserver_0.26.0-1_armhf.deb
root@soundwz:~# cat /etc/debian_version
10.11
root@soundwz:~# uname -a
Linux soundwz 5.10.63+ #1496 Wed Dec 1 15:57:05 GMT 2021 armv6l GNU/Linux
### second system (client only)
root@soundkitchen:~# snapclient -v
Segmentation fault
root@soundkitchen:~# ls /home/pi/snapclient_0.26.0-1_armhf.deb
/home/pi/snapclient_0.26.0-1_armhf.deb
root@soundkitchen:~# uname -a
Linux soundkitchen 5.10.63+ #1496 Wed Dec 1 15:57:05 GMT 2021 armv6l GNU/Linux
root@soundkitchen:~# which snapclient
/usr/bin/snapclient
root@soundkitchen:~# file `which snapclient`
/usr/bin/snapclient: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=dbdb09208e13f037762a63d03809d1ebc41ef0de, stripped

@badaix
Copy link
Owner

badaix commented Jan 15, 2022

And what about the linked packages in the snapos repo from my last answer?

@flowolf
Copy link

flowolf commented Jan 15, 2022

🎉
yes! thanks for pointing out that build. that seems to work!

pi@soundwz:~ $ unzip snapcast_armhf-debian-buster-e30a9f335badc81e743c61ceda6ef2dfc698573b.zip
Archive:  snapcast_armhf-debian-buster-e30a9f335badc81e743c61ceda6ef2dfc698573b.zip
  inflating: snapclient_0.26.0-1_armhf.deb
  inflating: snapclient_0.26.0-1_without-pulse_armhf.deb
  inflating: snapserver_0.26.0-1_armhf.deb
pi@soundwz:~ $ sudo su -
root@soundwz:~# dpkg -i /home/pi/snapserver_0.26.0-1_armhf.deb
(Reading database ... 69326 files and directories currently installed.)
Preparing to unpack .../snapserver_0.26.0-1_armhf.deb ...
Unpacking snapserver (0.26.0-1) over (0.26.0-1) ...
Setting up snapserver (0.26.0-1) ...
Processing triggers for systemd (241-7~deb10u8+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
root@soundwz:~# snapserver -v
snapserver v0.26.0 (rev e30a9f33)
Copyright (C) 2014-2021 BadAix (snapcast@badaix.de).
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.

Written by Johannes M. Pohl and contributors <https://github.com/badaix/snapcast/graphs/contributors>.

root@soundwz:~# dpkg -i /home/pi/snapclient_0.26.0-1_armhf.deb
(Reading database ... 69326 files and directories currently installed.)
Preparing to unpack .../snapclient_0.26.0-1_armhf.deb ...
Unpacking snapclient (0.26.0-1) over (0.26.0-1) ...
Setting up snapclient (0.26.0-1) ...
Processing triggers for systemd (241-7~deb10u8+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
root@soundwz:~# snapclient -v
snapclient v0.26.0 (rev e30a9f33)
Copyright (C) 2014-2021 BadAix (snapcast@badaix.de).
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.

Written by Johannes M. Pohl and contributors <https://github.com/badaix/snapcast/graphs/contributors>.

@badaix
Copy link
Owner

badaix commented Jan 15, 2022

Nice! Thanks for the feedback.

@flowolf
Copy link

flowolf commented Jan 15, 2022

it's not all good yet. not sure what to make of it yet or if it's related:

Jan 15 14:57:20 soundwz snapserver[865]: Version 0.26.0, revision e30a9f33
Jan 15 14:57:20 soundwz snapserver[865]: Adding source: pipe:///tmp/snapfifo?name=default
Jan 15 14:57:20 soundwz snapserver[865]: Settings file: "/var/lib/snapserver/server.json"
Jan 15 14:57:20 soundwz snapserver[865]: Snapserver terminated.
Jan 15 14:57:20 soundwz snapserver[868]: Version 0.26.0, revision e30a9f33
Jan 15 14:57:20 soundwz snapserver[868]: Adding source: pipe:///tmp/snapfifo?name=default
Jan 15 14:57:20 soundwz snapserver[868]: Settings file: "/var/lib/snapserver/server.json"
Jan 15 14:57:20 soundwz snapserver[868]: Snapserver terminated.
Jan 15 14:57:20 soundwz snapclient[501]: (Browser) CACHE_EXHAUSTED
Jan 15 14:57:20 soundwz snapclient[501]: (Browser) ALL_FOR_NOW
Jan 15 14:57:21 soundwz snapserver[869]: Version 0.26.0, revision e30a9f33
Jan 15 14:57:21 soundwz snapserver[869]: Adding source: pipe:///tmp/snapfifo?name=default
Jan 15 14:57:21 soundwz snapserver[869]: Settings file: "/var/lib/snapserver/server.json"
Jan 15 14:57:21 soundwz snapserver[869]: Snapserver terminated.
Jan 15 14:57:21 soundwz snapclient[501]: (Browser) CACHE_EXHAUSTED
Jan 15 14:57:21 soundwz snapclient[501]: (Browser) ALL_FOR_NOW
Jan 15 14:57:21 soundwz snapserver[870]: Version 0.26.0, revision e30a9f33
Jan 15 14:57:21 soundwz snapserver[870]: Adding source: pipe:///tmp/snapfifo?name=default
Jan 15 14:57:21 soundwz snapserver[870]: Settings file: "/var/lib/snapserver/server.json"
Jan 15 14:57:21 soundwz snapserver[870]: Snapserver terminated.
Jan 15 14:57:22 soundwz snapserver[871]: Version 0.26.0, revision e30a9f33
Jan 15 14:57:22 soundwz snapserver[871]: Adding source: pipe:///tmp/snapfifo?name=default
Jan 15 14:57:22 soundwz snapserver[871]: Settings file: "/var/lib/snapserver/server.json"
Jan 15 14:57:22 soundwz snapserver[871]: Snapserver terminated.
Jan 15 14:57:22 soundwz snapclient[501]: (Browser) CACHE_EXHAUSTED
Jan 15 14:57:22 soundwz snapclient[501]: (Browser) ALL_FOR_NOW
Jan 15 14:57:23 soundwz snapclient[501]: (Browser) CACHE_EXHAUSTED
Jan 15 14:57:23 soundwz snapclient[501]: (Browser) ALL_FOR_NOW

@flowolf
Copy link

flowolf commented Jan 15, 2022

looks better after

pi@soundwz:~ $ sudo chown snapclient:snapclient /var/lib/snapclient
pi@soundwz:~ $ sudo chown snapserver:snapserver /var/lib/snapserver

those directories were owned by _snapclient and _snapserver - I assume that had something to do with my buster upgrade.

@abelmatser
Copy link

abelmatser commented Jan 16, 2022

I haven't tested the builds in snapos extensively, but for the 5 seconds I tested them on my Raspberry Pi 1B it worked perfectly straight away.

@badaix
Copy link
Owner

badaix commented Jan 16, 2022

Thanks for testing. I've also tested on my rpi1 as well as on rpi3 and rpi4.
I've updated the packages for the 0.26 release some minutes ago. Fingers are crossed that the problem is solved now.

@mueckinger
Copy link

mueckinger commented Jan 16, 2022

Thanks for testing. I've also tested on my rpi1 as well as on rpi3 and rpi4. I've updated the packages for the 0.26 release some minutes ago. Fingers are crossed that the problem is solved now.

New uploaded deb works on rpi0 also. thx.

@6i6i
Copy link
Author

6i6i commented Jan 17, 2022

Seems also to work now for me. Thank you very much @badaix !

@jojo141185
Copy link

@badaix Will you add these armv6 versions here under the release section? My ansible playbook automatically checks here for new versions and distributes them to my various clients.

@abelmatser
Copy link

@badaix Will you add these armv6 versions here under the release section? My ansible playbook automatically checks here for new versions and distributes them to my various clients.

Offtopic (sorry): @jojo141185, could you share your ansible playbook?

@badaix
Copy link
Owner

badaix commented Jan 18, 2022

From my previous post:

I've updated the packages for the 0.26 release some minutes ago.

@flowolf
Copy link

flowolf commented Jan 18, 2022

I'd suggest to make a 0.26.1 release, as the binaries differ.
some solutions might not pick up on the change.

@badaix
Copy link
Owner

badaix commented Jan 18, 2022

Distributions would be confused with a 0.26.1, because not a single line of code changed, just the package build process, which is in the meantime hosted in the snapos project, to clearly separate the code from packaging.
I think that whoever had some automation will notice if the binary segfaults. The situation will be solved latest with the release of the 0.27.0

@kingosticks
Copy link
Contributor

To bump that version number you'll have changed the code, right? The issue (which I've never personally heard of before) is avoided.

@badaix badaix added the next release fixed in develop branch and will be part of the next release label Jul 15, 2022
@badaix
Copy link
Owner

badaix commented Feb 5, 2023

Fixed in snapcast v0.27.0

@badaix badaix closed this as completed Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release fixed in develop branch and will be part of the next release
Projects
None yet
Development

No branches or pull requests

10 participants