error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
Zip
Posts: 5
Joined: 29 Aug 2017 17:46

error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by Zip »

Today I started installing z-way-server on a fresh Raspberry Pi 5 Model B Rev 1.0
When trying to start the z-way-server it breaks with:

Code: Select all

raspberrypi z-way-server[10912]: z-way-server: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned
(I had to edit /etc/init.d/z-way-server to not supress error messages)

Code: Select all

uname -a
Linux raspberrypi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux

Code: Select all

sudo service z-way-server status
● z-way-server.service - LSB: RaZberry Z-Wave service
     Loaded: loaded (/etc/init.d/z-way-server; generated)
     Active: active (exited) since Fri 2024-07-19 11:50:57 CEST; 7s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 10907 ExecStart=/etc/init.d/z-way-server start (code=exited, status=0/SUCCESS)
        CPU: 4ms

Jul 19 11:50:57 raspberrypi systemd[1]: Starting z-way-server.service - LSB: RaZberry Z-Wave service...
Jul 19 11:50:57 raspberrypi z-way-server[10907]: Starting z-way-server: done.
Jul 19 11:50:57 raspberrypi z-way-server[10912]: z-way-server: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned
Jul 19 11:50:57 raspberrypi systemd[1]: Started z-way-server.service - LSB: RaZberry Z-Wave service.

Code: Select all

ls /dev/ttyA*
/dev/ttyAMA10
I used this command for installation:

Code: Select all

wget -q -O - https://razberry.z-wave.me/install | sudo bash
seattleneil
Posts: 234
Joined: 02 Mar 2020 22:41

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by seattleneil »

I'll try to provide a useful response, but I don't have a Raspberry Pi 5 and haven't experienced this issue on my Pi 4.

This error message occurs when the libxml2 shared library is not compatible with the kernel. There are multiple reasons this can happen, but the solution is the same regardless of the cause. To better understand the problem, you can see the version of libxml2 that's installed, run: dpkg-query -l libxml2. To see the shared library that the kernel is using, run: ldconfig -v -N 2>/dev/null | grep libxml2

The solution is to make sure you're using the latest Pi 5 packages by running the following commands (as root) since the official Pi 5 packages should be compatible with the official Pi 5 kernel:
apt update
apt install libxml2
apt upgrade

After all of the packages have been upgraded, reboot your Pi and then log back into your Pi. With luck, the incompatible shared library issue is fixed.

If you're still seeing the same error message when z-way-server tries to start (based on the output of running service z-way-server status), please read this thread for a potential solution (involves adding kernel=kernel8.img to /boot/firmware/config.txt and rebooting): https://forums.raspberrypi.com/viewtopic.php?t=358453. This configuration change should support 4K alignments.
cashewsslate
Posts: 2
Joined: 28 Dec 2022 10:02

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by cashewsslate »

Thank yougeometry dash subzero! Indeed I had just realized that it is in fact working and not an error after all.
Last edited by cashewsslate on 29 Jul 2024 17:33, edited 1 time in total.
Zip
Posts: 5
Joined: 29 Aug 2017 17:46

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by Zip »

Code: Select all

dpkg-query -l libxml2

Code: Select all

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version                 Architecture Description
+++-==============-=======================-============-=======================>
ii  libxml2:arm64  2.9.14+dfsg-1.3~deb12u1 arm64        GNOME XML library
ii  libxml2:armhf  2.9.14+dfsg-1.3~deb12u1 armhf        GNOME XML library

Code: Select all

ldconfig -v -N 2>/dev/null | grep libxml2

Code: Select all

        libxml2.so.2 -> libxml2.so.2.9.14
        libxml2.so.2 -> libxml2.so.2.9.14
The versions seem to match, dont they? I have no clue what to check next :S
libxml2 is already the newest version (2.9.14+dfsg-1.3~deb12u1)
seattleneil
Posts: 234
Joined: 02 Mar 2020 22:41

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by seattleneil »

