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

SEGFAULT on Node Fermium #34126

Closed
SalathielGenese opened this issue Jun 29, 2020 · 2 comments
Closed

SEGFAULT on Node Fermium #34126

SalathielGenese opened this issue Jun 29, 2020 · 2 comments
Labels
buffer Issues and PRs related to the buffer subsystem. worker Issues and PRs related to Worker support.

Comments

@SalathielGenese
Copy link

What steps will reproduce the bug?

I tried to build https://github.com/ever-co/gauzy - yarn nx build api --configuration=production and it landed me here nrwl/nx#2956 where other developers noticed that downgrading Node fixed the issue.

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

To the exception of Node version, I have not noticed any other condition.

What is the expected behavior?

A successful build.

What do you see instead?

image#1

In Docker build

error command failed with signal "SIGSEGV"

On host, it is silent and the exit status - echo $? - returned is 139, which happens to be NodeJS exit status for SEGFAULT.
image#4

Additional information

It works after I downgraded to node:erbium-alpine. Since the issue is not happening during development, I have not [yet] downgraded my environment.

@addaleax

This comment has been minimized.

@addaleax addaleax added buffer Issues and PRs related to the buffer subsystem. worker Issues and PRs related to Worker support. labels Jun 30, 2020
@addaleax
Copy link
Member

addaleax commented Jun 30, 2020

Thanks for the report! I’ve reproduced this. It’s happening because the BackingStore for a Buffer created inside a Worker (possibly from a native addon) does not keep the ArrayBuffer::Allocator itself alive, leading to a use-after-free bug. This is an oversight on my part.

However, the good news is that #33291 fixes this, and is scheduled to be released today, as part of #34093. So all that we really need to do here is write a regression test. (The other good news is that this would typically only happen on process exit, so while the error is annoying, it doesn’t affect the functionality of the program.)

addaleax added a commit to addaleax/node that referenced this issue Jun 30, 2020
Add a test for a regression that occurs when transferring some
`Buffer` objects that were created from C++ to a parent thread.

Fixes: nodejs#34126
MylesBorins pushed a commit that referenced this issue Jul 14, 2020
Add a test for a regression that occurs when transferring some
`Buffer` objects that were created from C++ to a parent thread.

Fixes: #34126

PR-URL: #34140
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
MylesBorins pushed a commit that referenced this issue Jul 16, 2020
Add a test for a regression that occurs when transferring some
`Buffer` objects that were created from C++ to a parent thread.

Fixes: #34126

PR-URL: #34140
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
addaleax added a commit that referenced this issue Sep 22, 2020
Add a test for a regression that occurs when transferring some
`Buffer` objects that were created from C++ to a parent thread.

Fixes: #34126

PR-URL: #34140
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants