Problem loading libatomic.so.1 on Pi (arm7)

When trying to load Node-RED snap from beta channel (673) to Pi3 (arm7) I get the following in the logs

2021-02-12T21:01:03Z node-red.node-red[4841]: ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
2021-02-12T21:01:03Z node-red.node-red[4841]: /snap/node-red/673/bin/node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

I can see files called libarmmem-v6l.so and libarmmem-v7l.so in that directory -so where / why isn’t the PLATFORM getting substituted correctly ?

this looks suspiciously like this snap was built in an unclean environment on something like raspiOS, libarmmem is a piOS hack to preload certain functions that library (or any calls to it) should not be inside the snap at all.

EDIT: OOPS, forgot to answer the actual question, libatomic is in the libatomic1 package which should be added to the stage-packages … (perhaps that snapcraft.yaml gives a few more ideas :wink: )

https://github.com/ogra1/nodered-snap/blob/master/snap/snapcraft.yaml#L190

well I let snapcraft do the work so if snapcraft.io is “an unclean environment” then yeah so be it… how do we get it cleaned up ?

I did have it in the

    override-build: 
      PATH=$PATH:../npm/bin
      apt-get install libatomic1

section - but yes adding it to stage-packages does seem to fix it…
(well it fixes it up to the point where there is another issue re file permissions - that is being sorted in snapd 29.1…)

Thanks !

1 Like

are you by chance actually just running the snap on a raspiOS install ?

IIRC they add an awful hack to forcefully LD_PRELOAD the lib systemwide to each and every executed binary … you’d have to fix it in the OS (somewhere in /etc/ld.so.preload) itself … there is nothing you could do on the snap side …

(note: you will likely see it for all snaps you execute if i’m correct)

Hi
The build is happening on snapcraft - the install and run is happening on Raspberry Pi3 with raspios.

sudo snap list
Name      Version      Rev    Tracking       Publisher     Notes
core      16-2.48.2.1  10827  latest/stable  canonicalâś“    core
core18    20210128     1989   latest/stable  canonicalâś“    base
node-red  1.2.9        686    latest/edge    noderedteamâś“  -
snapd     2.48.2.1     11042  latest/stable  canonicalâś“    snapd