npm / support-cli

File your support requests for the npm CLI here!
5 stars 6 forks source link

'Cannot read property '_updated' of undefined' causes process crash before first search index build #16

Closed kevinSuttle closed 8 years ago

kevinSuttle commented 8 years ago

This happens before running npm search for the first time to build the initial index. At least I think.

❯ npm search pure-prompt
npm ERR! Darwin 15.5.0
npm ERR! argv "/Users/kevinSuttle/.nvm/versions/node/v6.2.2/bin/node" "/Users/kevinSuttle/.nvm/versions/node/v6.2.2/bin/npm" "search" "pure-prompt"
npm ERR! node v6.2.2
npm ERR! npm  v3.9.5

npm ERR! Cannot read property '_updated' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm WARN Building the local index for the first time, please be patient

<--- Last few GCs --->

  110982 ms: Mark-sweep 883.6 (1163.5) -> 883.2 (1167.5) MB, 598.4 / 0 ms (+ 32.3 ms in 250 steps since start of marking, biggest step 8.2 ms) [allocation failure] [GC in old space requested].
  111747 ms: Mark-sweep 883.2 (1167.5) -> 858.1 (1144.1) MB, 764.9 / 0 ms [allocation failure] [GC in old space requested].
  112500 ms: Mark-sweep 858.1 (1144.1) -> 858.1 (1138.1) MB, 752.4 / 0 ms [last resort gc].
  113308 ms: Mark-sweep 858.1 (1138.1) -> 858.1 (1129.1) MB, 808.9 / 0 ms [last resort gc].

<--- JS stacktrace --->

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

Security context: 0x220d596c9e59 <JS Object>
    1: fromString(aka fromString) [buffer.js:234] [pc=0x1e3e1233dfe9] (this=0x220d59604189 <undefined>,string=0x9290f794a09 <Very long string[184230592]>,encoding=0x220d596d79c9 <String[4]: utf8>)
    2: from [buffer.js:131] [pc=0x1e3e12bd2ad6] (this=0x30c7575ef199 <JS Function Buffer (SharedFunctionInfo 0x5ebcc3f6679)>,value=0x9290f794a09 <Very long string[184230592]>,encodingOrOffset=0x220d59...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
zsh: abort      npm search pure-prompt
watilde commented 8 years ago

Thanks for reporting this with your log! This bug is reported and tagged as a big-bug, so let's jump to here https://github.com/npm/npm/issues/12619 at the moment.

kevinSuttle commented 8 years ago

Thanks!

faddat commented 8 years ago

Experiencing this bug on arch linux with latest npm. Going to see if NVM will throw me a bone on this one...

npm ERR! Linux 4.6.4-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "search" "hyperterm"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.5

npm ERR! Cannot read property '_updated' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm WARN Building the local index for the first time, please be patient

<--- Last few GCs --->

   26925 ms: Mark-sweep 899.4 (1189.6) -> 899.2 (1191.6) MB, 362.4 / 0 ms (+ 108.9 ms in 602 steps since start of marking, biggest step 6.3 ms) [allocation failure] [GC in old space requested].
   27479 ms: Mark-sweep 899.2 (1191.6) -> 874.0 (1165.1) MB, 554.0 / 0 ms [allocation failure] [GC in old space requested].
   28049 ms: Mark-sweep 874.0 (1165.1) -> 874.0 (1159.1) MB, 569.5 / 0 ms [last resort gc].
   28627 ms: Mark-sweep 874.0 (1159.1) -> 874.0 (1152.1) MB, 577.8 / 0 ms [last resort gc].

<--- JS stacktrace --->

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

Security context: 0x20c3f92c9e31 <JS Object>
    1: fromString(aka fromString) [buffer.js:194] [pc=0x2617a648c4b0] (this=0x20c3f9204189 <undefined>,string=0x3350a7854499 <Very long string[187956334]>,encoding=0x20c3f92d7a21 <String[4]: utf8>)
    2: from [buffer.js:94] [pc=0x2617a6471316] (this=0x3a51eb5e59b9 <JS Function Buffer (SharedFunctionInfo 0x20c3f92e3259)>,value=0x3350a7854499 <Very long string[187956334]>,encodingOrOffset=0x20c3...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [npm]
 2: 0xc8a7dc [npm]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [npm]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [npm]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [npm]
 6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [npm]
 7: v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [npm]
 8: v8::String::WriteUtf8(char*, int, int*, int) const [npm]
 9: node::StringBytes::Write(v8::Isolate*, char*, unsigned long, v8::Local<v8::Value>, node::encoding, int*) [npm]
10: node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) [npm]
11: node::Buffer::CreateFromString(v8::FunctionCallbackInfo<v8::Value> const&) [npm]
12: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [npm]
13: 0x72dd6a [npm]
14: 0x72e26c [npm]
15: 0x2617a600961b
Aborted (core dumped)

Using an NVM install (nvm install node: I use this as a reference install, if there is such a thing) of node gets me the same result:

npm ERR! Linux 4.6.4-1-ARCH
npm ERR! argv "/home/faddat/.nvm/versions/node/v6.3.1/bin/node" "/home/faddat/.nvm/versions/node/v6.3.1/bin/npm" "search" "hyperterm"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3

npm ERR! Cannot read property '_updated' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm WARN Building the local index for the first time, please be patient

<--- Last few GCs --->

   26031 ms: Mark-sweep 900.8 (1288.6) -> 899.5 (1293.6) MB, 169.0 / 0 ms (+ 338.5 ms in 1919 steps since start of marking, biggest step 24.9 ms) [allocation failure] [GC in old space requested].
   26683 ms: Mark-sweep 899.5 (1293.6) -> 874.2 (1273.1) MB, 651.6 / 0 ms [allocation failure] [GC in old space requested].
   27307 ms: Mark-sweep 874.2 (1273.1) -> 874.2 (1267.1) MB, 624.1 / 0 ms [last resort gc].
   27865 ms: Mark-sweep 874.2 (1267.1) -> 874.1 (1260.1) MB, 558.0 / 0 ms [last resort gc].

<--- JS stacktrace --->

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

Security context: 0x395761fc9e31 <JS Object>
    1: fromString(aka fromString) [buffer.js:194] [pc=0x350eabfc9430] (this=0x395761f04189 <undefined>,string=0xf08df7953c1 <Very long string[187956334]>,encoding=0x395761fd7a21 <String[4]: utf8>)
    2: from [buffer.js:94] [pc=0x350eabfa5716] (this=0x336273cbd71 <JS Function Buffer (SharedFunctionInfo 0x395761fe32f9)>,value=0xf08df7953c1 <Very long string[187956334]>,encodingOrOffset=0x395761f...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [npm]
 2: 0xfb1c8c [npm]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [npm]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [npm]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [npm]
 6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [npm]
 7: v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [npm]
 8: v8::String::WriteUtf8(char*, int, int*, int) const [npm]
 9: node::StringBytes::Write(v8::Isolate*, char*, unsigned long, v8::Local<v8::Value>, node::encoding, int*) [npm]
10: node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) [npm]
11: node::Buffer::CreateFromString(v8::FunctionCallbackInfo<v8::Value> const&) [npm]
12: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [npm]
13: 0x9d5b0b [npm]
14: 0x9d60b1 [npm]
15: 0x350eabb0961b
Aborted (core dumped)
faddat commented 8 years ago

12439 talks of fixing this using npm clean cache. Didn't work out for me.

muescha commented 8 years ago

working solution see #12439