Comment 2 for bug 1159933

Revision history for this message
Dave Spiegel (dave-spiegel) wrote :

I just ran into similar issue where using mawk (awk alternative) to format cksum values. Any value larger than 2G is truncated at 2G (2147483647). This is the same number Thomas is getting. Seems like mawk was built using older memory limitations?

Here is example (awk -> mawk:
$ cksum pin.sql.gz
3795651822 1865248 pin.sql.gz

$ cksum pin.sql.gz| awk '{printf ("%d", $1)}'
2147483647

Install gawk, and problem is gone (awk -> gawk).
$ cksum pin.sql.gz
3795651822 1865248 pin.sql.gz

$ cksum pin.sql.gz| awk '{printf ("%d", $1)}'
3795651822

Cunfirmed issue on two different Ubuntu server installs:
SERVER 1:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"
mawk version 1.3.3-15ubuntu2
Linux 2.6.32-46-server #108-Ubuntu SMP Thu Apr 11 16:11:15 UTC 2013 x86_64 GNU/Linux

SERVER 2:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
mawk version 1.3.3-17
Linux 3.2.0-41-generic #66-Ubuntu SMP Thu Apr 25 03:27:11 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Did "apt-get install gawk" for both servers which replaced mawk alternative with gawk. Now our scripts work properly.

If this is bug, then it seems important to correct it. Perhaps mawk should not be default install on Ubuntu if it has bugs.