-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android 64-bit compatibility adaptions #5821
Conversation
38e1f56
to
7afdd05
Compare
Your PR compiles on my Android 64bit system. The result of the test is:
but the failures look unrelated to your change. |
7afdd05
to
6da26c7
Compare
@samueltardieu Thanks for providing your results. I'm still on the way to setup a virtual android device. |
You can also use your phone and drive it with scrcpy which is an absolute delight to work from the computer on a real device. That's what I did. |
@samueltardieu
Can you point out to a description that was working for you? |
For this test, I compiled coreutils on my phone.
I think I installed it along with build tools with
It looks like you don't have a C compiler, it should come with |
it runs now somehow. I still have the error, but it seems to be sporadically and randomly. When I re-run the build it gets further than before. If I repeat it 3-4 times, then whole compilation is done. EDIT: It seems that the issue is that there is not enough RAM. I got this error message once:
But I get 36 failing tests. Can you confirm that?
|
Compiling your PR branch, I get 7 failures:
but I suspect they depend on the particular Android version for 4 of them at least. |
I'm failing to get a remote debugging running. Have you ever tried this? Do you have recommendations? |
I haven't attempted it. Why not a local debugging with gdb? Isn't that working? |
GNU testsuite comparison:
|
@samueltardieu: I pushed some more changes to make all the tests green for me. Can you confirm? |
All green for me too, congrats!
Note that there are too many commits (including merge commits), you should maybe squash them, then maybe split them so that you get a clean history.
Agreed! |
f26b77b
to
ad88cf3
Compare
I did a cleanup of the commits. Hope its fine now. :-) |
It is much more readable indeed! (well, but for the latest commit title which is too long for git…) |
let inodes = self.inodes + rhs.inodes; | ||
let inodes_used = self.inodes_used + rhs.inodes_used; | ||
let inodes = self.inodes.saturating_add(rhs.inodes); | ||
let inodes_used = self.inodes_used.saturating_add(rhs.inodes_used); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really have sometimes a number of inodes greater than u64::MAX
?
If this is the case, is it ok to compute a wrong value by saturating the addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this peace of code does an accumulation. As far as I understood the code, this accumulation is purely needed to compute an optional finalising row called "total" in the output. This "total" row shall display the sum of each column. Thus, also the inodes are accumulated.
On my phones system, there are apparently several filesystems that reports "inodes" as exactly u64::MAX
. Summing that up always causes an int 64 overflow. But is it relevant? I guess not really as the number is anyway insanely high. If someone finds a usecase where this is relevant, we can still extend the integer type to u128
.
Alternatively. one could automatically filter the filesystem with u64::MAX
because the number might anyway not be valid.
EDIT: One addition could be that we don't print the value in the total row when it is at u64::MAX because the sum is invalid. That might be the easiest and also correct behavior as long as we don't extent to u128.
EDIT2: The feature to compute the "total" row is apparently not available in the df implementation on my phone (toybox 0.8.4-android
)
Output of pre-installed (toybox, NOT GNU) of df on my phone:
~/rust/coreutils $ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/block/dm-15 18446744073709551615 3141 18446744073709548474 1% /
tmpfs 1457181 1464 1455717 1% /dev
tmpfs 1457181 65 1457116 1% /mnt
/dev/block/dm-16 18446744073709551615 3002 18446744073709548613 1% /system_ext
/dev/block/dm-17 304 298 6 99% /product
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/app
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/priv-app
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/lib64
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/lib
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/overlay
overlay 18446744073709551615 0 18446744073709551615 0% /product/etc/permissions
overlay 18446744073709551615 0 18446744073709551615 0% /product/framework
/dev/block/dm-18 18446744073709551615 0 18446744073709551615 0% /vendor
/dev/block/dm-19 18446744073709551615 0 18446744073709551615 0% /odm
/dev/block/dm-20 18446744073709551615 0 18446744073709551615 0% /my_product
/dev/block/dm-21 18446744073709551615 0 18446744073709551615 0% /my_engineering
/dev/block/dm-23 18446744073709551615 0 18446744073709551615 0% /my_carrier
/dev/block/dm-24 18446744073709551615 0 18446744073709551615 0% /my_region
/dev/block/dm-25 18446744073709551615 0 18446744073709551615 0% /my_heytap
/dev/block/dm-26 18446744073709551615 0 18446744073709551615 0% /my_stock
/dev/block/dm-27 18446744073709551615 0 18446744073709551615 0% /my_preload
/dev/block/dm-28 18446744073709551615 0 18446744073709551615 0% /my_bigball
/dev/block/dm-29 18446744073709551615 0 18446744073709551615 0% /my_manifest
tmpfs 1457181 99 1457082 1% /apex
/dev/block/loop7 48 35 13 73% /apex/com.android.i18n@1
/dev/block/loop8 32 29 3 91% /apex/com.android.wifi@319999900
/dev/block/loop5 32 20 12 63% /apex/com.android.apex.cts.shim@1
/dev/block/loop6 32 23 9 72% /apex/com.android.appsearch@300000000
/dev/block/loop11 304 290 14 96% /apex/com.android.vndk.v31@1
/dev/block/dm-30 32 25 7 79% /apex/com.android.extservices@341131030
/dev/block/dm-32 32 28 4 88% /apex/com.android.permission@341110010
/dev/block/loop15 64 50 14 79% /apex/com.android.runtime@1
/dev/block/dm-33 176 167 9 95% /apex/com.android.conscrypt@341110002
/dev/block/dm-31 112 112 0 100% /apex/com.android.art@341110062
/dev/block/loop16 608 596 12 99% /apex/com.android.vndk.v30@1
/dev/block/dm-34 32 20 12 63% /apex/com.android.tzdata@313110000
/dev/block/dm-35 32 20 12 63% /apex/com.android.scheduling@340819220
/dev/block/dm-36 32 31 1 97% /apex/com.android.os.statsd@341114000
/dev/block/dm-37 64 58 6 91% /apex/com.android.media@341111002
/dev/block/dm-38 32 27 5 85% /apex/com.android.mediaprovider@341111020
/dev/block/dm-39 48 36 12 75% /apex/com.android.adbd@340912202
/dev/block/dm-40 128 114 14 90% /apex/com.android.media.swcodec@341111002
/dev/block/dm-42 32 21 11 66% /apex/com.android.cellbroadcast@341110000
/dev/block/dm-41 16 16 0 100% /apex/com.android.neuralnetworks@341010000
/dev/block/loop27 32 26 6 82% /apex/com.google.mainline.primary.libs@331059000
/dev/block/dm-43 32 20 12 63% /apex/com.android.ipsec@340914200
/dev/block/dm-44 80 66 14 83% /apex/com.android.tethering@341112070
/dev/block/dm-45 80 75 5 94% /apex/com.google.mainline.primary.libs@341177000
/dev/block/dm-46 16 16 0 100% /apex/com.android.resolv@341110000
/dev/block/dm-47 32 24 8 75% /apex/com.android.sdkext@341110000
/dev/block/bootdevice/by-name/cache 114688 55 114633 1% /cache
/dev/block/bootdevice/by-name/userdata 12812797 348578 12464219 3% /data
/dev/fuse 12812797 348578 12464219 3% /storage/emulated
/data/media 12812797 348578 12464219 3% /storage/emulated/0/Android/data
~/rust/coreutils $
for completion the output of uutils:
~/rust/coreutils $ target/debug/coreutils df -i --total
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/block/dm-15 18446744073709551615 3141 18446744073709548474 1% /
tmpfs 1457181 1464 1455717 1% /dev
tmpfs 1457181 65 1457116 1% /mnt
/dev/block/by-name/metadata 4096 31 4065 1% /metadata
/dev/block/dm-16 18446744073709551615 3002 18446744073709548613 1% /system_ext
/dev/block/dm-17 304 298 6 99% /product
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/app
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/priv-app
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/lib64
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/lib
overlay-overlay 18446744073709551615 0 18446744073709551615 0% /product/overlay
overlay 18446744073709551615 0 18446744073709551615 0% /product/etc/permissions
overlay 18446744073709551615 0 18446744073709551615 0% /product/framework
/dev/block/dm-18 18446744073709551615 0 18446744073709551615 0% /vendor
/dev/block/dm-19 18446744073709551615 0 18446744073709551615 0% /odm
/dev/block/dm-20 18446744073709551615 0 18446744073709551615 0% /my_product
/dev/block/dm-21 18446744073709551615 0 18446744073709551615 0% /my_engineering
/dev/block/dm-23 18446744073709551615 0 18446744073709551615 0% /my_carrier
/dev/block/dm-24 18446744073709551615 0 18446744073709551615 0% /my_region
/dev/block/dm-25 18446744073709551615 0 18446744073709551615 0% /my_heytap
/dev/block/dm-26 18446744073709551615 0 18446744073709551615 0% /my_stock
/dev/block/dm-27 18446744073709551615 0 18446744073709551615 0% /my_preload
/dev/block/dm-28 18446744073709551615 0 18446744073709551615 0% /my_bigball
/dev/block/dm-29 18446744073709551615 0 18446744073709551615 0% /my_manifest
tmpfs 1457181 99 1457082 1% /apex
/dev/block/loop7 48 35 13 73% /apex/com.android.i18n@1
/dev/block/loop7 48 35 13 73% /apex/com.android.i18n
/dev/block/loop8 32 29 3 91% /apex/com.android.wifi@319999900
/dev/block/loop5 32 20 12 63% /apex/com.android.apex.cts.shim@1
/dev/block/loop8 32 29 3 91% /apex/com.android.wifi
/dev/block/loop6 32 23 9 72% /apex/com.android.appsearch@300000000
/dev/block/loop6 32 23 9 72% /apex/com.android.appsearch
/dev/block/loop5 32 20 12 63% /apex/com.android.apex.cts.shim
/dev/block/loop11 304 290 14 96% /apex/com.android.vndk.v31@1
/dev/block/loop11 304 290 14 96% /apex/com.android.vndk.v31
/dev/block/dm-30 32 25 7 79% /apex/com.android.extservices@341131030
/dev/block/dm-30 32 25 7 79% /apex/com.android.extservices
/dev/block/dm-32 32 28 4 88% /apex/com.android.permission@341110010
/dev/block/dm-32 32 28 4 88% /apex/com.android.permission
/dev/block/loop15 64 50 14 79% /apex/com.android.runtime@1
/dev/block/loop15 64 50 14 79% /apex/com.android.runtime
/dev/block/dm-33 176 167 9 95% /apex/com.android.conscrypt@341110002
/dev/block/dm-31 112 112 0 100% /apex/com.android.art@341110062
/dev/block/dm-33 176 167 9 95% /apex/com.android.conscrypt
/dev/block/dm-31 112 112 0 100% /apex/com.android.art
/dev/block/loop16 608 596 12 99% /apex/com.android.vndk.v30@1
/dev/block/loop16 608 596 12 99% /apex/com.android.vndk.v30
/dev/block/dm-34 32 20 12 63% /apex/com.android.tzdata@313110000
/dev/block/dm-34 32 20 12 63% /apex/com.android.tzdata
/dev/block/dm-35 32 20 12 63% /apex/com.android.scheduling@340819220
/dev/block/dm-35 32 20 12 63% /apex/com.android.scheduling
/dev/block/dm-36 32 31 1 97% /apex/com.android.os.statsd@341114000
/dev/block/dm-36 32 31 1 97% /apex/com.android.os.statsd
/dev/block/dm-37 64 58 6 91% /apex/com.android.media@341111002
/dev/block/dm-37 64 58 6 91% /apex/com.android.media
/dev/block/dm-38 32 27 5 85% /apex/com.android.mediaprovider@341111020
/dev/block/dm-38 32 27 5 85% /apex/com.android.mediaprovider
/dev/block/dm-39 48 36 12 75% /apex/com.android.adbd@340912202
/dev/block/dm-39 48 36 12 75% /apex/com.android.adbd
/dev/block/dm-40 128 114 14 90% /apex/com.android.media.swcodec@341111002
/dev/block/dm-40 128 114 14 90% /apex/com.android.media.swcodec
/dev/block/dm-42 32 21 11 66% /apex/com.android.cellbroadcast@341110000
/dev/block/dm-41 16 16 0 100% /apex/com.android.neuralnetworks@341010000
/dev/block/dm-41 16 16 0 100% /apex/com.android.neuralnetworks
/dev/block/dm-42 32 21 11 66% /apex/com.android.cellbroadcast
/dev/block/loop27 32 26 6 82% /apex/com.google.mainline.primary.libs@331059000
/dev/block/dm-43 32 20 12 63% /apex/com.android.ipsec@340914200
/dev/block/dm-43 32 20 12 63% /apex/com.android.ipsec
/dev/block/dm-44 80 66 14 83% /apex/com.android.tethering@341112070
/dev/block/dm-44 80 66 14 83% /apex/com.android.tethering
/dev/block/dm-45 80 75 5 94% /apex/com.google.mainline.primary.libs@341177000
/dev/block/dm-46 16 16 0 100% /apex/com.android.resolv@341110000
/dev/block/dm-46 16 16 0 100% /apex/com.android.resolv
/dev/block/dm-47 32 24 8 75% /apex/com.android.sdkext@341110000
/dev/block/dm-47 32 24 8 75% /apex/com.android.sdkext
/dev/block/bootdevice/by-name/cache 114688 55 114633 1% /cache
/dev/block/bootdevice/by-name/userdata 12812797 348591 12464206 3% /data
/dev/fuse 12812797 348591 12464206 3% /storage/emulated
/data/media 12812797 348591 12464206 3% /storage/emulated/0/Android/data
/data/media 12812797 348591 12464206 3% /storage/emulated/0/Android/obb
total 18446744073709551615 1406308 18446744073709551615 1% -
~/rust/coreutils $
filesystem types:
~/rust/coreutils $ target/debug/coreutils df --output=source,fstype,target,itotal,iused,iavail,ipcent
Filesystem Type Mounted on Inodes IUsed IFree IUse%
/dev/block/dm-15 erofs / 18446744073709551615 3141 18446744073709548474 1%
tmpfs tmpfs /dev 1457181 1464 1455717 1%
tmpfs tmpfs /mnt 1457181 65 1457116 1%
/dev/block/by-name/metadata ext4 /metadata 4096 31 4065 1%
/dev/block/dm-16 erofs /system_ext 18446744073709551615 3002 18446744073709548613 1%
/dev/block/dm-17 ext4 /product 304 298 6 99%
overlay-overlay overlay /product/app 18446744073709551615 0 18446744073709551615 0%
overlay-overlay overlay /product/priv-app 18446744073709551615 0 18446744073709551615 0%
overlay-overlay overlay /product/lib64 18446744073709551615 0 18446744073709551615 0%
overlay-overlay overlay /product/lib 18446744073709551615 0 18446744073709551615 0%
overlay-overlay overlay /product/overlay 18446744073709551615 0 18446744073709551615 0%
overlay overlay /product/etc/permissions 18446744073709551615 0 18446744073709551615 0%
overlay overlay /product/framework 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-18 erofs /vendor 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-19 erofs /odm 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-20 erofs /my_product 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-21 erofs /my_engineering 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-23 erofs /my_carrier 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-24 erofs /my_region 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-25 erofs /my_heytap 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-26 erofs /my_stock 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-27 erofs /my_preload 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-28 erofs /my_bigball 18446744073709551615 0 18446744073709551615 0%
/dev/block/dm-29 erofs /my_manifest 18446744073709551615 0 18446744073709551615 0%
tmpfs tmpfs /apex 1457181 99 1457082 1%
/dev/block/loop7 ext4 /apex/com.android.i18n@1 48 35 13 73%
/dev/block/loop7 ext4 /apex/com.android.i18n 48 35 13 73%
/dev/block/loop8 ext4 /apex/com.android.wifi@319999900 32 29 3 91%
/dev/block/loop5 ext4 /apex/com.android.apex.cts.shim@1 32 20 12 63%
/dev/block/loop8 ext4 /apex/com.android.wifi 32 29 3 91%
/dev/block/loop6 ext4 /apex/com.android.appsearch@300000000 32 23 9 72%
/dev/block/loop6 ext4 /apex/com.android.appsearch 32 23 9 72%
/dev/block/loop5 ext4 /apex/com.android.apex.cts.shim 32 20 12 63%
/dev/block/loop11 ext4 /apex/com.android.vndk.v31@1 304 290 14 96%
/dev/block/loop11 ext4 /apex/com.android.vndk.v31 304 290 14 96%
/dev/block/dm-30 ext4 /apex/com.android.extservices@341131030 32 25 7 79%
/dev/block/dm-30 ext4 /apex/com.android.extservices 32 25 7 79%
/dev/block/dm-32 ext4 /apex/com.android.permission@341110010 32 28 4 88%
/dev/block/dm-32 ext4 /apex/com.android.permission 32 28 4 88%
/dev/block/loop15 ext4 /apex/com.android.runtime@1 64 50 14 79%
/dev/block/loop15 ext4 /apex/com.android.runtime 64 50 14 79%
/dev/block/dm-33 ext4 /apex/com.android.conscrypt@341110002 176 167 9 95%
/dev/block/dm-31 ext4 /apex/com.android.art@341110062 112 112 0 100%
/dev/block/dm-33 ext4 /apex/com.android.conscrypt 176 167 9 95%
/dev/block/dm-31 ext4 /apex/com.android.art 112 112 0 100%
/dev/block/loop16 ext4 /apex/com.android.vndk.v30@1 608 596 12 99%
/dev/block/loop16 ext4 /apex/com.android.vndk.v30 608 596 12 99%
/dev/block/dm-34 ext4 /apex/com.android.tzdata@313110000 32 20 12 63%
/dev/block/dm-34 ext4 /apex/com.android.tzdata 32 20 12 63%
/dev/block/dm-35 ext4 /apex/com.android.scheduling@340819220 32 20 12 63%
/dev/block/dm-35 ext4 /apex/com.android.scheduling 32 20 12 63%
/dev/block/dm-36 ext4 /apex/com.android.os.statsd@341114000 32 31 1 97%
/dev/block/dm-36 ext4 /apex/com.android.os.statsd 32 31 1 97%
/dev/block/dm-37 ext4 /apex/com.android.media@341111002 64 58 6 91%
/dev/block/dm-37 ext4 /apex/com.android.media 64 58 6 91%
/dev/block/dm-38 ext4 /apex/com.android.mediaprovider@341111020 32 27 5 85%
/dev/block/dm-38 ext4 /apex/com.android.mediaprovider 32 27 5 85%
/dev/block/dm-39 ext4 /apex/com.android.adbd@340912202 48 36 12 75%
/dev/block/dm-39 ext4 /apex/com.android.adbd 48 36 12 75%
/dev/block/dm-40 ext4 /apex/com.android.media.swcodec@341111002 128 114 14 90%
/dev/block/dm-40 ext4 /apex/com.android.media.swcodec 128 114 14 90%
/dev/block/dm-42 ext4 /apex/com.android.cellbroadcast@341110000 32 21 11 66%
/dev/block/dm-41 ext4 /apex/com.android.neuralnetworks@341010000 16 16 0 100%
/dev/block/dm-41 ext4 /apex/com.android.neuralnetworks 16 16 0 100%
/dev/block/dm-42 ext4 /apex/com.android.cellbroadcast 32 21 11 66%
/dev/block/loop27 ext4 /apex/com.google.mainline.primary.libs@331059000 32 26 6 82%
/dev/block/dm-43 ext4 /apex/com.android.ipsec@340914200 32 20 12 63%
/dev/block/dm-43 ext4 /apex/com.android.ipsec 32 20 12 63%
/dev/block/dm-44 ext4 /apex/com.android.tethering@341112070 80 66 14 83%
/dev/block/dm-44 ext4 /apex/com.android.tethering 80 66 14 83%
/dev/block/dm-45 ext4 /apex/com.google.mainline.primary.libs@341177000 80 75 5 94%
/dev/block/dm-46 ext4 /apex/com.android.resolv@341110000 16 16 0 100%
/dev/block/dm-46 ext4 /apex/com.android.resolv 16 16 0 100%
/dev/block/dm-47 ext4 /apex/com.android.sdkext@341110000 32 24 8 75%
/dev/block/dm-47 ext4 /apex/com.android.sdkext 32 24 8 75%
/dev/block/bootdevice/by-name/cache ext4 /cache 114688 55 114633 1%
/dev/block/bootdevice/by-name/userdata f2fs /data 12812797 348595 12464202 3%
/dev/fuse fuse /storage/emulated 12812797 348595 12464202 3%
/data/media sdcardfs /storage/emulated/0/Android/data 12812797 348595 12464202 3%
/data/media sdcardfs /storage/emulated/0/Android/obb 12812797 348595 12464202 3%
~/rust/coreutils $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awfully similar to a -1 cast to uint64_t
…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you retry with --total
as well? That would be interesting to see how GNU coreutils perform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some editing to give more detail. So please read again. The df-variant that runs on my phone is "toybox" and not GNU. It doesn't support the "--total" argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a small image for erofs on my ubuntu PC. Then you can see the GNU output:
uli@hp13-ulix:~$ df --total --output='source','fstype','itotal','iused','iavail','ipcent','size','used','avail','pcent','file','target'
Filesystem Type Inodes IUsed IFree IUse% 1K-blocks Used Avail Use% File Mounted on
tmpfs tmpfs 2016003 1405 2014598 1% 1612804 2280 1610524 1% - /run
/dev/nvme0n1p6 ext4 6111232 621990 5489242 11% 95535524 33714300 56922052 38% - /
tmpfs tmpfs 2016003 71 2015932 1% 8064012 19696 8044316 1% - /dev/shm
tmpfs tmpfs 2016003 4 2015999 1% 5120 4 5116 1% - /run/lock
efivarfs efivarfs 0 0 0 - 192 127 61 68% - /sys/firmware/efi/efivars
/dev/nvme0n1p7 ext4 9895936 740739 9155197 8% 154706320 122316404 24458476 84% - /home
/dev/nvme0n1p1 vfat 0 0 0 - 262144 89720 172424 35% - /boot/efi
tmpfs tmpfs 403200 202 402998 1% 1612800 168 1612632 1% - /run/user/1000
/dev/nvme0n1p5 ntfs3 0 0 0 - 512032764 370522632 141510132 73% - /media/uli/WData
/dev/loop27 erofs - - 18446744073709551613 - 4 4 0 100% - /media/uli/486ad2a2-6303-4504-87ff-5176e55b2239
total - 22458377 1364414 21093963 7% 773831684 526665335 234335733 70% - -
uli@hp13-ulix:~$
its placing some dashes "-" and EDIT: its having a silent integer-overlfow for the IFree. I checked it, the real sum without "erofs" would be "21093966" and not "21093963" ... thats 3 off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the way, the inodes for erofs are not really relevant in general as it is a read only filesystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My test on Ubuntu prooves that the issue with the integeroverflow is actually also visible on non-android systems if they use erofs. So we could actually split this change into an own pull-request.
li@hp13-ulix:~$ dev_rust/coreutils/target/debug/coreutils df --total --output='source','fstype','itotal','iused','iavail','ipcent','size','used','avail','pcent','file','target'
thread 'main' panicked at src/uu/df/src/table.rs:105:22:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
uli@hp13-ulix:~$
src/uucore/src/lib/features/fsext.rs
Outdated
@@ -656,28 +656,29 @@ impl FsMeta for StatFs { | |||
not(target_arch = "s390x"), | |||
target_pointer_width = "64" | |||
))] | |||
return self.f_bsize; | |||
return self.f_bsize; // i64 -> i64 - OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure those comments are needed, the Rust compiler is here to tell us if this is ok or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it there to help the reviewer/developer that reads this code to understand what happens. There are a lot of #[cfg(..)] around there and its not directly visible what the main point in the three cases is. But I'll remove it if you insist on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just expressing a preference, I'll let the coreutils maintainers weight on this.
ad88cf3
to
7eb164e
Compare
0958c24
to
1b37a8c
Compare
android x64 build is green on main branch - thus I think the remaining fixes in this branch where purely for my device and its not needed in general. I guess we can close it. @samueltardieu : do you think there is something in this PR we still need? |
On my device, two tests fail on main:
while with your PR merged they pass. So I think there is something useful left in this PR. |
1b37a8c
to
748e5b5
Compare
ok, thank you for this positive feedback. |
GNU testsuite comparison:
|
- unclear if its file system rather then operating system
…stems - negative testing fails when selecting by chance the filesystem of "/"
748e5b5
to
c86084f
Compare
after a closer look into the issue with |
also the issue with |
addresses issue #5421
EDIT: I tested it on my own phone. I compiled and run the tests on my phone. The tests are green now.