Bug 9516

Summary: numeric sort fails for large integers
Product: Busybox Reporter: josch
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description josch 2016-12-27 09:09:31 UTC
Hi, I'm running BusyBox v1.25.1 (2016-12-19 05:23:39 CET).

I can reproduce the problem like this:

$ { echo 4294967296; echo 4294967295; echo 4294967297; echo 2147483648; echo 6; } | sort -n
4294967295
4294967296
4294967297
6
2147483648

Clearly, the first three values should come at the end as they are the largest.
Comment 1 Denys Vlasenko 2017-01-03 13:38:54 UTC
Do you have CONFIG_DESKTOP=y?

If not, select that.
Without that selection, a simplistic (and much smaller) code is used for sort -n.
If it still fails even with CONFIG_DESKTOP=y, let me know.