Skip to content

Instantly share code, notes, and snippets.

@3point2
Created December 22, 2020 23:02
Show Gist options
  • Save 3point2/e772b151899a866e563ee9c52a94ead7 to your computer and use it in GitHub Desktop.
Save 3point2/e772b151899a866e563ee9c52a94ead7 to your computer and use it in GitHub Desktop.
ripgrep resource leak
$ mkdir repro
$ for i in $(seq 1 100); do echo hello > repro/file$i; done
$ gzip repro/*
$ ps -u $(whoami) -T| wc -l
543
$ ulimit -u 573
$ rg --debug -z -l hello repro
DEBUG|grep_regex::literal|crates/regex/src/literal.rs:58: literal prefixes detected: Literals { lits: [Complete(hello)], limit_size: 250, limit_class: 10 }
DEBUG|globset|crates/globset/src/lib.rs:431: built glob set; 0 literals, 0 basenames, 12 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG|globset|crates/globset/src/lib.rs:431: built glob set; 0 literals, 0 basenames, 12 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG|globset|crates/globset/src/lib.rs:431: built glob set; 0 literals, 0 basenames, 12 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
repro/file98.gz
repro/file52.gz
repro/file25.gz
repro/file3.gz
repro/file36.gz
repro/file7.gz
repro/file63.gz
repro/file64.gz
repro/file13.gz
repro/file46.gz
repro/file23.gz
repro/file42.gz
repro/file77.gz
repro/file48.gz
repro/file17.gz
repro/file33.gz
repro/file24.gz
repro/file16.gz
repro/file72.gz
repro/file50.gz
repro/file79.gz
repro/file22.gz
repro/file35.gz
repro/file58.gz
repro/file88.gz
repro/file47.gz
repro/file83.gz
repro/file81.gz
thread '<unnamed>' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /build/rust/src/rustc-1.43.1-src/src/libstd/thread/mod.rs:619:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
repro/file93.gz
thread '<unnamed>' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /build/rust/src/rustc-1.43.1-src/src/libstd/thread/mod.rs:619:5
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', crates/ignore/src/walk.rs:1294:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment