Skip to content

seq refuses more than 1e9 iterations ('seq: too many iterations'); GNU streams unbounded #1376

Closed

Description

@caomengxuan666

Probe-verified (same-source mingw+Wine harness, two runs, GNU coreutils 9.4):

  • seq 1000000001 | head -3 → WinuxCmd: seq: too many iterations, exit 1, no output at all. GNU streams 1 2 3 ... unbounded.
  • The cap is on the iteration count: seq 1000000001 1000000003 (three values, all > 1e9) works fine on both.

A hard 1e9-iteration ceiling makes seq unusable as a streaming producer for large ranges — exactly the role it plays in shell pipelines, where the consumer decides how much to read.

Expected (GNU)

seq generates lazily with no iteration cap; memory and output volume are the consumer's concern.

Source

src/commands/seq.cpp: an upfront total-iteration computation is validated against a 1'000'000'000 limit and refused before generation.

Regression seed

In-repo test named with this issue number: seq 1000000001 | head -3 (or an equivalent bounded read) yields the first values with no error.

Activity

  1. added
    bug
    compat-gap
    on Oct 26, 2026
  2. added a commit that references this issue on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcompat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions