snyk protect crash with react-scripts 3.0.1

Created on 26 Jun 2019  路  4Comments  路  Source: snyk/snyk

  • node -v: v10.14.1
  • npm -v: 6.4.1
  • snyk -v: 1.184.0
  • react-scripts: 3.0.1
  • Command run: snyk protect
  • package.json
  ...
  "dependencies": {
    "react-scripts": "3.0.1",
    "snyk": "^1.184.0"
  }
  ...

Expected behaviour

snyk protect works well with react-scripts 3.0.0 but crash with 3.0.1

Actual behaviour

Allocation failed - JavaScript heap out of memory

Steps to reproduce

  • delete yarn.lock && rm -rf node_modules
  • run snyk protect
$ npm run snyk-protect
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1561518938107-0.8507063127969579/node but npm is using /home/user/.nvm/versions/node/v10.14.1/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] snyk-protect /home/user/.../.../app
> snyk protect --debug

  snyk protect { _: [ [Circular] ], debug: true } +0ms
  snyk ~~~~ LIVE RUN ~~~~ +0ms
  snyk policies found [ '/home/user/.../.../app',
  '/home/user/.../.../app/node_modules/snyk' ] +0ms

<--- Last few GCs --->

[19948:0x3e3b750]    75116 ms: Mark-sweep 1283.4 (1432.9) -> 1283.3 (1380.4) MB, 262.1 / 0.0 ms  (average mu = 0.074, current mu = 0.000) last resort GC in old space requested
[19948:0x3e3b750]    75476 ms: Mark-sweep 1283.3 (1380.4) -> 1283.3 (1362.4) MB, 360.7 / 0.0 ms  (average mu = 0.032, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x622143dbe1d]
Security context: 0x2b3c6759e6e1 <JSObject>
    1: fromString(aka fromString) [0x4245729c2c1] [buffer.js:341] [bytecode=0x1de0db3d73f1 offset=53](this=0x31b4b20826f1 <undefined>,string=0x310358df4021 <Very long string[256309304]>,encoding=0x2b3c675bc8d1 <String[4]: utf8>)
    2: from [0xb6b98d1d161] [buffer.js:202] [bytecode=0x1de0db3d6f71 offset=11](this=0x10a3f0c5f221 <JSFunction Buffer (sfi = 0xb6b9...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x8dbaa0 node::Abort() [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 2: 0x8dbaec  [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 3: 0xad83de v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 4: 0xad8614 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 5: 0xec5c42  [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 6: 0xed545f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 7: 0xea500b v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 8: 0xfee8c3 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
 9: 0xad5a04 v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
10: 0xae37b0 v8::String::Utf8Length() const [/home/user/.nvm/versions/node/v10.14.1/bin/node]
11: 0x8f4776  [/home/user/.nvm/versions/node/v10.14.1/bin/node]
12: 0xb60aff  [/home/user/.nvm/versions/node/v10.14.1/bin/node]
13: 0xb61669 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [/home/user/.nvm/versions/node/v10.14.1/bin/node]
14: 0x622143dbe1d 
Aborted (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] snyk-protect: `snyk protect --debug`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the [email protected] snyk-protect script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2019-06-26T03_16_54_000Z-debug.log
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
bug in progress 馃尦big tree size | large project

Most helpful comment

We are working on improving out protect flow.
Problem that we are heaving here is a big dependency tree issue (project).
I referenced your issue to the first one occurred, so whenever we solve it, you'll be notified

All 4 comments

Duplicate #564

We are working on improving out protect flow.
Problem that we are heaving here is a big dependency tree issue (project).
I referenced your issue to the first one occurred, so whenever we solve it, you'll be notified

Was this page helpful?
0 / 5 - 0 ratings