cli-table / cli-table3

Pretty unicode tables for the command line
MIT License
527 stars 44 forks source link

Version 0.6.1 dies with "JavaScript heap out of memory" #256

Closed klassm closed 2 years ago

klassm commented 2 years ago

Hi there,

Thanks for your continuous effort to maintain this library! We got an automatic update to version 0.6.1 today, which we get as transitive dependency of the jscpd library.

From 0.6.1 on our build starts to fail with "JavaScript heap out of memory". The whole error message goes like this:

07:50:37  FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
07:50:37  1: 0xafedf0 node::Abort() [node]
07:50:37  2: 0xa1814d node::FatalError(char const*, char const*) [node]
07:50:37  3: 0xce792e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
07:50:37  4: 0xce7ca7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
07:50:37  5: 0xeb1685  [node]
07:50:37  6: 0xec081d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
07:50:37  7: 0xec399c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
07:50:37  8: 0xe85f25 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
07:50:37  9: 0xe80e29 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [node]
07:50:37  10: 0xe80ee5 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [node]
07:50:37  11: 0x103a755  [node]
07:50:37  12: 0x1099ad5  [node]
07:50:37  13: 0x109f9a5 v8::internal::FastKeyAccumulator::GetKeys(v8::internal::GetKeysConversion) [node]
07:50:37  14: 0x11f0116 v8::internal::Runtime_ForInEnumerate(int, unsigned long*, v8::internal::Isolate*) [node]
07:50:37  15: 0x15c9eb9  [node]
07:50:37  Aborted (core dumped)
07:50:37  [06:50:34] '<anonymous>' errored after 1.1 min
07:50:37  [06:50:34] Error: Command failed: npx jscpd --config jscpd.json src
07:50:37  
07:50:37  <--- Last few GCs --->
07:50:37  
07:50:37  [4037119:0x6805550]    63743 ms: Scavenge 4041.5 (4114.7) -> 4040.7 (4124.7) MB, 15.1 / 0.0 ms  (average mu = 0.618, current mu = 0.351) allocation failure 
07:50:37  [4037119:0x6805550]    63788 ms: Scavenge 4047.4 (4124.7) -> 4045.2 (4126.0) MB, 30.3 / 0.0 ms  (average mu = 0.618, current mu = 0.351) allocation failure 
07:50:37  [4037119:0x6805550]    65472 ms: Scavenge 4048.4 (4126.0) -> 4046.9 (4146.0) MB, 1674.8 / 0.0 ms  (average mu = 0.618, current mu = 0.351) allocation failure 
07:50:37  
07:50:37  
07:50:37  <--- JS stacktrace --->
07:50:37  
07:50:37  FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
07:50:37   1: 0xafedf0 node::Abort() [node]
07:50:37   2: 0xa1814d node::FatalError(char const*, char const*) [node]
07:50:37   3: 0xce792e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
07:50:37   4: 0xce7ca7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
07:50:37   5: 0xeb1685  [node]
07:50:37   6: 0xec081d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
07:50:37   7: 0xec399c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
07:50:37   8: 0xe85f25 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
07:50:37   9: 0xe80e29 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [node]
07:50:37  10: 0xe80ee5 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [node]
07:50:37  11: 0x103a755  [node]
07:50:37  12: 0x1099ad5  [node]
07:50:37  13: 0x109f9a5 v8::internal::FastKeyAccumulator::GetKeys(v8::internal::GetKeysConversion) [node]
07:50:37  14: 0x11f0116 v8::internal::Runtime_ForInEnumerate(int, unsigned long*, v8::internal::Isolate*) [node]
07:50:37  15: 0x15c9eb9  [node]
07:50:37  Aborted (core dumped)
07:50:37  
07:50:37      at ChildProcess.exithandler (node:child_process:397:12)
07:50:37      at ChildProcess.emit (node:events:394:28)
07:50:37      at ChildProcess.emit (node:domain:537:15)
07:50:37      at maybeClose (node:internal/child_process:1067:16)
07:50:37      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
07:50:37      at Process.callbackTrampoline (node:internal/async_hooks:130:17)
07:50:37  [06:50:34] 'lint' errored after 1.1 min

Now when you downgrade again to 0.6.0, it starts to work again. The strange thing is also that the console output seems to be totally screwed. See for yourself here:

image

Maybe you find some time to have a look? Thank you so much :-)

dnlsndr commented 2 years ago

That's an issue with Maraks colors.js dependency. That guy is out on vengeance and published a corrupt version that runs an infinite loop so no packages depending on it will ever finish... fuck that's annoying.

klassm commented 2 years ago

Oh man - would it be possible to pin an older version for now?

dnlsndr commented 2 years ago

No idea, I'm currently trying out stuff with npm shrinkwrap for now, since our @nestjs/cli depends on cli-table which in terms depends on colors.js. Maybe one can override the colors dependency version to an older one

dnlsndr commented 2 years ago

Seems like there already is a discussion for it https://github.com/cli-table/cli-table3/pull/250

Turbo87 commented 2 years ago

see https://github.com/cli-table/cli-table3/pull/251