Skip to contentSkip to conversation

An obscure problem with v2.37 make check

DISCUSSION Bruce Dubbs 3 participants 5 messages Jun 16, 2021 – Jun 18, 2021 Util-Linux package

lore
Share & tools
lore
#0 lore raw

When I built version v2.37, make check hung on me. The problem was in my kernel configuration, but I thought I would pass this on.

First of all, my biggest problem was finding out what had failed. A simple 'make check' ran the tests and when it got to the end, hung.

I could not find any documentation about running the tests, but diving into the Makefile led me to tests/run.sh. By default this runs tests using all cores, but it is unclear if this is meant to be run directly.

In any case running run.sh --parallel=1 (instead of the default 24) allowed me to find the problem test, tests/ts/lsns/ioctl_ns. In this test, it is doing:

my_userns=$(stat -c %i -L /proc/self/ns/user)

My problem was that /proc/self/ns/user did not exist on my system. This was due to a missing CONFIG option in my kernel configuration. Adding that and rebuilding the kernel allowed all tests to pass.

One solution to this problem may be to test for the existence of the file before running 'stat' similar to the tests for programs like 'touch' and 'uniq'. Since this is such an unusual situation, I can understand if you just ignore the issue, however I thought you should know about it.

-- Bruce

maintainer
#1 lore raw
Quoted 9 lines · Bruce Dubbs

When I built version v2.37, make check hung on me. The problem was in my kernel configuration, but I thought I would pass this on.

First of all, my biggest problem was finding out what had failed. A simple 'make check' ran the tests and when it got to the end, hung.

I could not find any documentation about running the tests, but diving into the Makefile led me to tests/run.sh. By default this runs tests using all cores, but it is unclear if this is meant to be run directly.

The tests are designed for smart people, like you who, are able to debug it ;-)

Quoted 3 lines

In any case running run.sh --parallel=1 (instead of the default 24) allowed me to find the problem test, tests/ts/lsns/ioctl_ns. In this test, it is doing:

The --parallel=1 is the default when you execute ./run.sh from command line. This is the way I usually use the tests. The "make check" executes it in parallel to make it faster for automated execution (github actions, travis, random QA, etc.)

Quoted 9 lines

my_userns=$(stat -c %i -L /proc/self/ns/user)

My problem was that /proc/self/ns/user did not exist on my system. This was due to a missing CONFIG option in my kernel configuration. Adding that and rebuilding the kernel allowed all tests to pass.

One solution to this problem may be to test for the existence of the file before running 'stat' similar to the tests for programs like 'touch' and

Sounds good. Please, send patch.

For 3rd party programs you need "ts_check_prog <progname>" at the beginning of the test.

Quoted 2 lines

'uniq'. Since this is such an unusual situation, I can understand if you just ignore the issue, however I thought you should know about it.

It's definitely important to run the tests in more environments to make it stable and I'm happy that we have contributors from non-mainstream distributions.

So, thanks for your feedback.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 4 lines · Karel Zak
Quoted 2 lines

One solution to this problem may be to test for the existence of the file before running 'stat' similar to the tests for programs like 'touch' and

Sounds good. Please, send patch.

Bruce, Karel,

something like this?

util-linux$ git diff

tests/ts/lsns/ioctl_ns +0 -0
index e91f6743f..b8f35e2e5 100755
@@ -24,6 +24,9 @@ ts_init "$*"
 # ts_skip_nonroot
 grep -q '#define HAVE_LINUX_NSFS_H' ${top_builddir}/config.h ||

ts_skip "no ioctl_ns support"

+[ -a /proc/self/ns/user ] || ts_skip "no USER namespace kernel support" +[ -a /proc/self/ns/pid ] || ts_skip "no PID namespace kernel support" +
ts_check_test_command "$TS_CMD_LSNS"
ts_check_test_command "$TS_CMD_UNSHARE"
ts_check_prog "stat"

#3 lore raw
Quoted 20 lines · Anatoly Pugachev
Quoted 4 lines · Karel Zak
Quoted 2 lines

One solution to this problem may be to test for the existence of the file before running 'stat' similar to the tests for programs like 'touch' and

Sounds good. Please, send patch.

Bruce, Karel,

something like this?

util-linux$ git diff

tests/ts/lsns/ioctl_ns +0 -0
index e91f6743f..b8f35e2e5 100755
@@ -24,6 +24,9 @@ ts_init "$*"
  # ts_skip_nonroot
  grep -q '#define HAVE_LINUX_NSFS_H' ${top_builddir}/config.h ||

ts_skip "no ioctl_ns support"

Quoted 7 lines

+[ -a /proc/self/ns/user ] || ts_skip "no USER namespace kernel support" +[ -a /proc/self/ns/pid ] || ts_skip "no PID namespace kernel support" +
ts_check_test_command "$TS_CMD_LSNS"
ts_check_test_command "$TS_CMD_UNSHARE"
ts_check_prog "stat"

Looks pretty good to me, but I would use -r instead of -a.

-- Bruce

maintainer
#4 lore raw
Quoted 11 lines · Bruce Dubbs
Quoted 10 lines · Anatoly Pugachev

util-linux$ git diff

tests/ts/lsns/ioctl_ns +0 -0
index e91f6743f..b8f35e2e5 100755
@@ -24,6 +24,9 @@ ts_init "$*"
  # ts_skip_nonroot
  grep -q '#define HAVE_LINUX_NSFS_H' ${top_builddir}/config.h ||

ts_skip "no ioctl_ns support"

Quoted 9 lines
Quoted 7 lines

+[ -a /proc/self/ns/user ] || ts_skip "no USER namespace kernel support" +[ -a /proc/self/ns/pid ] || ts_skip "no PID namespace kernel support" +
ts_check_test_command "$TS_CMD_LSNS"
ts_check_test_command "$TS_CMD_UNSHARE"
ts_check_prog "stat"

Looks pretty good to me, but I would use -r instead of -a.

Applied with -r, thanks guys!

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com