You are not logged in.

#1 2021-02-22 10:36:07

lambdarch
Member
Registered: 2021-01-10
Posts: 67

[SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

Hello,

From time to time, during the post-transaction phase of the package update process, I get this error from systemd-sysusers or systemd-tmpfiles --create:

Assertion 'fclose_nointr(f) != -EBADF' failed at src/basic/fd-util.c:126, function safe_fclose(). Aborting.
/usr/share/libalpm/scripts/systemd-hook : ligne 19 :  1039 Abandon                 (core dumped)/usr/bin/systemd-sysusers

It usually comes from systemd-tmpfiles --create, but this morning it was systemd-sysusers, as shown in the second line above.
Here are the packages that have been updated:

imagemagick-7.0.11.1-1-x86_64
libibus-1.5.24-1-x86_64
perl-http-message-6.28-1-any
sane-1.0.32-3-x86_64
haskell-aeson-1.5.5.1-25-x86_64
shellcheck-0.7.1-299-x86_64
youtube-dl-2021.02.22-1-any

And here is the core dump:

Process 1039 (systemd-sysuser) of user 0 dumped core.

Stack trace of thread 1039:
#0  0x00007fdd6e585ef5 raise (libc.so.6 + 0x3cef5)
#1  0x00007fdd6e56f862 abort (libc.so.6 + 0x26862)
#2  0x00007fdd6dc98404 n/a (libnss_systemd.so.2 + 0x25404)
#3  0x00007fdd6dc8ef08 n/a (libnss_systemd.so.2 + 0x1bf08)
#4  0x00007fdd6dc96370 n/a (libnss_systemd.so.2 + 0x23370)
#5  0x00007fdd6dc9716a n/a (libnss_systemd.so.2 + 0x2416a)
#6  0x00007fdd6dc974d9 n/a (libnss_systemd.so.2 + 0x244d9)
#7  0x00007fdd6dc7f53c _nss_systemd_getgrnam_r (libnss_systemd.so.2 + 0xc53c)
#8  0x00007fdd6e613039 getgrnam_r@@GLIBC_2.2.5 (libc.so.6 + 0xca039)
#9  0x00007fdd6e6123fc getgrnam (libc.so.6 + 0xc93fc)
#10 0x0000563d74c72102 n/a (systemd-sysusers + 0x5102)
#11 0x0000563d74c721e1 n/a (systemd-sysusers + 0x51e1)
#12 0x0000563d74c73fb0 n/a (systemd-sysusers + 0x6fb0)
#13 0x0000563d74c70a50 n/a (systemd-sysusers + 0x3a50)
#14 0x00007fdd6e570b25 __libc_start_main (libc.so.6 + 0x27b25)
#15 0x0000563d74c70e5e n/a (systemd-sysusers + 0x3e5e)

I have found several mentions of this error on the Internet, but I can't really relate them to the case of installing packages under Arch.

Would you have some explanations to give me about this? Thank you.

Last edited by lambdarch (2021-04-21 10:23:46)

Offline

#2 2021-02-23 00:14:57

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

If you can reproduce the issue I would suggest rebuilding systemd with debug sysmbols and post the trace with the debug symbols.

Offline

#3 2021-02-23 17:17:42

lambdarch
Member
Registered: 2021-01-10
Posts: 67

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

Unfortunately I can't reproduce this issue. I downgraded my system to 2021-02-20 using archive.archlinux.org, then re-upgraded day by day, without encountering this error.

So following your advice, I compiled systemd from source using systemd-git from AUR, by making it point to refs/tags/v247 and enabling debug via options=('debug' '!strip') and -Dmode=developer.
I'm now running this custom systemd version, so hopefully I will be able to give more details next time.
Thanks!

Offline

#4 2021-02-26 10:48:28

lambdarch
Member
Registered: 2021-01-10
Posts: 67

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

New crash this morning, of  systemd-tmpfiles this time. There seems to be more information than last time:

Process 1044 (systemd-tmpfile) of user 0 dumped core.

Stack trace of thread 1044:
#0  0x00007f2e5b330ef5 raise (libc.so.6 + 0x3cef5)
#1  0x00007f2e5b31a862 abort (libc.so.6 + 0x26862)
#2  0x00007f2e5aa4e464 log_assert_failed_realm.constprop.0 (libnss_systemd.so.2 + 0x25464)
#3  0x00007f2e5aa44f68 varlink_enqueue_json (libnss_systemd.so.2 + 0x1bf68)
#4  0x00007f2e5aa4c3d0 userdb_connect (libnss_systemd.so.2 + 0x233d0)
#5  0x00007f2e5aa4d1ca userdb_start_query (libnss_systemd.so.2 + 0x241ca)
#6  0x00007f2e5aa4d539 groupdb_by_name (libnss_systemd.so.2 + 0x24539)
#7  0x00007f2e5aa3553c _nss_systemd_getgrnam_r (libnss_systemd.so.2 + 0xc53c)
#8  0x00007f2e5b3be039 getgrnam_r@@GLIBC_2.2.5 (libc.so.6 + 0xca039)
#9  0x00007f2e5b3bd3fc getgrnam (libc.so.6 + 0xc93fc)
#10 0x00007f2e5b639621 get_group_creds (libsystemd-shared-247.so + 0x14c621)
#11 0x000056533c29ba50 read_config_file (systemd-tmpfiles + 0xaa50)
#12 0x000056533c295c36 main (systemd-tmpfiles + 0x4c36)
#13 0x00007f2e5b31bb25 __libc_start_main (libc.so.6 + 0x27b25)
#14 0x000056533c295fee _start (systemd-tmpfiles + 0x4fee)

Hopefully this will help...

EDIT: to be complete, packages updated:

extra/openvpn
community/shellcheck
extra/thunderbird
extra/thunderbird-i18n-fr

pacman logs:

:: Exécution des crochets de post-transaction…
(1/7) Creating system user accounts...
(2/7) Reloading system manager configuration...
(3/7) Creating temporary files...
Assertion 'fclose_nointr(f) != -EBADF' failed at src/basic/fd-util.c:126, function safe_fclose(). Aborting.
/usr/share/libalpm/scripts/systemd-hook : ligne 19 :  1044 Abandon                 (core dumped)/usr/bin/systemd-tmpfiles --create
erreur : la commande n’a pas pu être exécutée correctement
(4/7) Arming ConditionNeedsUpdate...
(5/7) Registering Haskell modules...
(6/7) Updating icon theme caches...
(7/7) Updating the desktop file MIME type cache...

Last edited by lambdarch (2021-02-26 10:51:58)

Offline

#5 2021-02-26 15:12:18

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

Is your /usr/share/libalpm/scripts/systemd-hook different from the package version? The reason I ask is because in my version line 19 is the start of the case statement, not the execution of "/usr/bin/systemd-tmpfiles --create", but that could also be a lack of knowledge on bash line numbering on my part.

What happens if you run /usr/bin/systemd-tmpfiles --create manually (as root)? Does it always fail?

Offline

#6 2021-02-26 16:19:49

lambdarch
Member
Registered: 2021-01-10
Posts: 67

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

twelveeighty wrote:

Is your /usr/share/libalpm/scripts/systemd-hook different from the package version? The reason I ask is because in my version line 19 is the start of the case statement, not the execution of "/usr/bin/systemd-tmpfiles --create", but that could also be a lack of knowledge on bash line numbering on my part.

No, I did not modify this file: systemd-tmpfiles --create is at line 24, but for some reason, in this context, the error is reported at the beginning of the case statement.

twelveeighty wrote:

What happens if you run /usr/bin/systemd-tmpfiles --create manually (as root)? Does it always fail?

No, it even seems to always succeed:

$ sudo /usr/bin/systemd-tmpfiles --create
$ echo $?
0
$

Offline

#7 2021-03-12 13:54:31

lambdarch
Member
Registered: 2021-01-10
Posts: 67

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

I opened a bug report: https://bugs.archlinux.org/task/69952

Offline

#8 2021-04-21 10:24:22

lambdarch
Member
Registered: 2021-01-10
Posts: 67

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

This seems to have been fixed by the update of systemd 248-1 (see the bug report).

Offline

#9 2021-07-06 14:04:35

coldspark
Member
Registered: 2020-02-12
Posts: 8

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

Still experiencing this with systemd-248.3-2. Should I open a new thread??

Assertion 'fd' failed at src/tmpfiles/tmpfiles.c:843, function fd_set_perms(). Aborting.
/usr/share/libalpm/scripts/systemd-hook: line 28:  1011 Aborted                 (core dumped) /usr/bin/systemd-tmpfiles --create

Last edited by coldspark (2021-07-06 14:08:00)

Offline

#10 2021-07-06 14:28:37

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

Yes, I'd say open a new thread: OP's error log showed a different assertion failure: "function safe_fclose()" vs. "function fd_set_perms()" in your logs, so open a new thread, but link to this one for reference.

Offline

#11 2021-07-06 17:14:37

lambdarch
Member
Registered: 2021-01-10
Posts: 67

Re: [SOLVED] `systemd-sysusers` or `systemd-tmpfiles --create` core dump

+1: no occurrence of "fd_set_perms" in my logs.

Offline

Board footer

Powered by FluxBB