seq command has problems near its max integer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I can use seq(1) to generate sequences of large numbers if I use the default increment:
$ seq 170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
$
However, if I use an increment of 2 (which should stop 2 short of the max int,) it starts with the max integer+1 (2^127) and outputs it forever:
$ seq 170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
.
.
.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: coreutils 8.28-1ubuntu1
ProcVersionSign
Uname: Linux 4.15.0-36-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Oct 24 20:17:15 2018
SourcePackage: coreutils
UpgradeStatus: Upgraded to bionic on 2018-08-19 (66 days ago)
It's worse than I thought. Increments of 2 fail even when aa factor of 100 away from the limit:
kevin@plato-x:~$ seq 170141183460469 231731687303715 884105721 1 170141183460469 231731687303715 884105725 | head -10 231731687303715 884105721 231731687303715 884105722 231731687303715 884105723 231731687303715 884105724 231731687303715 884105725 231731687303715 8841051 2 170141183460469 231731687303715 8841055 | head -10 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648 231728228539202 0635648
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
kevin@plato-x:~$ seq 170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
170141183460469
kevin@plato-x:~$