Your Pi has 2 versions of libxml2 installed (based on the output of running: dpkg-query -l libxml2) which you need to fix.

Please note that I don't have a Pi 5, and therefore I cannot verify what you need to fix.

That being said, I'm pretty sure you only want the libxml2:arm64 (i.e., you should remove libxml2:armhf since it's a 32-bit architecture).

Try running (as root): apt remove libxml2:armhf

Next, stop and restart the z-way-server process and confirm if the "error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned" error has been fixed.
Zip
Posts: 5
Joined: 29 Aug 2017 17:46

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by Zip »

Thank you very much, seattleneil!

Code: Select all

sudo apt remove libxml2:armhf

Code: Select all

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libacl1:armhf libatomic1:armhf libavahi-client-dev:armhf libavahi-client3:armhf libavahi-common-data:armhf libavahi-common-dev:armhf
  libavahi-common3:armhf libavahi-compat-libdnssd-dev:armhf libavahi-compat-libdnssd1:armhf libbrotli1:armhf libbz2-1.0:armhf libc-ares2:armhf
  libcap2:armhf libcom-err2:armhf libcurl3-gnutls:armhf libdb5.3:armhf libdbus-1-3:armhf libdbus-1-dev:armhf libffi8:armhf libgcrypt20:armhf libgmp10:armhf
  libgnutls30:armhf libgpg-error0:armhf libgssapi-krb5-2:armhf libhogweed6:armhf libicu72:armhf libk5crypto3:armhf libkeyutils1:armhf libkrb5-3:armhf
  libkrb5support0:armhf libldap-2.5-0:armhf liblz4-1:armhf liblzma5:armhf libmosquitto1:armhf libnettle8:armhf libnghttp2-14:armhf libnss-mdns:armhf
  libp11-kit0:armhf libpsl5:armhf librtmp1:armhf libsasl2-2:armhf libsasl2-modules:armhf libsasl2-modules-db:armhf libssh2-1:armhf libssl1.1:armhf
  libssl3:armhf libstdc++6:armhf libsystemd0:armhf libtasn1-6:armhf libwebsockets17:armhf libzstd1:armhf pkg-config:armhf pkgconf:armhf zlib1g:armhf
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libarchive13:armhf libxml2:armhf webif:armhf z-way-full:armhf z-way-server:armhf
0 upgraded, 0 newly installed, 5 to remove and 10 not upgraded.
After this operation, 3,193 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 170902 files and directories currently installed.)
Removing z-way-full:armhf (1.0-latest-version) ...
Removing webif:armhf (1.5) ...
Stopping mongoose (via systemctl): mongoose.service.
Removing z-way-server:armhf (4.1.3-lws17) ...
Stopping z-way-server: start-stop-daemon: warning: failed to kill 753: No such process
done.
Removing libarchive13:armhf (3.6.2-1+deb12u1) ...
Removing libxml2:armhf (2.9.14+dfsg-1.3~deb12u1) ...
Processing triggers for libc-bin (2.36-9+rpt2+deb12u7) ...
These Packages came from installing z-way (I think)

Code: Select all

wget -qO - https://storage.z-wave.me/RaspbianInstall | sudo bash

Code: Select all

The following NEW packages will be installed:
  libacl1:armhf libarchive13:armhf libatomic1:armhf libavahi-client-dev:armhf libavahi-client3:armhf libavahi-common-data:armhf libavahi-common-dev:armhf
  libavahi-common3:armhf libavahi-compat-libdnssd-dev:armhf libavahi-compat-libdnssd1:armhf libbrotli1:armhf libbz2-1.0:armhf libc-ares2:armhf
  libcap2:armhf libcom-err2:armhf libcurl3-gnutls:armhf libdb5.3:armhf libdbus-1-3:armhf libdbus-1-dev:armhf libffi8:armhf libgcrypt20:armhf libgmp10:armhf
  libgnutls30:armhf libgpg-error0:armhf libgssapi-krb5-2:armhf libhogweed6:armhf libicu72:armhf libk5crypto3:armhf libkeyutils1:armhf libkrb5-3:armhf
  libkrb5support0:armhf libldap-2.5-0:armhf liblz4-1:armhf liblzma5:armhf libmosquitto1:armhf libnettle8:armhf libnghttp2-14:armhf libnss-mdns:armhf
  libp11-kit0:armhf libpsl5:armhf librtmp1:armhf libsasl2-2:armhf libsasl2-modules:armhf libsasl2-modules-db:armhf libssh2-1:armhf libssl1.1:armhf
  libssl3:armhf libstdc++6:armhf libsystemd0:armhf libtasn1-6:armhf libwebsockets17:armhf libxml2:armhf libzstd1:armhf pkg-config:armhf pkgconf:armhf
  webif:armhf z-way-full:armhf z-way-server:armhf zlib1g:armhf
0 upgraded, 59 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Am I using the wrong script to install z-way?
lanbrown
Posts: 373
Joined: 01 Jun 2021 08:06

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by lanbrown »

I don't believe Z-Way is a 64-bit program or parts of it are not. I remember something from PoltoS and the remote access portion was not 64-bit.

While there are 32-bit and 64-bit binaries, if an application is only 32-bit then it cannot use the 64-bit binary and thus you need to have both installed.

This dates back to the 90's when Sun introduced 64-bit processors. The OS might have been 64-bit but there were 32-bit and 64-bit binaries installed. The binary needed was used and it could have been the 32-bit or the 64-bit depending on what was calling it.

Remember that there are still people using older Raspberry Pi's and those were 64-bit. While the hardware has been 64-bit for a decade, it was not until more recently that the Pi Foundation offered a 64-bit OS. The original Raspberry Pi has not been discontinued, some models have been, but not the entire line.
seattleneil
Posts: 234
Joined: 02 Mar 2020 22:41

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by seattleneil »

It sure would be nice if the Z-Way install script supported the Pi 5.

Please read this thread for a potential solution (involves adding kernel=kernel8.img to /boot/firmware/config.txt and rebooting): https://forums.raspberrypi.com/viewtopic.php?t=358453. This configuration change should support 4K alignments.

If the work-around doesn't solve the issue, I'm out of suggestions.
lanbrown
Posts: 373
Joined: 01 Jun 2021 08:06

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by lanbrown »

I would think at some point that Z-Way will be 64-bit even though the benefit would be minimal. Performance would not be visible seen, nor would file sizes, RAM, etc. be noticed. If someone is running an original Raspberry Pi, they got their use out of it and to run newer programs means it would be time to upgrade to newer hardware.

An alternative would be to install Home Assistant which does support the Raspberry Pi. Then installed the Z-Way add-on.
https://github.com/Z-Wave-Me/ha-z-wave-me-addon

You will need to make a config.txt change for the Razberry board, just like you need to do for Z-Way.
lanbrown
Posts: 373
Joined: 01 Jun 2021 08:06

Re: error while loading shared libraries: libxml2.so.2: ELF load command address/offset not page-aligned

Post by lanbrown »

If you want to go down the Home Assistant route, here are the Raspberry Pi instructions:
https://www.home-assistant.io/installation/raspberrypi/

You use the Raspberry Pi imager. After it is installed, you can just plug and unplug the card reader to mount it so you can make the changes to config.text for the Razberry. Eject, install the MicroSD card in the Pi, power it on, wait 5 to 15 minutes and hopefully HAOS is up and running. Provide the login information you want to use and then follow the link to the Z-Way add-on in my previous post. Start the add-on and then you access it like you would any Z-Way installation. If you ever want to use Home Assistant with the Z-Way integration you just need to install it and point it to the Z-Way IP and you're off and running.

I'm running the Z-Way add-on on five Raspberyy Pi systems. A backup from a standalone Z-way to the add-on Z-Way will not work. I would assume the reverse is also true. I do have Home Assistant run a daily backup which would include Z-Way. It does not include the controller backup though.
Post Reply