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

don't call os.NewFile on unknown FDs #24562

Merged
merged 1 commit into from
Apr 6, 2020
Merged

don't call os.NewFile on unknown FDs #24562

merged 1 commit into from
Apr 6, 2020

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Apr 4, 2020

os.NewFile was called on file descriptors 3, 4, and 5 during every init,
in case this process happened to be running inside panicwrap. If the
runtime has already chosen one of these file descriptors to use
internally, starting polling on them can cause the runtime to crash.

Initialize the file descriptors lazily, only if we know that they belong
to us, after Wrapped is checked.

Fixes #24287

os.NewFile was called on file descriptors 3, 4, and 5 during every init,
in case this process happened to be running inside panicwrap. If the
runtime has already chosen one of these file descriptors to use
internally, starting polling on them can cause the runtime to crash.

Initialize the file descriptors lazily, only if we know that they belong
to us, after Wrapped is checked.
@jbardin jbardin requested a review from a team April 4, 2020 19:53
@ghost ghost added the sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK label Apr 4, 2020
@codecov
Copy link

codecov bot commented Apr 4, 2020

Codecov Report

Merging #24562 into master will increase coverage by 0.01%.
The diff coverage is 88.54%.

Impacted Files Coverage Δ
terraform/graph_builder_eval.go 0.00% <0.00%> (ø)
terraform/graph_builder_refresh.go 100.00% <ø> (ø)
terraform/node_resource_destroy.go 76.59% <ø> (-2.11%) ⬇️
terraform/transform_orphan_resource.go 79.31% <ø> (-3.51%) ⬇️
terraform/transform_provider.go 80.19% <ø> (-0.25%) ⬇️
terraform/node_local.go 66.03% <50.00%> (-1.31%) ⬇️
terraform/node_module_variable.go 72.52% <50.00%> (-1.04%) ⬇️
terraform/node_output.go 66.08% <50.00%> (-0.58%) ⬇️
terraform/node_module_expand.go 85.54% <84.61%> (-0.83%) ⬇️
terraform/node_resource_apply.go 83.33% <87.50%> (+1.51%) ⬆️
... and 15 more

@jbardin jbardin merged commit 6da8542 into master Apr 6, 2020
@jbardin jbardin deleted the jbardin/panicwrapped branch April 6, 2020 13:14
@ghost
Copy link

ghost commented May 7, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash on macOS Mojave with go1.14
2 participants