Bug 2229372

Summary: blkio fails on i686: blkio_start: failed to start device: Cannot allocate memory (os error 12)
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: libblkioAssignee: Stefan Hajnoczi <stefanha>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: afaria, rjones
Target Milestone: ---Keywords: Regression, Reopened
Target Release: ---   
Hardware: i686   
OS: Linux   
URL: https://kojipkgs.fedoraproject.org//work/tasks/2886/104392886/build.log
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-27 14:43:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2023-08-05 11:12:12 UTC
libblkio on Rawhide i686 is broken.  When trying to open a local disk
file it says:

nbdkit: blkio[1]: error: blkio_start: failed to start device: Cannot allocate memory (os error 12)



Reproducible: Always

Steps to Reproduce:
1. Run this nbdkit test on i686:
https://gitlab.com/nbdkit/nbdkit/-/blob/master/tests/test-blkio.sh?ref_type=heads

Actual Results:  
Fails as described.


It seems to be broken within the last few days.  This might be
related to the recent update in Rawhide to 1.3.0.

libblkio 1.3.0-1.fc39

Comment 1 Richard W.M. Jones 2023-08-05 11:20:30 UTC
Seems to work fine on all 64 bit arches.

If you decide not to fix this on 32 bit, please add ExcludeArch: i686
in the spec file.

Comment 2 Richard W.M. Jones 2023-08-05 11:27:07 UTC
I mean ExcludeArch: %{ix86}

Comment 3 Fedora Update System 2023-08-05 12:27:48 UTC
FEDORA-2023-e2392c8748 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e2392c8748

Comment 4 Fedora Update System 2023-08-05 12:29:55 UTC
FEDORA-2023-e2392c8748 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Richard W.M. Jones 2023-08-05 12:50:51 UTC
This bug got associated with the wrong bodhi update ...

Comment 6 Fedora Release Engineering 2023-08-16 08:13:57 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 7 Richard W.M. Jones 2023-09-27 14:32:01 UTC
I can't reproduce this in mock, so I'm going to go back and see if it still happens
inside Koji.  In the meantime since it took me so long to work this out, here are
the steps for testing with a i686 userspace in mock:

(1) Install 'mock', add yourself to the 'mock' group.

(2) Install 'fedora-packager' and check out the nbdkit sources:

  $ fedpkg clone -B -a nbdkit
  $ cd nbdkit/rawhide

(3) Apply this patch to nbdkit to enable libblkio support:

diff --git a/nbdkit.spec b/nbdkit.spec
index 2e4f8a6..0e638d1 100644
--- a/nbdkit.spec
+++ b/nbdkit.spec
@@ -23,11 +23,7 @@
 
 # We don't yet have libblkio on RHEL.
 # libblkio is broken on i686: https://bugzilla.redhat.com/2229372
-%if !0%{?rhel}
-%ifnarch %{ix86}
 %global have_blkio 1
-%endif
-%endif

(4) Build the SRPM:

  $ fedpkg srpm

(5) Build nbdkit in the 32 bit chroot:

  $ mock -r fedora-39-i386 --rebuild nbdkit-1.36.0-1.fc40.src.rpm --no-cleanup-after --nocheck

(6) Go into the chroot and look around:

  $ mock -r fedora-39-i386 --shell --no-clean
  <mock-chroot> sh-5.2# ls build/
  <mock-chroot> sh-5.2# uname -a
  Linux f86cb57f19a1422eb8a946b127c5349e 6.3.7-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun  9 15:21:11 UTC 2023 i686 GNU/Linux
  <mock-chroot> sh-5.2# file /bin/ls
  /bin/ls: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=fc509e8af5a5160bc060ca9aa545e73f790a32af, for GNU/Linux 3.2.0, stripped

(7) Run the program which (should) fail:

  # cd /builddir/build/BUILD/nbdkit-1.36.0
  # truncate -s 1G /var/tmp/disk
  # ./nbdkit -r blkio io_uring path=/var/tmp/disk --run 'nbdinfo "$uri"'

Comment 8 Richard W.M. Jones 2023-09-27 14:43:41 UTC
Welp, it has "fixed itself" somehow:

PASS: test-blkio.sh