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

x86 npm on Windows randomly crashes with -1073741819 exit code #34927

Closed
FeodorFitsner opened this issue Aug 25, 2020 · 9 comments
Closed

x86 npm on Windows randomly crashes with -1073741819 exit code #34927

FeodorFitsner opened this issue Aug 25, 2020 · 9 comments
Labels
v8 engine Issues and PRs related to the V8 dependency. windows Issues and PRs related to the Windows platform.

Comments

@FeodorFitsner
Copy link

  • Version: 14.8.0 x86 (but looks like the entire 14.x line is affected)
  • Platform: Windows Server 2019 and Windows 10
  • Subsystem: npm

What steps will reproduce the bug?

npm from x86 version of Node.js 14.x sporadically crashes with -1073741819 exit code.

npm from x64 version of Node 14.x works normally.

To reproduce the issue run the following Windows batch script which runs npm -v 500 times in a loop:

@ECHO OFF
SETLOCAL
SET EL=0

IF %ERRORLEVEL% NEQ 0 GOTO ERROR

set iterations=500
:loop
set /a iterations -= 1
CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
if %iterations% GTR 0 GOTO loop


GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

How often does it reproduce? Is there a required condition?

It could crash on the first or second iteration; sometimes it manages to do around 5 iterations.

What is the expected behavior?

All iterations should be successful:

c:\>test-node.cmd
6.14.7
6.14.7
6.14.7
6.14.7
6.14.7
...

What do you see instead?

c:\>test-node
6.14.7
~~~~~~~~~~~~~~~~~~~~~~ ERROR c:\test-node.cmd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERRORLEVEL: -1073741819
~~~~~~~~~~~~~~~~~~~~~~ DONE c:\test-node.cmd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Additional information

Initially, we thought it was AppVeyor-specific issue, however we were able to reproduce the issue on Hyper-V and GCP virtual machines with Windows Server 2019 as well as bare-metal PC with Windows 10.

@Almenon
Copy link

Almenon commented Aug 25, 2020

@bnoordhuis
Copy link
Member

-1073741819 is 0xC0000005, the status code for a general access violation. Unfortunately, that can be caused by just about anything.

Does it print a stack trace or anything else that could help troubleshoot this?

@FeodorFitsner
Copy link
Author

Nope, it just silently crashes. There was an attempt to troubleshoot that: appveyor/ci#3407 (comment)

@bnoordhuis
Copy link
Member

Thanks, that's helpful insofar that it tells me what happens, although not why. :-)

What: the garbage collector tries to move an object but its map pointer (its "hidden class" descriptor) is invalid

Why: unclear. I don't recall receiving similar bug reports.

cc @nodejs/platform-windows since this only seems to happen with the windows x86 build.

@bnoordhuis bnoordhuis added v8 engine Issues and PRs related to the V8 dependency. windows Issues and PRs related to the Windows platform. labels Aug 27, 2020
@jasnell
Copy link
Member

jasnell commented Aug 27, 2020

Ah, these are "fun". It might not have anything to do with the garbage collector and may be something with the environment clean up logic. The fact that it's so intermittent means it could be initialized memory somewhere. Later on today or tomorrow I'll see if I can reproduce the issue.

@addaleax
Copy link
Member

and may be something with the environment clean up logic

The stack trace makes that seem very unlikely, the crash is happening while JS is running.

@tniessen
Copy link
Member

Node.js 14 is about to reach end-of-life. Is this known to be an issue in the 16, 18, 19, or 20 release lines?

@shnooshnoo
Copy link

tested with node 14,16,18,20 (both x86 and x64) and was not able to reproduce this (i'm on win11). If anyone can help me reproduce i'd be keen to look into it and try to fix, otherwise looks like it is no longer relevant.

@tniessen
Copy link
Member

Since there has been no activity here in years and any evidently problematic configuration has reached end-of-life status, I'll close this issue.

@tniessen tniessen closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

7 participants