Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Can't run the tool #66

Closed
christianhultin opened this issue Jun 2, 2021 · 6 comments
Closed

Bug: Can't run the tool #66

christianhultin opened this issue Jun 2, 2021 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@christianhultin
Copy link

Describe the bug
Followed the guide and installed it globally, running it with "typescript-coverage-report" produces the following error:

<--- Last few GCs --->

[33516:0x110008000]    60001 ms: Mark-sweep (reduce) 4094.3 (4103.0) -> 4094.3 (4104.0) MB, 1800.0 / 0.0 ms  (average mu = 0.035, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1012d79f5 node::Abort() (.cold.1) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 2: 0x1000a59c9 node::Abort() [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 3: 0x1000a5b2f node::OnFatalError(char const*, char const*) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 4: 0x1001e7e87 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 5: 0x1001e7e23 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 6: 0x100394d15 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 7: 0x1003967ba v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 8: 0x100391ee5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
 9: 0x10038f810 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
10: 0x1003901c2 v8::internal::Heap::CollectAllAvailableGarbage(v8::internal::GarbageCollectionReason) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
11: 0x10039dfbe v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
12: 0x100365720 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
13: 0x1005e5ee0 v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
14: 0x1006d0c3f v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
15: 0x100a707d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
16: 0x100a4be51 Builtins_MapPrototypeSet [/Users/userx/.nvm/versions/node/v14.13.1/bin/node]
[1]    33516 abort      typescript-coverage-report

To Reproduce

npm install typescript-coverage-report --global
typescript-coverage-report

Environment

  • Tool version: 0.6.0
  • OS: macOS Catalina 10.15.7
  • Node version: 14.13.1 (also tried it with 12.22.1 but same result)
@christianhultin christianhultin added the help wanted Extra attention is needed label Jun 2, 2021
@alexcanessa
Copy link
Owner

@christianhultin just to clarify, you're running it in a TS project, where the tsconfig.json is?

We've seen this problem before, but it should have been fixed in #51. If it's still a problem, then plantain-00/type-coverage#89 hasn't been fixed. Could you check and run type-coverage directly?

@christianhultin
Copy link
Author

Not quite sure what you mean, but if I do this in the root of my project repository

  1. Install the type-coverage package:
npm install --save-dev type-coverage

2.Add a script in package json:

"scripts": {
      "tc": "type-coverage"
}
  1. Run the script:
npm run tc

I get the following result again

> projectX@0.1.0 tp /Users/userY/Developer/organisationZ/projectX
> type-coverage


<--- Last few GCs --->
03[7405:0x110008000]    72033 ms: Mark-sweep (reduce) 4095.9 (4103.0) -> 4095.6 (4104.5) MB, 2693.1 / 0.0 ms  (+ 0.0 ms in 16 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2699 ms) (average mu = 0.064, current mu = 0.002[7405:0x110008000]    74480 ms: Mark-sweep (reduce) 4096.6 (4106.5) -> 4096.5 (4107.5) MB, 2367.5 / 0.0 ms  (+ 70.8 ms in 16 steps since start of marking, biggest step 16.3 ms, walltime since start of marking 2447 ms) (average mu = 0.033, current mu = 0.0

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1012d79f5 node::Abort() (.cold.1) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 2: 0x1000a59c9 node::Abort() [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 3: 0x1000a5b2f node::OnFatalError(char const*, char const*) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 4: 0x1001e7e87 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 5: 0x1001e7e23 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 6: 0x100394d15 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 7: 0x1003967ba v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 8: 0x100391ee5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
 9: 0x10038f810 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
10: 0x10039defa v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
11: 0x10039df81 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
12: 0x10036c057 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
13: 0x1006eaea8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
14: 0x100a707d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/userY/.nvm/versions/node/v14.13.1/bin/node]
[1]    7404 abort      npm run tp

Could it have anything to do with us using nvm for managing node-versions?

@alexcanessa
Copy link
Owner

@christianhultin So we use that package to collect coverage, while this tool only displays the results.
So, since it's coming from type-coverage, I've chased the author of that package.
I'll try also to have a look.

Nothing to do with nvm.

@plantain-00
Copy link

JavaScript heap out of memory is a different bug with Maximum call stack size exceeded.
If your source code is really large, you can try to add --max-old-space-size like this: https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory
If your source code is small, you can create a minimal repo that reproduce this issue.

@alexcanessa
Copy link
Owner

@plantain-00 soz I somehow thought it was the same and didn't read 😄
Thanks for chipping in.

@christianhultin
Copy link
Author

It works if I increase memory! Thanks for that :) Is there any way to see the details on folder-level rather than file-level? Since it is a large repo, the file-level isn't really of interest here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants