shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

Shellcheck v0.8.0 runs out of memory on linux OS for big sh files

Open thiagoluizalves opened this issue 2 years ago • 5 comments

When I try shellcheck shellcheck-v0.8.0.linux.x86_64.tar.xz it runs out of memory reaching 64GB of memory. The issue was fixed by downgrading Shellcheck to v0.7.2

The same execution takes just a few secs on MacOS for the same version.

For bugs

  • Rule Id (if any, e.g. SC1000): SC2060 or any other
  • My shellcheck version (shellcheck --version or "online"): v0.8.0
  • [ ] The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
  • [x] I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit

For new checks and feature suggestions

  • [x] https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
  • [ ] I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related

#Shell script ltmain.txt

Here's what shellcheck currently says:

It is exiting with code 137 when processing a .sh file with 6956 lines

Here's what I wanted or expected to see:

Analysis should run fast taking a few secs as it does in Macs

thiagoluizalves avatar Sep 19 '22 18:09 thiagoluizalves

Are you running via qemu user emulation by any chance, such as with Docker on macOS/ARM?

koalaman avatar Sep 19 '22 20:09 koalaman

Still relevant, leaving shellcheck open on a ~100 line file makes it consume up to 16GB RAM (On UBUNTU WSL).

GeorgeAndreiBals avatar Oct 25 '23 10:10 GeorgeAndreiBals

leaving shellcheck open

what does that mean? it never finish the processing?

have you tried the latest release or still using 0.8.0? able to build from source?

WSL might be a key here.

brother avatar Oct 26 '23 06:10 brother

leaving shellcheck open

what does that mean? it never finish the processing?

have you tried the latest release or still using 0.8.0? able to build from source?

WSL might be a key here.

It looks like it finishes processing, but checking something like btop it shows that there are multiple instances of shellchek running (even if only one bash file is opened) and they each consume something like 1-2GB RAM.

GeorgeAndreiBals avatar Nov 06 '23 12:11 GeorgeAndreiBals

me too

lazebird avatar Jun 29 '24 03:06 lazebird