Snapd on Raspbian (stretch)

I’ve been testing snapd on Raspbian based on stretch. There are no Raspbian images based on stretch yet but it is possible to dist-upgrade from a jessie based image. This testing has been shared via email with @JamieBennett @morphis @mvo @zyga-snapd @ogra @slangasek already but I’ll soon be going on vacation so thought it best to bring this discussion to the forum.

Upgrade from Jessie to Stretch

  • Download the latest Raspbian Jessie with Desktop image from https://www.raspberrypi.org/downloads/raspbian/
  • Copy it to an SD card and boot it on a Pi
  • With the Pi booted, edit the two files /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list and change every occurrence of jessie to stretch in both.
  • Run sudo apt-get update
  • Run sudo apt-get dist-upgrade - this will take around an hour on a reasonably fast connection
  • Reboot

Installing snapd

Once upgraded to stretch I ran sudo apt install snapd which works (snapd 2.21 installed) but running sudo snap install emoj results in the install getting stuck at:

INFO snap "core" has bad plugs or slots: core-support-plug (unknown interface)
[\] Run configure hook of "core" snap if present

Interrupting the stalled install with Ctrl+C results in:

ERROR: ld.so: object '/usr/share/lib/arm-linux-gnueabihf/libarmmem.so'
from /etc/ld.so.preload cannot be preloaded. (cannot open shared
object file): ignored.
ERROR: ld.so: object '/usr/share/lib/arm-linux-gnueabihf/libarmmem.so'
from /etc/ld.so.preload cannot be preloaded. (cannot open shared
object file): ignored.
ERROR: ld.so: object '/usr/share/lib/arm-linux-gnueabihf/libarmmem.so'
from /etc/ld.so.preload cannot be preloaded. (cannot open shared
object file): ignored.

I’ve encountered libarmmem.so when building Ubuntu MATE for the Raspberry Pi, it comes from this project:

It pre-loads replacement memcpy() and memset() functionality for the Raspberry Pi with the intention of gaining greater performance.

From our discussion via email @morphis said:

“This very much looks like the seccomp bug we run into with with snapd quite some time ago. Looks like that fix never landed in Debian.”

A couple of potential issue were identified but I’m unclear if this issue is being resolved via an updated snapd package in Debian or a new core image? I’m setup to test and fixes and anyone else with a Pi 3 can also easily get setup and help out with testing too :slight_smile:

1 Like

I had a brief look at this now too. I was able to reproduce this too.I saw a similar error and the configure hook was in [defunct] state in ps afx. Not much more data yet unfortunately.

1 Like

We debugged this bug in Debian core configure hang on first snap install - the issue is indeed that the behaviour is slightly different depending on what the first snap is (details in the other forum post). The good news is that with 2.27.X this problem is fixed. Once that hits stable this bug here should also be fixed.

it seems that there might be a regression here?

using a fresh (and latest) pi raspbian image and just install snapd:

pi@raspberrypi:~ $ snap run hello-world
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Hello World!
pi@raspberrypi:~ $ snap version
snap      2.30
snapd     2.30
series    16
raspbian  9
kernel    4.9.59-v7+
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux
1 Like

My console and syslog on raspbian is being spammed by multiple copies of these messages, which make interaction with command-line snaps uncomfortable.

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

$ snap version
snap      2.34.3
snapd     2.34.3
series    16
raspbian  9
kernel    4.14.52-v7+

$ uname -a
Linux rpi3 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linux

For example:

$ wormhole send
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Text to send: This is ugly...
Sending text message (15 Bytes)
On the other computer, please run: wormhole receive
Wormhole code is: 2-maybe-fix

Can I ask whether there is any progress on this? I’m still seeing these errors when running snaps on raspbian, and it makes interactive command line snaps unpleasant.

I will try this on my raspbian installation at home.

1 Like