autopkgtest failure in focal

Bug #1856083 reported by Lucas Kanashiro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
runc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I've tried to execute autopkgtest against runc version 1.0.0~rc8+git20190923.3e425f80-0ubuntu1 in a focal amd64 LXD container and it is failing:

$ autopkgtest -U runc_1.0.0~rc8+git20190923.3e425f80-0ubuntu1.dsc -- lxd ubuntu-daily:devel
...
=== RUN TestBlkioSetWeight
--- PASS: TestBlkioSetWeight (0.00s)
=== RUN TestBlkioSetWeightDevice
--- PASS: TestBlkioSetWeightDevice (0.00s)
=== RUN TestBlkioSetMultipleWeightDevice
--- PASS: TestBlkioSetMultipleWeightDevice (0.00s)
=== RUN TestBlkioStats
--- PASS: TestBlkioStats (0.00s)
=== RUN TestBlkioStatsNoSectorsFile
--- PASS: TestBlkioStatsNoSectorsFile (0.00s)
=== RUN TestBlkioStatsNoServiceBytesFile
--- PASS: TestBlkioStatsNoServiceBytesFile (0.00s)
=== RUN TestBlkioStatsNoServicedFile
--- PASS: TestBlkioStatsNoServicedFile (0.00s)
=== RUN TestBlkioStatsNoQueuedFile
--- PASS: TestBlkioStatsNoQueuedFile (0.00s)
=== RUN TestBlkioStatsNoServiceTimeFile
--- PASS: TestBlkioStatsNoServiceTimeFile (0.00s)
=== RUN TestBlkioStatsNoWaitTimeFile
--- PASS: TestBlkioStatsNoWaitTimeFile (0.00s)
=== RUN TestBlkioStatsNoMergedFile
--- PASS: TestBlkioStatsNoMergedFile (0.00s)
=== RUN TestBlkioStatsNoTimeFile
--- PASS: TestBlkioStatsNoTimeFile (0.00s)
=== RUN TestBlkioStatsUnexpectedNumberOfFields
--- PASS: TestBlkioStatsUnexpectedNumberOfFields (0.00s)
=== RUN TestBlkioStatsUnexpectedFieldType
--- PASS: TestBlkioStatsUnexpectedFieldType (0.00s)
=== RUN TestNonCFQBlkioStats
--- PASS: TestNonCFQBlkioStats (0.00s)
=== RUN TestBlkioSetThrottleReadBpsDevice
--- PASS: TestBlkioSetThrottleReadBpsDevice (0.00s)
=== RUN TestBlkioSetThrottleWriteBpsDevice
--- PASS: TestBlkioSetThrottleWriteBpsDevice (0.00s)
=== RUN TestBlkioSetThrottleReadIOpsDevice
--- PASS: TestBlkioSetThrottleReadIOpsDevice (0.00s)
=== RUN TestBlkioSetThrottleWriteIOpsDevice
--- PASS: TestBlkioSetThrottleWriteIOpsDevice (0.00s)
=== RUN TestCpuSetShares
--- PASS: TestCpuSetShares (0.00s)
=== RUN TestCpuSetBandWidth
--- PASS: TestCpuSetBandWidth (0.00s)
=== RUN TestCpuStats
--- PASS: TestCpuStats (0.00s)
=== RUN TestNoCpuStatFile
--- PASS: TestNoCpuStatFile (0.00s)
=== RUN TestInvalidCpuStat
--- PASS: TestInvalidCpuStat (0.00s)
=== RUN TestCpuSetRtSchedAtApply
--- PASS: TestCpuSetRtSchedAtApply (0.00s)
=== RUN TestCpusetSetCpus
--- PASS: TestCpusetSetCpus (0.00s)
=== RUN TestCpusetSetMems
--- PASS: TestCpusetSetMems (0.00s)
=== RUN TestDevicesSetAllow
--- FAIL: TestDevicesSetAllow (0.00s)
    devices_test.go:53: Failed to parse devices.allow - open /tmp/cgroup_test106984936/devices/devices.allow: no such file or directory
