Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

installation fails because of gc'ed promise #8

Closed
eljefedelrodeodeljefe opened this issue Jun 29, 2016 · 14 comments
Closed

installation fails because of gc'ed promise #8

eljefedelrodeodeljefe opened this issue Jun 29, 2016 · 14 comments

Comments

@eljefedelrodeodeljefe
Copy link

I am known to be not quite the promise friend. But this broke quickly and I think due to the limited amount of callbacks here, simple callback style would have been better. :-(

For reference:

<--- Last few GCs --->

  105216 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 2086.4 / 0 ms [allocation failure] [GC in old space requested].
  107011 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 1795.2 / 0 ms [allocation failure] [GC in old space requested].
  108885 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 1874.4 / 0 ms [last resort gc].
  110850 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 1964.9 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 00000085C96C9E79 <JS Object>
    1: /* anonymous */(aka /* anonymous */) [native promise.js:26] [pc=000001B1CEAEE394] (this=00000085C9604189 <undefined>,value=000001DCE369B511 <a Promise with map 00000175A449FF99>)
    2: /* anonymous */(aka /* anonymous */) [C:\Program Files (x86)\Nodist\bin\node_modules\windows-build-tools\lib\install\tailer.js:136] [pc=000001B1CEC32439] (this=00000085C9604101 <null>,err=000001DCE369B3...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\node.exe" "C:\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE

npm ERR! windows-build-tools@0.2.5 postinstall: `node ./lib/index.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the windows-build-tools@0.2.5 postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\jefe-win\npm-debug.log
@felixrieseberg
Copy link
Owner

Actually, upon closer inspection, something weird is going on here. I can't reproduce - and a bunch of heap inspectors all tell me that we're constantly using less than 50megs (in install alone). Of course, npm has a decently sized overhead when running install.

@eljefedelrodeodeljefe might have a point in saying that old-school callbacks could help, so I added those.

I'd be extremely thankful if you could try it again (maybe even with --production). I can't reproduce and I really want this to work for everyone.

@MarkDurbin104
Copy link

I appear to have the same problem, used the --production flag. I don't know if the attache log file is of any use?


D:\>npm install --global --production windows-build-tools

> windows-build-tools@0.2.6 postinstall C:\Program Files\nodejs\node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.11.amd64.msi
[============================================>] 100.0% of 19.55 MB (3.55 MB/s)
Downloaded python-2.7.11.amd64.msi. Saved to C:\Users\mark\.windows-build-tools\python-2.7.11.amd64.msi.
Starting installation...

<--- Last few GCs --->

  128319 ms: Scavenge 1398.4 (1458.1) -> 1398.4 (1458.1) MB, 1.9 / 0 ms (+ 3.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
  130499 ms: Mark-sweep 1398.4 (1458.1) -> 1398.2 (1458.1) MB, 2179.3 / 0 ms (+ 5.0 ms in 2 steps since start of marking, biggest step 3.0 ms) [last resort gc].
  132535 ms: Mark-sweep 1398.2 (1458.1) -> 1398.0 (1458.1) MB, 2036.4 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 000003A85D8E3AD1 <JS Object>
    1: PromiseSet(aka PromiseSet) [native promise.js:~32] [pc=0000025A4B28995B] (this=000003A85D804189 <undefined>,m=000003A85D8FCE29 <a Promise with map 000000596A1A7DC1>,p=0,q=000003A85D804189 <undefined>,r=000003A85D8FCE89 <JS Array[0]>,s=000003A85D8FCE69 <JS Array[0]>)
    2: PromiseInit(aka PromiseInit) [native promise.js:~47] [pc=0000025A4B2823E9] (this=000003A85D804189 <undefined>,m=00...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools"
npm ERR! node v5.5.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! windows-build-tools@0.2.6 postinstall: `node ./lib/index.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the windows-build-tools@0.2.6 postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\node\node-webgl\npm-debug.log

```[npm-debug.zip](https://github.com/felixrieseberg/windows-build-tools/files/339786/npm-debug.zip)

@ali92hm
Copy link
Contributor

ali92hm commented Jun 29, 2016

@felixrieseberg @eljefedelrodeodeljefe @MarkDurbin104 I was able to reproduce the error, and I'm currently investigating it.

@meilechh
Copy link

I got the same error on my laptop (8GB). Meanwhile I was able to install on my desktop (16GB) without any problem.
This is the log:

npm install --global --production windows-build-tools

> windows-build-tools@0.2.6 postinstall C:\Users\user\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.11.amd64.msi
[>                                            ] 0.0% (0 B/s)
Downloaded python-2.7.11.amd64.msi. Saved to C:\Users\user\.windows-build-tools\python-2.7.11.amd64.msi.
Starting installation...

<--- Last few GCs --->

  292468 ms: Mark-sweep 1398.1 (1458.1) -> 1398.1 (1458.1) MB, 4529.9 / 0 ms [allocation failure] [GC in old space requested].
  297182 ms: Mark-sweep 1398.1 (1458.1) -> 1398.1 (1458.1) MB, 4713.4 / 0 ms [allocation failure] [GC in old space requested].
  301147 ms: Mark-sweep 1398.1 (1458.1) -> 1398.1 (1458.1) MB, 3965.3 / 0 ms [last resort gc].
  305933 ms: Mark-sweep 1398.1 (1458.1) -> 1398.0 (1458.1) MB, 4785.8 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0000022FD2FE3AD1 <JS Object>
    1: PromiseSet(aka PromiseSet) [native promise.js:~32] [pc=000001FFE380B7DB] (this=0000022FD2F04189 <undefined>,m=00000144AC068BF9 <a Promise with map 000000B0B41A7D11>,p=0,q=0000022FD2F04189 <undefined>,r=00000144AC068C71 <JS Array[0]>,s=00000144AC068CC1 <JS Array[0]>)
    2: PromiseInit(aka PromiseInit) [native promise.js:~47] [pc=000001FFE2837949] (this=0000022FD2F04189 <undefined>,m=00...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools"
npm ERR! node v5.5.0
npm ERR! npm  v3.5.3
npm ERR! code ELIFECYCLE

npm ERR! windows-build-tools@0.2.6 postinstall: `node ./lib/index.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the windows-build-tools@0.2.6 postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\WINDOWS\system32\npm-debug.log

@felixrieseberg
Copy link
Owner

I think that I found the issue (we're doing some mean recursive calls that add up quickly if launching the underlying installers wait for too long).

If anyone who's affected could give it another try, I'd be very thankful. I just installed without errors on a 8.1 VM with 1GB memory and Node 4, so I'm hoping that we made a big leap here.

@appelgriebsch
Copy link

Wooohooo... yesterday it failed on my Windows 7 laptop.... today it works perfectly. Thx for this!!

@felixrieseberg
Copy link
Owner

Awesome, that's great to hear. I hope I'm not doing this prematurely, but I'm closing this issue then.

@MarkDurbin104
Copy link

All working perfectly for me now too. Windows 10 x64

@joaocgreis
Copy link
Contributor

joaocgreis commented Jun 30, 2016

@felixrieseberg Now the output looks good

Starting installation...
Successfully installed Python 2.7
Successfully installed Visual Studio Build Tools.

but the build tools are not installed. Looking at the log from .windows-build-tools it looks like the problem might be in my machine, I'll investigate. (Even if it is, it'd be good to add a warning or workaround. Perhaps we could test the installation at the end, with node-gyp directly to avoid calling npm recursively?)

It would be great if anyone else could also retry.(outdated github page, sorry)

@felixrieseberg
Copy link
Owner

@joaocgreis: According to the logs, the package was installed successfully. It failed to install amd64 build tools, but installed the x86 ones fine. Did you restart your shell?

[090C:085C][2016-06-30T11:38:03]i319: Applied execute package: Msi_BuildTools_MSBuild_x86, result: 0x0, restart: None
[0B88:0B60][2016-06-30T11:38:03]i325: Registering dependency: {d21da0dd-4ba4-4838-ba58-64cf7a77131a} on package provider: Microsoft.BuildTools.MSBuild_x86,v14, package: Msi_BuildTools_MSBuild_x86
[0B88:0B60][2016-06-30T11:38:03]i301: Applying execute package: Msi_BuildTools_MSBuild_Res_x86, action: Install, path: C:\ProgramData\Package Cache\{A7E88B38-6886-4474-9D85-A8ABE5FCD80E}v14.0.23107\packages\BuildTools_MSBuildResMsi_x86\BuildTools_MSBuildResMsi.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" NOVSUI="1"'
[090C:085C][2016-06-30T11:38:06]i000: MUX:  Installation size in bytes for package: Msi_BuildTools_MSBuild_Res_x86 MaxAppDrive: 0  MaxSysDrive: 15663104  AppDrive: 0  SysDrive: 15663104
[090C:085C][2016-06-30T11:38:06]i000: MUX:  Return Code:0x0 Msi Messages:0 Result Detail:RollbackCleanup Restart:None
[090C:085C][2016-06-30T11:38:06]i000: MUX:  Reset execution Result
[090C:085C][2016-06-30T11:38:06]i000: MUX:  Reset Result
[090C:085C][2016-06-30T11:38:06]i000: Setting string variable 'IsInstalled' to value '1'

Files were clearly written, too:

MUX:  Free Disk Space before install:  SystemDrive C:\ 95134633984 bytes  AppDrive C:\ 95134633984 bytes
MUX:  Free Disk Space after install:  SystemDrive C:\ 94924275712 bytes  AppDrive C:\ 94924275712 bytes

Are you saying that Windows reported the package as installed, but it wasn't actually installed?

@joaocgreis
Copy link
Contributor

@felixrieseberg MSBuild is indeed installed. But no Visual C++. So yes, it reported as installed, but no compiler is available. (It run quite fast, about 1 minute.. My experience with VCBT is that it takes a lot more to download)

@felixrieseberg
Copy link
Owner

Fascinating. That's an error with the build tools themselves then, but I'd love to tell the team about what happened here - if you figure anything else out, I'll totally forward it over to them.

@joaocgreis
Copy link
Contributor

@felixrieseberg This is installing the "Microsoft Build Tools 2015". Shouldn't it be "Microsoft Visual C++ Build Tools 2015"? The link in constants.js should point to http://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe.

@felixrieseberg
Copy link
Owner

@joacgreis: This was fixed a few days ago, I just forgot to reply to your comment. It's been live on npm for a few days too, so I assume everyone is happy 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants