libfastjson icon indicating copy to clipboard operation
libfastjson copied to clipboard

libfastjson link error - rsyslogd AUR package segfaults after other packages upgraded

Open zqqw opened this issue 5 months ago • 1 comments

Problem with rsyslog and libfastjson after glibc update on Artix Linux. This error is not present on Arch Linux, and rsyslog works and logs things, but the build configuration is slightly different and rsyslog probably gets the log input from systemd logging.

https://aur.archlinux.org/packages/rsyslog https://aur.archlinux.org/packages/rsyslog-nosystemd-git

For building the rsyslog AUR package on Artix without systemd, these 2 options need to be changed to disable as shown here: --disable-imjournal
--disable-omjournal \

There is another AUR package with this already done, rsyslog-nosystemd-git.

Also at present the second sha256 sum needs changing in the PKGBUILD: $ sha256sum 5406.patch d1c9685d5476ad4e1653e38271612bc219cdf1241efc428bd37c7309f066e348 5406.patch The patch might have changed upstream recently, although the date doesn't show it, because the PKGBUILD hasn't been altered according to the Git log and it worked a few days ago, unless something was altered along with the ongoing DDOS AUR attacks.

$ rsyslogd
rsyslogd: Relink `/usr/lib/libfastjson.so.4' with `/usr/lib/libm.so.6' for IFUNC symbol `modf'
Segmentation fault         rsyslogd

Has modf changed or moved, if this message is not simply misleading and inaccurate? I assume the glibc upgrade is the most likely cause, although some other packages were also upgraded at this time too.

$ ldd -v /usr/lib/libfastjson.so.4
	linux-vdso.so.1 (0x00007f307d2ef000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f307d000000)
	/usr/lib64/ld-linux-x86-64.so.2 (0x00007f307d2f1000)

	Version information:
	/usr/lib/libfastjson.so.4:
		libc.so.6 (GLIBC_2.3) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.8) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.14) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.38) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /usr/lib/libc.so.6
	/usr/lib/libc.so.6:
		ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.3) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.35) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /usr/lib64/ld-linux-x86-64.so.2

Same command for an old file on backup drive gives the same results, rsyslog was still working at this point:

$ ldd -v usr/lib/libfastjson.so.4
	linux-vdso.so.1 (0x00007f644ae87000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f644ac00000)
	/usr/lib64/ld-linux-x86-64.so.2 (0x00007f644ae89000)

	Version information:
	usr/lib/libfastjson.so.4:
		libc.so.6 (GLIBC_2.3) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.8) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.7) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.14) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /usr/lib/libc.so.6
	/usr/lib/libc.so.6:
		ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.3) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.35) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /usr/lib64/ld-linux-x86-64.so.2

It stopped working after rebooting following this update, and doesn't work now even if rebuilt against the new version: Last log date on Dell E7470: Aug 2 20:35:40

Packages upgraded:
[2025-08-02T20:33:43+0100] [PACMAN] Running '/usr/bin/pacman --color always -S -y -u'
[2025-08-02T20:33:43+0100] [PACMAN] synchronizing package lists
[2025-08-02T20:33:49+0100] [PACMAN] starting full system upgrade
[2025-08-02T20:34:55+0100] [ALPM] transaction started
[2025-08-02T20:34:55+0100] [ALPM] upgraded linux-api-headers (6.15-1 -> 6.16-1)
[2025-08-02T20:34:55+0100] [ALPM] upgraded glibc (2.41+r65+ge7c419a29575-1 -> 2.42+r2+g3ec4dd77f648-1)
[2025-08-02T20:34:55+0100] [ALPM-SCRIPTLET] Generating locales...
[2025-08-02T20:34:57+0100] [ALPM-SCRIPTLET]   en_US.UTF-8... done
[2025-08-02T20:34:57+0100] [ALPM-SCRIPTLET] Generation complete.
[2025-08-02T20:34:57+0100] [ALPM] upgraded gcc-libs (15.1.1+r7+gf36ec88aa85a-1 -> 15.1.1+r500+gb1b8d8ce3eea-1)
[2025-08-02T20:34:57+0100] [ALPM] upgraded libsysprof-capture (48.0-5 -> 48.0-6)
[2025-08-02T20:34:57+0100] [ALPM] upgraded at-spi2-core (2.56.3-1 -> 2.56.4-1)
[2025-08-02T20:34:57+0100] [ALPM] upgraded libelf (0.193-2 -> 0.193-3)
[2025-08-02T20:34:57+0100] [ALPM] upgraded binutils (2.44+r94+gfe459e33c676-1 -> 2.45+r8+g09be88bfb653-1)
[2025-08-02T20:34:57+0100] [ALPM] upgraded dejagnu (1.6.3-13 -> 1.6.3-14)
[2025-08-02T20:34:57+0100] [ALPM] upgraded elfutils (0.193-2 -> 0.193-3)
[2025-08-02T20:34:58+0100] [ALPM] upgraded gcc (15.1.1+r7+gf36ec88aa85a-1 -> 15.1.1+r500+gb1b8d8ce3eea-1)
[2025-08-02T20:34:58+0100] [ALPM] upgraded harfbuzz (11.2.1-1 -> 11.3.3-1)
[2025-08-02T20:34:58+0100] [ALPM] upgraded harfbuzz-icu (11.2.1-1 -> 11.3.3-1)
[2025-08-02T20:34:58+0100] [ALPM] upgraded lib32-glibc (2.41+r65+ge7c419a29575-1 -> 2.42+r2+g3ec4dd77f648-1)
[2025-08-02T20:34:59+0100] [ALPM] upgraded lib32-gcc-libs (15.1.1+r7+gf36ec88aa85a-1 -> 15.1.1+r500+gb1b8d8ce3eea-1)
[2025-08-02T20:34:59+0100] [ALPM] upgraded lib32-harfbuzz (11.2.1-1 -> 11.3.3-1)
[2025-08-02T20:34:59+0100] [ALPM] upgraded mesa (1:25.1.6-1 -> 1:25.1.7-1)
[2025-08-02T20:34:59+0100] [ALPM] upgraded libadwaita (1:1.7.5-1 -> 1:1.7.6-1)
[2025-08-02T20:34:59+0100] [ALPM] upgraded libtool (2.5.4+r23+g5b582aed-1 -> 2.5.4+r23+g5b582aed-2)
[2025-08-02T20:34:59+0100] [ALPM] upgraded lightdm-slick-greeter (2.0.9-1 -> 2.2.1-1)
[2025-08-02T20:34:59+0100] [ALPM] upgraded lightdm-settings (2.0.1-1 -> 2.0.8-1)
[2025-08-02T20:35:00+0100] [ALPM] upgraded nodejs (24.4.1-2 -> 24.5.0-1)
[2025-08-02T20:35:00+0100] [ALPM] upgraded unrar (1:7.1.9-1 -> 1:7.1.10-1)
[2025-08-02T20:35:00+0100] [ALPM] upgraded webkit2gtk (2.48.3-1 -> 2.48.5-1)
[2025-08-02T20:35:00+0100] [ALPM] upgraded webkit2gtk-4.1 (2.48.3-1 -> 2.48.5-1)
[2025-08-02T20:35:01+0100] [ALPM] transaction completed

Dell M4500 last log time, rsyslog stopped working after this boot. Aug 2 19:25:20

packages upgraded:
[2025-08-02T19:19:42+0100] [PACMAN] starting full system upgrade
[2025-08-02T19:20:57+0100] [ALPM] transaction started
[2025-08-02T19:20:57+0100] [ALPM] upgraded linux-api-headers (6.15-1 -> 6.16-1)
[2025-08-02T19:20:59+0100] [ALPM] upgraded glibc (2.41+r65+ge7c419a29575-1 -> 2.42+r2+g3ec4dd77f648-1)
[2025-08-02T19:20:59+0100] [ALPM-SCRIPTLET] Generating locales...
[2025-08-02T19:21:01+0100] [ALPM-SCRIPTLET]   de_DE.UTF-8... done
[2025-08-02T19:21:03+0100] [ALPM-SCRIPTLET]   en_GB.UTF-8... done
[2025-08-02T19:21:06+0100] [ALPM-SCRIPTLET]   en_US.UTF-8... done
[2025-08-02T19:21:08+0100] [ALPM-SCRIPTLET]   fr_FR.UTF-8... done
[2025-08-02T19:21:10+0100] [ALPM-SCRIPTLET]   pt_BR.UTF-8... done
[2025-08-02T19:21:12+0100] [ALPM-SCRIPTLET]   ru_RU.UTF-8... done
[2025-08-02T19:21:12+0100] [ALPM-SCRIPTLET] Generation complete.
[2025-08-02T19:21:13+0100] [ALPM] upgraded gcc-libs (15.1.1+r7+gf36ec88aa85a-1 -> 15.1.1+r500+gb1b8d8ce3eea-1)
[2025-08-02T19:21:13+0100] [ALPM] upgraded libsysprof-capture (48.0-5 -> 48.0-6)
[2025-08-02T19:21:14+0100] [ALPM] upgraded at-spi2-core (2.56.3-1 -> 2.56.4-1)
[2025-08-02T19:21:14+0100] [ALPM] upgraded libelf (0.193-2 -> 0.193-3)
[2025-08-02T19:21:14+0100] [ALPM] upgraded binutils (2.44+r94+gfe459e33c676-1 -> 2.45+r8+g09be88bfb653-1)
[2025-08-02T19:21:14+0100] [ALPM] upgraded debuginfod (0.193-2 -> 0.193-3)
[2025-08-02T19:21:14+0100] [ALPM] upgraded elfutils (0.193-2 -> 0.193-3)
[2025-08-02T19:21:16+0100] [ALPM] upgraded gcc (15.1.1+r7+gf36ec88aa85a-1 -> 15.1.1+r500+gb1b8d8ce3eea-1)
[2025-08-02T19:21:16+0100] [ALPM] upgraded harfbuzz (11.2.1-1 -> 11.3.3-1)
[2025-08-02T19:21:16+0100] [ALPM] upgraded harfbuzz-icu (11.2.1-1 -> 11.3.3-1)
[2025-08-02T19:21:17+0100] [ALPM] upgraded lib32-glibc (2.41+r65+ge7c419a29575-1 -> 2.42+r2+g3ec4dd77f648-1)
[2025-08-02T19:21:18+0100] [ALPM] upgraded lib32-gcc-libs (15.1.1+r7+gf36ec88aa85a-1 -> 15.1.1+r500+gb1b8d8ce3eea-1)
[2025-08-02T19:21:18+0100] [ALPM] upgraded lib32-harfbuzz (11.2.1-1 -> 11.3.3-1)
[2025-08-02T19:21:18+0100] [ALPM] upgraded mesa (1:25.1.6-1 -> 1:25.1.7-1)
[2025-08-02T19:21:18+0100] [ALPM] upgraded libadwaita (1:1.7.5-1 -> 1:1.7.6-1)
[2025-08-02T19:21:18+0100] [ALPM] upgraded libtool (2.5.4+r23+g5b582aed-1 -> 2.5.4+r23+g5b582aed-2)
[2025-08-02T19:21:19+0100] [ALPM] upgraded noto-fonts (1:2025.07.01-1 -> 1:2025.08.01-1)
[2025-08-02T19:21:21+0100] [ALPM] upgraded noto-fonts-extra (1:2025.07.01-1 -> 1:2025.08.01-1)
[2025-08-02T19:21:22+0100] [ALPM] upgraded postgresql-libs (17.5-3 -> 17.5-4)
[2025-08-02T19:21:22+0100] [ALPM] upgraded valgrind (3.25.1-1 -> 3.25.1-2)
[2025-08-02T19:21:23+0100] [ALPM] upgraded webkit2gtk-4.1 (2.48.4-1 -> 2.48.5-1)
[2025-08-02T19:21:24+0100] [ALPM] transaction completed

configure.ac in the libfastjson package appears to mention linking to the math lib, and libfastjson has not been changed at all recently:

# AIXPORT : Set the required variables for AIX config script
if test "$unamestr" = "AIX"; then
        export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
        LIBS="-lbsd -lm"
        CPPFLAGS="-D_AIX -D_THREAD_SAFE -D_BSD=43"
        LDFLAGS="-qcpluscmt -brtl -bexpall "
        CC="xlc"
 AC_PREFIX_DEFAULT(/usr)
fi
# AIXPORT END

zqqw avatar Sep 02 '25 21:09 zqqw

Modifying configure.ac before building works to resolve the problem:

diff --git a/original/configure.ac b/modified/configure.ac
index cb9da70..10680db 100644
--- a/original/configure.ac
+++ b/modified/configure.ac
@@ -18,6 +18,7 @@ if test "$unamestr" = "AIX"; then
 fi
 # AIXPORT END
 
+LIBS="-lm"
 
 AC_CONFIG_HEADER(config.h)

Previously modf was provided as a compiler optimization feature without the math lib needing to be linked. Although -lm was in configure.ac, that section only applied to AIX operating systems due to the enclosing test block of the file. I don't know if modf has been permanently moved or if it's just a temporary bug. If a modification like that was to be included here at some point it might want a version check for gcc or glibc, whichever is causing the problem, to avoid any potential behavior changes on older versions? After building like that, the output of ldd shows the difference, and libm is now shown:

$ ldd -v /usr/lib/libfastjson.so
	linux-vdso.so.1 (0x00007fb92f7f7000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007fb92f6a7000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007fb92f400000)
	/usr/lib64/ld-linux-x86-64.so.2 (0x00007fb92f7f9000)

	Version information:
	/usr/lib/libfastjson.so:
		libm.so.6 (GLIBC_2.2.5) => /usr/lib/libm.so.6
		libc.so.6 (GLIBC_ABI_DT_RELR) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.3) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.8) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.14) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.38) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /usr/lib/libc.so.6
	/usr/lib/libm.so.6:
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /usr/lib64/ld-linux-x86-64.so.2
		libc.so.6 (GLIBC_2.36) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_ABI_DT_RELR) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.34) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.35) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.14) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.3.2) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_PRIVATE) => /usr/lib/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /usr/lib/libc.so.6
	/usr/lib/libc.so.6:
		ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.3) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.35) => /usr/lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /usr/lib64/ld-linux-x86-64.so.2

Here is an explanation, possibly it should have had -lm originally according to this: https://unix.stackexchange.com/questions/10176/use-math-h-and-link-objects-files-without-lm "You should always use -lm when using functions from math.h if you want to keep your code/makefiles portable."

zqqw avatar Sep 04 '25 13:09 zqqw