Bug 1375732 - 32-bit installer incorrectly calculates space that will be freed by deleting a PV
32-bit installer incorrectly calculates space that will be freed by deleting ...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: libbytesize (Show other bugs)
26
i686 Linux
unspecified Severity high
: ---
: ---
Assigned To: Vratislav Podzimek
Fedora Extras Quality Assurance
https://fedoraproject.org/wiki/Common...
: CommonBugs
Depends On:
Blocks: FE-ExcludeArch-x86/F-ExcludeArch-x86
  Show dependency treegraph
 
Reported: 2016-09-13 16:50 EDT by Adam Williamson
Modified: 2017-09-30 02:29 EDT (History)
8 users (show)

See Also:
Fixed In Version: libbytesize-1.0-1.fc27
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-09-30 02:29:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
anaconda.log (35.40 KB, text/plain)
2016-09-13 16:52 EDT, Adam Williamson
no flags Details
program.log (37.06 KB, text/plain)
2016-09-13 17:12 EDT, Adam Williamson
no flags Details
storage.log (89.87 KB, text/plain)
2016-09-13 17:15 EDT, Adam Williamson
no flags Details
lvm.log (239.67 KB, text/plain)
2016-09-13 17:16 EDT, Adam Williamson
no flags Details

  None (edit)
Description Adam Williamson 2016-09-13 16:50:32 EDT
I have a test VM with a typical Fedora volume group, containing a root and a swap LV on a single disk. For some reason, the PV/VG is as big as it can be (~19.7GiB on a 20GiB disk), but the root LV is only 3GiB. I don't recall why that would be.

Anyhow, if I boot Fedora-Workstation-netinst-x86_64-25-20160912.n.0.iso and go to the 'reclaim space' screen, and choose to delete the PV, it (correctly) calculates that this will reclaim 19.71GiB of space. However, if I boot Fedora-Workstation-netinst-i386-25-20160912.n.0.iso, go to the 'reclaim space' screen, and choose to delete the PV, it (incorrectly) calculates that this will reclaim 3.71GiB of space.

This looks like it might be some kind of integer size problem, but I'm guessing. I'm not sure if the exact layout of the VG really matters, just trying to describe the scenario accurately. I don't see much useful in the logs, but I'll attach 'em.

I don't know when this problem started happening - unfortunately we don't run the relevant openQA tests on 32-bit. I'm guessing blivet is to blame, but reassign as appropriate.

This would be a blocker, but we don't block on i386 any more...
Comment 1 Adam Williamson 2016-09-13 16:52 EDT
Created attachment 1200618 [details]
anaconda.log
Comment 2 Adam Williamson 2016-09-13 17:12 EDT
Created attachment 1200622 [details]
program.log
Comment 3 Adam Williamson 2016-09-13 17:15 EDT
Created attachment 1200627 [details]
storage.log
Comment 4 Adam Williamson 2016-09-13 17:16 EDT
Created attachment 1200628 [details]
lvm.log
Comment 5 Andre Robatino 2016-11-19 12:28:38 EST
I hit this with 25 Final Gold 32-bit, preventing me from installing due to my need for custom partitioning (to get rid of the default /home partition). Maybe a candidate for CommonBugs?
Comment 6 joerg.lechner 2016-11-24 05:40:27 EST
Hi,
Old HP Pavilion Laptop, I think 64bit. Tried to install from DVD iso to install F25 i386 LXDE. Reaching in Anaconda the step "Speicherplatz Freigeben (reclaim space in English)" the button "reclaim space" is not lightened, therefore no action on hitting on it. Worthwhile for a bug report?
Kind regards  - copy from my comment in the lists.

is it useful to try to get logs?
If yes, please tell which logs.
Comment 7 Adam Williamson 2016-11-28 19:42:39 EST
joerg: I don't think logs are really needed, it's a pretty trivial bug to reproduce. I think it's just not a high priority as i386 isn't release blocking any more. If your system can support x86_64, it's really a good idea to do an x86_64 install, all kinds of upstreams are caring less and less about i386 these days.
Comment 8 Andre Robatino 2016-11-28 19:52:40 EST
Adam: Thanks for adding this to the Common Bugs page. I was hoping other people would hit this, so there might be a fix, but it seems unlikely now. Is this type of bug likely to be caused by something really simple, like using an int instead of a long? I couldn't think of any other reason why a size calculation would work on 64-bit but fail on 32.

I'm not comfortable attempting manual partitioning, so I'll just stick to F24 on that machine for now. Maybe do an upgrade eventually (instead of a preferred clean install).
Comment 9 Adam Williamson 2016-11-28 20:35:38 EST
"Is this type of bug likely to be caused by something really simple, like using an int instead of a long?"

It'll be something *like* that, but as anaconda and blivet are Python 3, it won't be *exactly* that unless the issue is in a lower layer that's written in C.
Comment 10 Adam Williamson 2017-04-04 21:41:16 EDT
Confirmed this is still valid in F26. On the RECLAIM DISK SPACE dialog, a 20GiB drive is correctly show as 20 GiB in size in the tree view, and the summary at bottom-left reads "1 disk; 19.81 GiB reclaimable space (in file systems)", which also looks correct. But choosing to delete all filesystems on the disk results in the bottom right saying "Total selected space to reclaim: 4 GiB".
Comment 11 Allan 2017-04-09 10:41:13 EDT
I can confirm this bug on 32bit Fedora LXDE. I used it on an older machine that cant run anything heavier and the only way to install it was to have anaconda automatically assign partitions. Trying to key them in manually is impossible.
Comment 12 Allan 2017-07-15 11:07:33 EDT
Hello today i confirmed this bug persists on Fedora 26 LXQt
Comment 13 Stefan Ring 2017-07-25 18:21:14 EDT
The bug is in libbytesize's Python binding:

>>> import bytesize.bytesize
>>> bytesize.bytesize.Size(0) + 2**36
Size (0 B)

Well, actually it's in the C part of libbytesize, because for example bs_size_add_bytes (responsible for the error shown above) takes a uint64_t, which it happily passes on to mpz_add_ui, which takes an unsigned long, and thus truncation happens.

A workaround would be replacing every occurrence of MAXUINT64 in bytesize.py with sys.maxsize. Of course, it would be better fixing the C interface, which would probably take a bit more work. Although, it would mostly consist of replacing uint64_t with unsigned long.
Comment 14 Adam Williamson 2017-07-25 19:24:18 EDT
Stefan: thanks a lot for tracking that down!
Comment 15 Jeff Backus 2017-09-11 13:11:56 EDT
Hi all,

Any update?
Comment 16 Stefan Ring 2017-09-11 17:22:36 EDT
The fix for libbytesize has just been pushed to master a few days ago: https://github.com/storaged-project/libbytesize/commit/084c04c7be762049f375b424e44b1951b0113404
Comment 17 Fedora Update System 2017-09-14 06:16:46 EDT
libbytesize-1.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-1c03aa9422
Comment 18 Fedora Update System 2017-09-14 14:22:44 EDT
libbytesize-1.0-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-1c03aa9422
Comment 19 Jeff Backus 2017-09-17 11:17:58 EDT
Awesome! Thanks for addressing this!
Comment 20 Fedora Update System 2017-09-30 02:29:26 EDT
libbytesize-1.0-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.