=== RUN TestDevicesSetDeny
--- FAIL: TestDevicesSetDeny (0.00s)
    devices_test.go:92: Failed to parse devices.deny - open /tmp/cgroup_test928540711/devices/devices.deny: no such file or directory
=== RUN TestFreezerSetState
--- PASS: TestFreezerSetState (0.00s)
=== RUN TestFreezerSetInvalidState
--- PASS: TestFreezerSetInvalidState (0.00s)
=== RUN TestHugetlbSetHugetlb
--- PASS: TestHugetlbSetHugetlb (0.00s)
=== RUN TestHugetlbStats
--- PASS: TestHugetlbStats (0.00s)
=== RUN TestHugetlbStatsNoUsageFile
--- SKIP: TestHugetlbStatsNoUsageFile (0.00s)
    hugetlb_test.go:91: Disabled unreliable test
=== RUN TestHugetlbStatsNoMaxUsageFile
--- SKIP: TestHugetlbStatsNoMaxUsageFile (0.00s)
    hugetlb_test.go:107: Disabled unreliable test
=== RUN TestHugetlbStatsBadUsageFile
--- SKIP: TestHugetlbStatsBadUsageFile (0.00s)
    hugetlb_test.go:125: Disabled unreliable test
=== RUN TestHugetlbStatsBadMaxUsageFile
--- SKIP: TestHugetlbStatsBadMaxUsageFile (0.00s)
    hugetlb_test.go:144: Disabled unreliable test
=== RUN TestMemorySetMemory
--- PASS: TestMemorySetMemory (0.00s)
=== RUN TestMemorySetMemoryswap
--- PASS: TestMemorySetMemoryswap (0.00s)
=== RUN TestMemorySetMemoryLargerThanSwap
--- PASS: TestMemorySetMemoryLargerThanSwap (0.00s)
=== RUN TestMemorySetSwapSmallerThanMemory
--- PASS: TestMemorySetSwapSmallerThanMemory (0.00s)
=== RUN TestMemorySetKernelMemory
--- PASS: TestMemorySetKernelMemory (0.00s)
=== RUN TestMemorySetKernelMemoryTCP
--- PASS: TestMemorySetKernelMemoryTCP (0.00s)
=== RUN TestMemorySetMemorySwappinessDefault
--- PASS: TestMemorySetMemorySwappinessDefault (0.00s)
=== RUN TestMemoryStats
--- PASS: TestMemoryStats (0.00s)
=== RUN TestMemoryStatsNoStatFile
--- PASS: TestMemoryStatsNoStatFile (0.00s)
=== RUN TestMemoryStatsNoUsageFile
--- PASS: TestMemoryStatsNoUsageFile (0.00s)
=== RUN TestMemoryStatsNoMaxUsageFile
--- PASS: TestMemoryStatsNoMaxUsageFile (0.00s)
=== RUN TestMemoryStatsNoLimitInBytesFile
--- PASS: TestMemoryStatsNoLimitInBytesFile (0.00s)
=== RUN TestMemoryStatsBadStatFile
--- PASS: TestMemoryStatsBadStatFile (0.00s)
=== RUN TestMemoryStatsBadUsageFile
--- PASS: TestMemoryStatsBadUsageFile (0.00s)
=== RUN TestMemoryStatsBadMaxUsageFile
--- PASS: TestMemoryStatsBadMaxUsageFile (0.00s)
=== RUN TestMemoryStatsBadLimitInBytesFile
--- PASS: TestMemoryStatsBadLimitInBytesFile (0.00s)
=== RUN TestMemorySetOomControl
--- PASS: TestMemorySetOomControl (0.00s)
=== RUN TestNetClsSetClassid
--- PASS: TestNetClsSetClassid (0.00s)
=== RUN TestNetPrioSetIfPrio
--- PASS: TestNetPrioSetIfPrio (0.00s)
=== RUN TestPidsSetMax
--- PASS: TestPidsSetMax (0.00s)
=== RUN TestPidsSetUnlimited
--- PASS: TestPidsSetUnlimited (0.00s)
=== RUN TestPidsStats
--- PASS: TestPidsStats (0.00s)
=== RUN TestPidsStatsUnlimited
--- PASS: TestPidsStatsUnlimited (0.00s)
=== RUN TestGetCgroupParamsInt
--- PASS: TestGetCgroupParamsInt (0.00s)
FAIL
FAIL github.com/opencontainers/runc/libcontainer/cgroups/fs 0.070s

