sync_file_range fails in nspawn containers on arm, ppc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| systemd (Ubuntu) |
Undecided
|
Unassigned | ||
| Bionic |
Medium
|
Dan Streetman | ||
| Disco |
Medium
|
Dan Streetman |
Bug Description
[impact]
calling the glibc function sync_file_range() on a armhf nspawn container fails.
[test case]
see sample C program from original description below. compile and run that inside a nspawn container on armhf and it will fail.
nspawn instructions:
sudo apt install debootstrap systemd-container
sudo -i
debootstrap --arch=armhf bionic ~/bionic-tree/
systemd-nspawn -D ~/bionic-tree/
[regression potential]
this only adjusts nspawn to allow the sync_file_range2 syscall which is used on armhf, so the regression potential is very low. any possible regressions would likely be when calling sync_file_range().
[other info]
original description:
---
ARM has two sync_file_range syscalls, sync_file_range and sync_file_range2. The former is apparently not used, and glibc calls the latter whenever a userspace program calls sync_file_range. I'm guessing systemd-nspawn doesn't know this, because the follow code consistently fails in an nspawn container on ARM:
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
void main()
{
int f = open("/
int r=sync_
if (r)
close(f);
}
This seems to be causing problems specifically for borg(backup) and postgres:
https:/
https:/
The solution should be to cherrypick https:/
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: systemd-container 237-3ubuntu10.24
Uname: Linux 4.14.66+ armv7l
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: armhf
Date: Mon Aug 19 11:10:48 2019
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
Steve Dodd (anarchetic) wrote : | #1 |
Dimitri John Ledkov (xnox) wrote : | #2 |
Dimitri John Ledkov (xnox) wrote : | #3 |
this is cherrypickable, yes.
Steve Dodd (anarchetic) wrote : | #4 |
Test packages in case anyone wants them: https:/
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
tags: | added: next-ddstreet systemd |
tags: |
added: ddstreet disco removed: next-ddstreet |
Changed in systemd (Ubuntu Disco): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in systemd (Ubuntu Bionic): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in systemd (Ubuntu Disco): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu Disco): | |
status: | New → In Progress |
Changed in systemd (Ubuntu Bionic): | |
status: | New → In Progress |
Dan Streetman (ddstreet) wrote : | #5 |
I'm having trouble reproducing this on a Bionic nspawn container on arm64; what host release, and container release, are you using? Are you using the latest glibc and systemd?
Steve Dodd (anarchetic) wrote : Re: [Bug 1840640] Re: sync_file_range fails in nspawn containers on arm, ppc | #6 |
Can't check at the moment, but details should have been added by apport.
Is it possible arm64 abi is different from armhf (32bit?)
On Thu, 3 Oct 2019, 22:41 Dan Streetman, <email address hidden>
wrote:
> I'm having trouble reproducing this on a Bionic nspawn container on
> arm64; what host release, and container release, are you using? Are you
> using the latest glibc and systemd?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> sync_file_range fails in nspawn containers on arm, ppc
>
> To manage notifications about this bug go to:
>
> https:/
>
Dan Streetman (ddstreet) wrote : | #7 |
> Is it possible arm64 abi is different from armhf (32bit?)
ah, that was it, thanks, I can reproduce it now :)
description: | updated |
description: | updated |
Steve Langasek (vorlon) wrote : | #8 |
The test case here should explain to the tester how to set up an nspawn container to reproduce this.
Changed in systemd (Ubuntu Disco): | |
status: | In Progress → Incomplete |
Changed in systemd (Ubuntu Bionic): | |
status: | In Progress → Incomplete |
description: | updated |
Hello Steve, or anyone else affected,
Accepted systemd into disco-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in systemd (Ubuntu Disco): | |
status: | Incomplete → Triaged |
Changed in systemd (Ubuntu Bionic): | |
status: | Incomplete → Triaged |
status: | Triaged → Confirmed |
status: | Confirmed → In Progress |
Changed in systemd (Ubuntu Disco): | |
status: | Triaged → In Progress |
status: | In Progress → Fix Committed |
tags: | added: verification-needed verification-needed-disco |
All autopkgtests for the newly accepted systemd (240-6ubuntu5.8) for disco have finished running.
The following regressions have been reported in tests triggered by the package:
prometheus-
php7.2/
gvfs/1.
pdns-recursor/
webhook/unknown (armhf)
munin/2.
systemd/
Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUp
https:/
[1] https:/
Thank you!
Steve Dodd (anarchetic) wrote : | #11 |
@vorlon, will do my best to test the disco version, but I don't currently have an ARM disco environment, and usual health battles mean it'll probably be a struggle to set one up - I'll have a go though!
The bionic version I will of course be all over :)
Steve Dodd (anarchetic) wrote : | #12 |
OK, I've had a go, but oddly I can't reproduce this in a disco VM at the moment, which makes testing the fix tricky..
Steve Dodd (anarchetic) wrote : | #13 |
OK, so my kernel didn't have seccomp support compiled in and systemd just silently fails to set seccomp filters in that case.
Have now reproduced the bug on an armhf disco VM, and verified that the package in proposed, 240-6ubuntu5.8 fixes it.
tags: |
added: verification-done-disco removed: verification-needed-disco |
Hello Steve, or anyone else affected,
Accepted systemd into bionic-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in systemd (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed-bionic |
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.32) | #15 |
All autopkgtests for the newly accepted systemd (237-3ubuntu10.32) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:
gvfs/1.
linux/unknown (ppc64el)
Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUp
https:/
[1] https:/
Thank you!
Hello Steve, or anyone else affected,
Accepted systemd into bionic-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.33) | #17 |
All autopkgtests for the newly accepted systemd (237-3ubuntu10.33) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:
gvfs/1.
dovecot/
umockdev/0.11.1-1 (ppc64el)
Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUp
https:/
[1] https:/
Thank you!
Steve Dodd (anarchetic) wrote : | #18 |
Just tested on bionic, looks good - thanks everyone!
tags: |
added: verification-done verification-done-bionic removed: verification-needed verification-needed-bionic |
Launchpad Janitor (janitor) wrote : | #19 |
This bug was fixed in the package systemd - 240-6ubuntu5.8
---------------
systemd (240-6ubuntu5.8) disco; urgency=medium
[ Victor Tapia ]
* d/p/resolved_
Fix regression introduced by
resolved-
DNSSEC=yes (LP: #1796501)
[ Dan Streetman ]
* d/p/lp1840640-
allow sync_file_range2 in nspawn container (LP: #1840640)
* d/p/lp1847527-
do not request Content-Length if Transfer-Encoding is chunked
(LP: #1847527)
* d/t/storage: fix flaky test
(LP: #1847815)
* d/p/lp1843381-
debian/
fix rename delay for systems using "Dell MAC passthrough"
(LP: #1843381)
* d/p/lp1849733/
d/p/
ignore EDNS0 payload limit when responding over TCP (LP: #1849733)
* d/p/lp1849658-
- Fix bug in refcounting TCP stream types (LP: #1849658)
* d/extra/
- only restart resolved if dhclient conf changed (LP: #1805183)
[ Balint Reczey ]
* d/p/test-
fix test breakage due to running in nested lxd container
(LP: #1845337)
-- Dan Streetman <email address hidden> Fri, 04 Oct 2019 09:06:58 -0400
Changed in systemd (Ubuntu Disco): | |
status: | Fix Committed → Fix Released |
The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
Launchpad Janitor (janitor) wrote : | #21 |
This bug was fixed in the package systemd - 237-3ubuntu10.33
---------------
systemd (237-3ubuntu10.33) bionic; urgency=medium
* d/p/lp1852754/
d/p/
d/p/
- Complete link setup after setting mtu (LP: #1852754)
systemd (237-3ubuntu10.32) bionic; urgency=medium
[ Victor Tapia ]
* d/p/resolved_
Fix regression introduced by
resolved-
DNSSEC=yes (LP: #1796501)
[ Dan Streetman ]
* d/p/fix-
- Fix typo in previous patch
* d/p/lp1840640-
- allow sync_file_range2 in nspawn container
(LP: #1840640)
* d/p/lp1783994-
- avoid systemd-
(LP: #1783994)
* d/p/lp1832672-
- do not fail entire file on error when parsing /etc/hosts
- parse # char anywhere in line as start of comment
(LP: #1832672)
* d/p/lp1843381-
debian/
- fix rename delay for systems using "Dell MAC passthrough"
(LP: #1843381)
* d/p/lp1849733/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
- add TCP pipelining to handle getaddrinfo() fallback to TCP
- ignore EDNS0 payload limit when responding over TCP (LP: #1849733)
* d/p/lp1849658-
- Fix bug in refcounting TCP stream types (LP: #1849658)
* d/p/lp1850704/
d/p/
- Fix setting mtu if interface already up (LP: #1850704)
* d/extra/
- only restart resolved if dhclient conf changed (LP: #1805183)
-- Dan Streetman <email address hidden> Fri, 15 Nov 2019 10:01:16 -0500
Changed in systemd (Ubuntu Bionic): | |
status: | Fix Committed → Fix Released |
https:/ /github. com/systemd/ systemd/ pull/13352/ commits/ 90ddac6087b5f8f 3736364cfdf698e 713f7e8869. patch