pt-stalk disk space checks wrong on 32bit platforms

Bug #940503 reported by Daniel Nichter
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to
Fix Released
Daniel Nichter

Bug Description

On 64-bit platforms, awk '{printf("%d", 94409664*1024)}' yields 96,675,495,936. On 32-bit platforms it yields 2,147,483,647; i.e. the 32bit signed limit. Therefore, lines like

local free_bytes=$(cat "$file" | awk '/^\//{printf("%d",$4 * 1024)}');

in return the wrong value because hard drives these days tend to have much more than 2^31 bytes of storage.

Solution: use Perl.

Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
tags: added: pt-stalk
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

This was fixed in lib/bash/ and merged into 2.0 branch in

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers