Skip to content
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

du applet prints wrong size #51

Closed
d4rken opened this issue Sep 29, 2016 · 5 comments
Closed

du applet prints wrong size #51

d4rken opened this issue Sep 29, 2016 · 5 comments

Comments

@d4rken
Copy link

d4rken commented Sep 29, 2016

Nexus5 with Android 6.0.

shell@hammerhead:/sdcard $ busybox du -sh DCIM
3.6G    DCIM
shell@hammerhead:/sdcard $ busybox du -sk DCIM
3822620 DCIM
shell@hammerhead:/sdcard $ toolbox du -sk DCIM
3822620 DCIM
shell@hammerhead:/sdcard $ toybox du -sk DCIM
18446744073709179932    DCIM
shell@hammerhead:/sdcard $ toybox du -sh DCIM
-.3 GB  DCIM
@d4rken
Copy link
Author

d4rken commented Sep 29, 2016

Doesn't happen with smaller items.

shell@hammerhead:/sdcard $ busybox du -sk Download
51360   Download
shell@hammerhead:/sdcard $ toolbox du -sk Download
51360   Download
shell@hammerhead:/sdcard $ toybox du -sk Download
51360   Download
shell@hammerhead:/sdcard $ toybox du -sh Download
52 MB   Download

@d4rken
Copy link
Author

d4rken commented Sep 29, 2016

The magic size is around ~2GB.
It doesn't matter if it's multiple files or a single one.
Could reproduce it by just dd'ing a 2GB file.

1963160 2GBTestFile                                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
1993896 2GBTestFile                                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
2013236 2GBTestFile                                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
2033440 2GBTestFile                                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
2058720 2GBTestFile                                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
2087516 2GBTestFile                                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
18446744073707467048    2GBTestFile                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
18446744073707513764    2GBTestFile                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
18446744073707558644    2GBTestFile                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
18446744073707603732    2GBTestFile                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
18446744073707654844    2GBTestFile                
shell@hammerhead:/sdcard $ toybox du -s 2GBTestFile
18446744073707700480    2GBTestFile                

@d4rken
Copy link
Author

d4rken commented Sep 29, 2016

The toybox from https://landley.net/toybox/bin/
Prints different human-readable output, but also has this issue.

root@hammerhead:/cache # ./toybox-armv6l du -s /sdcard/2GBTestFile
18446744073707954404    /sdcard/2GBTestFile
root@hammerhead:/cache # ./toybox-armv6l du -hs /sdcard/2GBTestFile
16E     /sdcard/2GBTestFile
shell@hammerhead:/sdcard $ toybox du -hs 2GBTestFile
-1 GB   2GBTestFile

@d4rken
Copy link
Author

d4rken commented Sep 29, 2016

Not Android specific.

buildvm@buildvm-VirtualBox:~$ dd if=/dev/zero of=2GBTestFile bs=1024 count=2GB
^C2529386+0 records in
2529386+0 records out
2590091264 bytes (2,6 GB) copied, 26,8641 s, 96,4 MB/s
buildvm@buildvm-VirtualBox:~$ ./toybox_darken/toybox_x86 du -s 2GBTestFile 
18446744073707886704    2GBTestFile
buildvm@buildvm-VirtualBox:~$ ./toybox_darken/toybox_x86 du -hs 2GBTestFile 
16E 2GBTestFile
buildvm@buildvm-VirtualBox:~$ uname -a
Linux buildvm-VirtualBox 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@enh
Copy link
Contributor

enh commented Nov 19, 2016

close? fixed by 8d0f0b6

@d4rken d4rken closed this as completed Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants