#1033655 elpa-flycheck: Emacs28 / flycheck is spawning wild running shellcheck processes eating up the system memory (oom-kill)

Package:
elpa-flycheck
Source:
elpa-flycheck
Submitter:
H.-Dirk Schmitt
Date:
2023-03-30 10:00:03 UTC
Severity:
normal
Tags:
#1033655#5
Date:
2023-03-29 12:46:04 UTC
From:
To:
The combination of Emacs28 + elpa-flycheck + shellcheck in *bookworm* spawn never terminating shellcheck processes.
These are eating up the memory and trigger oom-kill.

**This renders my system unstable.**  It appears to be blocked minutes till the oem-kill cleans up some memory.


Analysis:
I have temporarly downgraded elpa-flycheck and shellcheck. The wild processes are still spawned.
So I assume that Emacs28 introduce a different behaviour here that is probematic for flycheck or shellcheck.


Mitigation:
As a mitigation I exclude the invocation of shellcheck in my Emacs setup:
`(customize-set-variable 'flycheck-disabled-checkers '(sh-shellcheck))`


Suggestion:
I suggest to add this mitigation temporarily to the elpa-flycheck package to avoid degraded systems untill a real
solution is found.

#1033655#10
Date:
2023-03-29 12:58:46 UTC
From:
To:
I also reported the Issue to the upstream project: 
https://github.com/flycheck/flycheck/issues/2014

#1033655#15
Date:
2023-03-29 20:06:08 UTC
From:
To:
H.-Dirk Schmitt <dirk@computer42.org> writes:

I can't duplicate this on a bookworm system. Does it happen for any
shell script, or some particular ones?

d

#1033655#24
Date:
2023-03-29 20:06:08 UTC
From:
To:
H.-Dirk Schmitt <dirk@computer42.org> writes:

I can't duplicate this on a bookworm system. Does it happen for any
shell script, or some particular ones?

d

#1033655#29
Date:
2023-03-30 09:50:40 UTC
From:
To:
The shell scripts here using a bash library of 5k lines of code.
I just ensured that the problem occurres with this script.

http://svn.computer42.org/svn/computer42-src/c42-utilities/trunk/batchme

The script depend on the libraries:
- http://svn.computer42.org/svn/computer42-src/c42-utilities/trunk/c42-common-functions
- http://svn.computer42.org/svn/computer42-src/c42-utilities/trunk/c42-common-functions

Either put the „libs“ to /usr/local/lib/bash or tweak the `batchme` script head to allow `shellscript` finding the libs.


The shellcheck options here are:
`export SHELLCHECK_OPTS=--norc --shell=bash --enable=add-default-case,avoid-nullary-conditions,require-variable-braces --exclude=SC2015,SC2120,SC2059,SC2119,SC1091,SC1090,SC1111`

#1033655#34
Date:
2023-03-30 09:50:40 UTC
From:
To:
The shell scripts here using a bash library of 5k lines of code.
I just ensured that the problem occurres with this script.

http://svn.computer42.org/svn/computer42-src/c42-utilities/trunk/batchme

The script depend on the libraries:
- http://svn.computer42.org/svn/computer42-src/c42-utilities/trunk/c42-common-functions
- http://svn.computer42.org/svn/computer42-src/c42-utilities/trunk/c42-common-functions

Either put the „libs“ to /usr/local/lib/bash or tweak the `batchme` script head to allow `shellscript` finding the libs.


The shellcheck options here are:
`export SHELLCHECK_OPTS=--norc --shell=bash --enable=add-default-case,avoid-nullary-conditions,require-variable-braces --exclude=SC2015,SC2120,SC2059,SC2119,SC1091,SC1090,SC1111`