I suspect this is happening after golang-defaults was updated to Go 1.13 (last week or something it was working fine).

Related branches

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

My gut says this is more likely to be systemd or the kernel but we should look into it further indeed.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Michael, as you were expecting it is not a Go related issue. I tried to build it with Go 1.12 in a focal amd64 container and had the same failure.

summary: - autopkgtest fails with Go 1.13
+ autopkgtest failure in focal
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

I've been investigating the TestDevicesSetAllow failure and here are my findings so far:

* Here is the TestDevicesSetAllow function: https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/fs/devices_test.go#L36
* When it tries the read the file "devices.allow" in cgroups path (in a temp dir) it doesn't exist and the error is raised: https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/fs/devices_test.go#L51
* Calling the Set function with a given configuration should create this file since the config has a list with allowed devices and it doesn't allow all devices: https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/fs/devices_test.go#L47
* Right in the beginning of the Set function it checks if it is running in a user namespace, if that is true it returns nil and the given configuration is not written in any config file, and this is the case here: https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/fs/devices.go#L29

So this is the reason of the failure, it is running in a user namespace and the test doesn't expect that. The other test failure (TestDevicesSetDeny) faces the same problem.

I also checked the RunningInUserNS function which determines if it is running in an user namespace: https://github.com/opencontainers/runc/blob/master/libcontainer/system/linux.go#L105

* It calls the function CurrentProcessUIDMap which returns the content of /proc/self/uid_map : https://github.com/opencontainers/runc/blob/master/libcontainer/user/lookup_unix.go#L138
* I checked the content of /proc/self/uid_map in a focal and eoan amd64 containers and both contain the same value: 0 1000000 1000000000
* Since CurrentProcessUIDMap returns the mentioned content the RunningInUserNM returns the value returned by UIDMaoInUserNS function: https://github.com/opencontainers/runc/blob/master/libcontainer/system/linux.go#L111
* The condition in UIDMapInUserNS is not satisfied and then it returns true: https://github.com/opencontainers/runc/blob/master/libcontainer/system/linux.go#L119

Due to this the Set function mentioned before returns nil before doing any change in the configuration and the test fails.

P.S.: All the links I added is pointing to master but the parts of the code I mentioned here haven't changed so far (compared to the version we have in the archive - 1.0.0~rc8+git20190923.3e425f80-0ubuntu1). I just used those links because I think it is easier when I follow the code.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Oh, I hadn't realized that you were running in the lxd backend. I'm not super surprised that fails. It might work in a privileged container maybe? We should probably add isolation-machine or whatever the restriction is to d/tests/control.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runc - 1.0.0~rc10-0ubuntu1

---------------
runc (1.0.0~rc10-0ubuntu1) focal; urgency=medium

  [ Lucas Kanashiro ]
  * Run dh_golang_autopkgtest with isolation-machine restriction (LP: #1856083)
    - d/control: remove Testsuite field since we are now overwriting the
      autodep8 test definition.
    - d/t/control: overwrite autodep8 test definition to add isolation-machine
      restriction.
  * d/t/control: Use commas in Restrictions field of basic-smoke test

  [ Tianon Gravi ]
  * Update to 1.0.0-rc10 upstream release

 -- Tianon Gravi <email address hidden> Tue, 18 Feb 2020 09:06:24 +1300

Changed in runc (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.