Bug 9516 - numeric sort fails for large integers
Summary: numeric sort fails for large integers
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-27 09:09 UTC by josch
Modified: 2017-01-30 18:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.