jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

CST process out of memory #2221

Closed TheSavior closed 8 years ago

TheSavior commented 8 years ago

On one of my travis builds from the 3.0.2 greenkeeper bump, I have this error:

https://travis-ci.org/TheSavior/find-parent/jobs/123328178

> eslint . && jscs .
<--- Last few GCs --->
   71265 ms: Mark-sweep 1394.1 (1458.1) -> 1395.6 (1458.1) MB, 1424.4 / 0 ms [allocation failure] [GC in old space requested].
   72689 ms: Mark-sweep 1395.6 (1458.1) -> 1397.9 (1458.1) MB, 1424.0 / 0 ms [allocation failure] [GC in old space requested].
   74122 ms: Mark-sweep 1397.9 (1458.1) -> 1389.1 (1458.1) MB, 1433.6 / 0 ms [last resort gc].
   75554 ms: Mark-sweep 1389.1 (1458.1) -> 1394.1 (1458.1) MB, 1431.7 / 0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x122c644e3ac1 <JS Object>
    2: _acceptChildren [/home/travis/build/TheSavior/find-parent/node_modules/cst/lib/elements/types/IfStatement.js:61] [pc=0x245f03371086] (this=0x3bed2a019961 <an IfStatement with map 0x1f71cd5cefb9>,children=0x3bed2a019a19 <an ElementAssert with map 0x294acfca3279>)
    3: _setChildren [/home/travis/build/TheSavior/find-parent/node_modules/cst/lib/elements/Element.js:721] [pc=0x245f03377094]...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Aborted (core dumped)
wulfsolter commented 8 years ago

Failing on local machine as well with same symptoms.

wulfsolter commented 8 years ago

Manually added node_modules to my JSCS ignores in .jscsrc

{
    ...
    excludeFiles: [
        ...
        "node_modules/**",
        ...
    ],
    ...
}
hzoo commented 8 years ago

Hm interesting since we had already excluded node_modules before... And this is only an issue when you do jscs . rather than specifying the folders

Oh I see https://github.com/jscs-dev/node-jscs/commit/908bd20654723eac98949f994710c9ea902fe671 which changed node_modules/** to */node_modules/**. Maybe we need both.. globs are confusing @kirbysayshi

We were ignoring the top level node_modules by default but we made a change to ignore sub node_module folders. It seems like now it only ignores sub node_modules.

ESLint discussion: https://github.com/eslint/eslint/issues/1163#issuecomment-58378266

hzoo commented 8 years ago

Reverting in https://github.com/jscs-dev/node-jscs/issues/2222. Will release soon

kirbysayshi commented 8 years ago

Weird, I wonder if this has to do with how the glob is tested? I could see that glob failing if it weren't tested against an absolute path, and instead were tested against a relative path.

But oh well, sorry this caused people issues.