Skip to content

nss-systemd: fix pointer calculation#21944

Merged
yuwata merged 2 commits intosystemd:mainfrom
yuwata:nss-systemd-fix-pointer
Jan 2, 2022
Merged

nss-systemd: fix pointer calculation#21944
yuwata merged 2 commits intosystemd:mainfrom
yuwata:nss-systemd-fix-pointer

Conversation

@yuwata
Copy link
Copy Markdown
Member

@yuwata yuwata commented Dec 30, 2021

Follow-up for 1e65eb8.

Fixes #21935.

@bluca bluca added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Dec 31, 2021
@yuwata yuwata force-pushed the nss-systemd-fix-pointer branch 2 times, most recently from 0d7a258 to 92e9df9 Compare December 31, 2021 01:17
@bluca
Copy link
Copy Markdown
Member

bluca commented Dec 31, 2021

ESC[31mFAIL: test-nss-usersESC[0m
======== systemd ========
_nss_systemd_getpwnam_r("root") → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "root" / 0:0
        passwd="x"
        gecos="Super User"
        dir="/root"
        shell="/bin/sh"
_nss_systemd_getgrnam_r("root") → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "root" / 0
        passwd="x"
        members=
_nss_systemd_getpwnam_r("nobody") → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "nobody" / 65534:65534
        passwd="!*"
        gecos="User Nobody"
        dir="/"
        shell="/usr/sbin/nologin"
_nss_systemd_getgrnam_r("nobody") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getpwnam_r("foo_no_such_user") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getgrnam_r("foo_no_such_user") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getpwnam_r("0") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getgrnam_r("0") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getpwnam_r("65534") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getgrnam_r("65534") → status=NSS_STATUS_NOTFOUND
                   errno=999/---
_nss_systemd_getpwuid_r(0) → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "root" / 0:0
        passwd="x"
        gecos="Super User"
        dir="/root"
        shell="/bin/sh"
_nss_systemd_getgrgid_r(0) → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "root" / 0
        passwd="x"
        members=
_nss_systemd_getpwuid_r(65534) → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "nobody" / 65534:65534
        passwd="!*"
        gecos="User Nobody"
        dir="/"
        shell="/usr/sbin/nologin"
_nss_systemd_getgrgid_r(65534) → status=NSS_STATUS_SUCCESS
                   errno=999/---
        "nogroup" / 65534
        passwd="!*"
        members=
 
======== mymachines ========
Failed to load module mymachines: libnss_mymachines.so.2: cannot open shared object file: No such file or directory

@bluca bluca added ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR and removed good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed labels Dec 31, 2021
@Arfrever
Copy link
Copy Markdown

ESC[31mFAIL: test-nss-usersESC[0m
...
======== mymachines ========
Failed to load module mymachines: libnss_mymachines.so.2: cannot open shared object file: No such file or directory

While this ideally would need fixing (probably in #21946), the same libnss_mymachines.so.2: cannot open shared object file: No such file or directory failure most likely happens both without and with this patchset (#21944).

@evverx
Copy link
Copy Markdown
Contributor

evverx commented Dec 31, 2021

ESC[31mFAIL: test-nss-usersESC[0m

I'm pretty sure it has nothing with this patch. The systemd autopkgtest should be fixed instead. In #21778 I "fixed" it by skipping that test on Ubuntu CI/Semaphore CI with

To make the nss tests work various libnss_* packages should be
listed among the "unit-tests" dependencies in
https://salsa.debian.org/systemd-team/systemd/-/blob/upstream-ci/debian/tests/control

Currently only libnss-systemd is installed there to judge from
https://autopkgtest.ubuntu.com/results/autopkgtest-focal-upstream-systemd-ci-systemd-ci/focal/amd64/s/systemd-upstream/20211231_014851_745d6@/log.gz

autopkgtest [00:52:42]: test unit-tests: preparing testbed
Get:1 file:/tmp/autopkgtest.1eS7IS/binaries  InRelease
Ign:1 file:/tmp/autopkgtest.1eS7IS/binaries  InRelease
Get:2 file:/tmp/autopkgtest.1eS7IS/binaries  Release [816 B]
Get:2 file:/tmp/autopkgtest.1eS7IS/binaries  Release [816 B]
Get:3 file:/tmp/autopkgtest.1eS7IS/binaries  Release.gpg
Ign:3 file:/tmp/autopkgtest.1eS7IS/binaries  Release.gpg
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 9 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/11.0 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 file:/tmp/autopkgtest.1eS7IS/binaries  libsystemd0 250.85.g765d4da642.0 [405 kB]
Get:2 file:/tmp/autopkgtest.1eS7IS/binaries  systemd-timesyncd 250.85.g765d4da642.0 [135 kB]
Get:3 file:/tmp/autopkgtest.1eS7IS/binaries  systemd 250.85.g765d4da642.0 [4502 kB]
Get:4 file:/tmp/autopkgtest.1eS7IS/binaries  systemd-sysv 250.85.g765d4da642.0 [116 kB]
Get:5 file:/tmp/autopkgtest.1eS7IS/binaries  libudev1 250.85.g765d4da642.0 [185 kB]
Get:6 file:/tmp/autopkgtest.1eS7IS/binaries  udev 250.85.g765d4da642.0 [1591 kB]
Get:7 file:/tmp/autopkgtest.1eS7IS/binaries  libnss-systemd 250.85.g765d4da642.0 [254 kB]
Get:8 file:/tmp/autopkgtest.1eS7IS/binaries  libpam-systemd 250.85.g765d4da642.0 [312 kB]
Get:9 file:/tmp/autopkgtest.1eS7IS/binaries  systemd-tests 250.85.g765d4da642.0 [3476 kB]

@evverx evverx removed the ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR label Dec 31, 2021
@evverx
Copy link
Copy Markdown
Contributor

evverx commented Jan 1, 2022

Apparently test/TEST-02-UNITTESTS/deny-list-ubuntu-ci can't be used to skip the "unit tests" test on Ubuntu CI/Semaphore CI. I'm not sure why it's still there though considering the "upstream" test basically includes the "unit tests" test.

@bluca
Copy link
Copy Markdown
Member

bluca commented Jan 2, 2022

I don't remember seeing this fail before, and it seems too unlucky for a coincidence - I've restarted the job, let's see what happens

@evverx
Copy link
Copy Markdown
Contributor

evverx commented Jan 2, 2022

As far as I can tell @yuwata temporarily included #21946 in this PR and it seems that test failed because of that. Currently those tests are "manual" and shouldn't be run by the CI.

it seems too unlucky for a coincidence

Agreed.

@yuwata
Copy link
Copy Markdown
Member Author

yuwata commented Jan 2, 2022

Yeah, the error should not be related to this. I guess there is some confusion in the CI environment caused when I dropped the commit about enabling the tests by default.

@yuwata
Copy link
Copy Markdown
Member Author

yuwata commented Jan 2, 2022

Yay. All green! Merging.

@yuwata yuwata merged commit 63e10c0 into systemd:main Jan 2, 2022
@yuwata yuwata deleted the nss-systemd-fix-pointer branch January 2, 2022 20:32
@evverx
Copy link
Copy Markdown
Contributor

evverx commented Jan 2, 2022

It would be great to fix the "unit tests" test on Ubuntu CI though to make it possible to run the nss tests there though. It should unblock #21946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

SIGBUS on SPARC caused by NSS lookups

5 participants