Re: possible bug in 'sum' command, with a demo

2016-09-22 Thread Kang-Che Sung
> I can't reproduce the same result in the latest BusyBox version from git.
> Perhaps this has been fixed already?

Oops. My mistake. Used the wrong input. Here's the corrected one:

$ printf '145146\n\n'| ./busybox cksum
1560277601 8
$ printf '145146\n\n'| cksum
1560277601 8
$ printf '145146\n\n'| ./busybox sum
59944 1
$ printf '145146\n\n'| sum
59944 1
$ printf '107108\n\n'| sum
59944 1
$ printf '107108\n\n'| ./busybox sum
59944 1
$ printf '107108\n\n'| cksum
2984653705 8
$ printf '107108\n\n'| ./busybox cksum
2984653705 8
$ ./busybox | head -n 1
BusyBox v1.26.0.git (2016-09-23 07:33:08 CST) multi-call binary.
$ sum --version | head -n 1
sum (GNU coreutils) 8.21
$ cksum --version | head -n 1
cksum (coreutils) 8.21
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: possible bug in 'sum' command, with a demo

2016-09-22 Thread Kang-Che Sung
On Thu, Sep 22, 2016 at 11:57 PM, Anne Salemme  wrote:
>
>   I am using BusyBox version v1.22.1 inside MobaXterm, and came across what 
> looks like a bug in the ‘sum’ command…maybe not a bug, but definitely not 
> expected…here is a little demo for you…thanks, I love BusyBox!
>
> Demo shows that given two files with different contents, ‘sum’ gives them an 
> identical checksum, but ‘cksum’ gives them different checksums (as expected).

> [asalemme.asalemme-win7] ➤ ls -l
> total 1
> -rw-r--r--1 asalemme UsersGrp 8 Sep 22 10:27 demo-107108
> -rw-r--r--1 asalemme UsersGrp 8 Sep 22 10:27 demo-145146
>
> [asalemme.asalemme-win7] ➤ sum *
> 59944 1 demo-107108
> 59944 1 demo-145146
>
> [asalemme.asalemme-win7] ➤ cksum *
> 2984653705 8 demo-107108
> 1560277601 8 demo-145146
>
> [asalemme.asalemme-win7] ➤ od -c demo-107108
> 000   1   0   7   1   0   8  \n  \n
> 010
>
> [asalemme.asalemme-win7] ➤ od -c demo-145146
> 000   1   4   5   1   4   6  \n  \n
> 010

I can't reproduce the same result in the latest BusyBox version from git.
Perhaps this has been fixed already?

Here is what I get:

$ printf '\1\0\7\1\0\10\n\n' | cksum
111069432 8
$ printf '\1\0\7\1\0\10\n\n' | sum
18961 1
$ printf '\1\0\7\1\0\10\n\n' | ./busybox cksum
111069432 8
$ printf '\1\0\7\1\0\10\n\n' | ./busybox sum
18961 1
$ printf '\1\4\5\1\4\6\n\n' | ./busybox sum
18961 1
$ printf '\1\4\5\1\4\6\n\n' | sum
18961 1
$ printf '\1\4\5\1\4\6\n\n' | ./busybox cksum
3951495440 8
$ printf '\1\4\5\1\4\6\n\n' | cksum
3951495440 8
$ ./busybox | head -n 1
BusyBox v1.26.0.git (2016-09-23 07:33:08 CST) multi-call binary.
$ sum --version | head -n 1
sum (GNU coreutils) 8.21
$ cksum --version | head -n 1
cksum (coreutils) 8.21
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Re: possible bug in 'sum' command, with a demo

2016-09-22 Thread Guillermo Rodriguez Garcia
The values returned by sum seem to be correct for the default SysV
algorithm. The coreutils version of sum yields the same values.

Guillermo

2016-09-22 17:57 GMT+02:00 Anne Salemme :

> Hello,
>
>   I am using BusyBox version v1.22.1 inside MobaXterm, and came across
> what looks like a bug in the ‘sum’ command…maybe not a bug, but definitely
> not expected…here is a little demo for you…thanks, I love BusyBox!
>
>
>
> Demo shows that given two files with different contents, ‘sum’ gives them
> an identical checksum, but ‘cksum’ gives them different checksums (as
> expected).
>
>
>
> [2016-09-22 11:38.59]  ~/foo
>
> [asalemme.asalemme-win7] ➤ ls -l
>
> total 1
>
> -rw-r--r--1 asalemme UsersGrp 8 Sep 22 10:27 demo-107108
>
> -rw-r--r--1 asalemme UsersGrp 8 Sep 22 10:27 demo-145146
>
>
>  ✔
>
> 
> 
> ───
>
> [2016-09-22 11:39.07]  ~/foo
>
> [asalemme.asalemme-win7] ➤ sum *
>
> 59944 1 demo-107108
>
> 59944 1 demo-145146
>
>
>
> ✔
>
> 
> 
> ───
>
> [2016-09-22 11:39.14]  ~/foo
>
> [asalemme.asalemme-win7] ➤ cksum *
>
> 2984653705 8 demo-107108
>
> 1560277601 8 demo-145146
>
>
>  ✔
>
> 
> 
> ───
>
> [2016-09-22 11:39.20]  ~/foo
>
> [asalemme.asalemme-win7] ➤ od -c demo-107108
>
> 000   1   0   7   1   0   8  \n  \n
>
> 010
>
>
>
> ✔
>
> 
> 
> ───
>
> [2016-09-22 11:39.39]  ~/foo
>
> [asalemme.asalemme-win7] ➤ od -c demo-145146
>
> 000   1   4   5   1   4   6  \n  \n
>
> 010
>
>
>
>  ✔
>
> 
> 
> ───
>
> [2016-09-22 11:40.01]  ~/foo
>
> [asalemme.asalemme-win7] ➤
>
>
>
>
>
> Thanks again for a great product, and best regards.
>
>
>
> Anne Salemme
>
>
>
> [image: Signature-Logo_black]
>
> Anne Salemme| Linux Deployment Engineer
>
> CrunchTime! Information Systems, Inc.
>
> 129 Portland Street, Boston, MA 02114
>
> *asale...@crunchtime.com *
>
> Web
> 
> – Twitter
> 
> – Video
> 
> – LinkedIn
> 
>
>
>
>
>
>
>
>
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>



-- 
Guillermo Rodriguez Garcia
guille.rodrig...@gmail.com
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

possible bug in 'sum' command, with a demo

2016-09-22 Thread Anne Salemme
Hello,
  I am using BusyBox version v1.22.1 inside MobaXterm, and came across what 
looks like a bug in the ‘sum’ command…maybe not a bug, but definitely not 
expected…here is a little demo for you…thanks, I love BusyBox!

Demo shows that given two files with different contents, ‘sum’ gives them an 
identical checksum, but ‘cksum’ gives them different checksums (as expected).

[2016-09-22 11:38.59]  ~/foo
[asalemme.asalemme-win7] ➤ ls -l
total 1
-rw-r--r--1 asalemme UsersGrp 8 Sep 22 10:27 demo-107108
-rw-r--r--1 asalemme UsersGrp 8 Sep 22 10:27 demo-145146

  ✔
───
[2016-09-22 11:39.07]  ~/foo
[asalemme.asalemme-win7] ➤ sum *
59944 1 demo-107108
59944 1 demo-145146

  ✔
───
[2016-09-22 11:39.14]  ~/foo
[asalemme.asalemme-win7] ➤ cksum *
2984653705 8 demo-107108
1560277601 8 demo-145146

  ✔
───
[2016-09-22 11:39.20]  ~/foo
[asalemme.asalemme-win7] ➤ od -c demo-107108
000   1   0   7   1   0   8  \n  \n
010

  ✔
───
[2016-09-22 11:39.39]  ~/foo
[asalemme.asalemme-win7] ➤ od -c demo-145146
000   1   4   5   1   4   6  \n  \n
010

  ✔
───
[2016-09-22 11:40.01]  ~/foo
[asalemme.asalemme-win7] ➤


Thanks again for a great product, and best regards.

Anne Salemme

[Signature-Logo_black]
Anne Salemme| Linux Deployment Engineer
CrunchTime! Information Systems, Inc.
129 Portland Street, Boston, MA 02114
asale...@crunchtime.com
Web
 – 
Twitter
 – 
Video
 – 
LinkedIn




___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox