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

os,contextify: fix segfaults and CHECK failure #12371

Closed
wants to merge 3 commits into from

Conversation

tniessen
Copy link
Member

@tniessen tniessen commented Apr 12, 2017

Fixes multiple possible segmentation faults in node_contextify.cc and an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

os, vm, contextify

Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: nodejs#12369
Fixes: nodejs#12370
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. os Issues and PRs related to the os subsystem. vm Issues and PRs related to the vm subsystem. labels Apr 12, 2017
@Trott
Copy link
Member

Trott commented Apr 12, 2017

Request: Add a test?

Local<Value> value = options.As<Object>()->Get(key);
return value->IsTrue();
MaybeLocal<Value> maybeValue =
options.As<Object>()->Get(env->context(), key);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe maybe_value? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node_contextify.cc is pretty inconsistent about this, even within functions 😞 By the way, why don't we have linting for variable names?

If you prefer, I will change it :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, why don't we have linting for variable names?

I guess it’s mostly because there are only a handful of people contributing to the C++ sources on a regular basis, so adding linter rules comes with a disproportionate overhead when compared to e.g. the JS sources…

If you prefer, I will change it :)

I don’t care much personally, but I’d bet @bnoordhuis is going to request it. 😄

MaybeLocal<Value> maybeValue =
options.As<Object>()->Get(env->context(),
env->produce_cached_data_string());
if (maybeValue.IsEmpty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ditto everywhere, you may want to search+replace for maybeValue)

@tniessen
Copy link
Member Author

@Trott Thank you, done.

@addaleax
Copy link
Member

@tniessen
Copy link
Member Author

Thanks Anna, CI is green 😃

@addaleax
Copy link
Member

Thanks, landed in 88aab45.

I noticed while landing that the commit message had the subsystem contextify, which belongs to the vm module and therefore has gotten that label (at least the last few times it was touched), so I changed that. :)

@addaleax addaleax closed this Apr 14, 2017
addaleax pushed a commit that referenced this pull request Apr 14, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370
PR-URL: #12371
Reviewed-By: Anna Henningsen <[email protected]>
evanlucas pushed a commit that referenced this pull request Apr 25, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370
PR-URL: #12371
Reviewed-By: Anna Henningsen <[email protected]>
@evanlucas evanlucas mentioned this pull request May 1, 2017
evanlucas pushed a commit that referenced this pull request May 1, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370
PR-URL: #12371
Reviewed-By: Anna Henningsen <[email protected]>
evanlucas pushed a commit that referenced this pull request May 2, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370
PR-URL: #12371
Reviewed-By: Anna Henningsen <[email protected]>
@MylesBorins
Copy link
Contributor

Should this land on v6.x??? It isn't landing cleanly and will require a manual backport if so

@tniessen
Copy link
Member Author

That's up to you folks, I think bug fixes should be welcome in LTS versions, but this is not an urgent fix. I don't know how much more work it would take, I would be happy to help though (if I can). If you decide that inclusion in v6.x is not worth the additional efforts, that's fine by me.

@gibfahn
Copy link
Member

gibfahn commented Jun 18, 2017

If you're willing to backport to v6.x-staging please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

tniessen added a commit to tniessen/node that referenced this pull request Jun 22, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: nodejs#12369
Fixes: nodejs#12370
PR-URL: nodejs#12371
Reviewed-By: Anna Henningsen <[email protected]>
@tniessen
Copy link
Member Author

@gibfahn #13871

MylesBorins pushed a commit that referenced this pull request Jul 10, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370
Backport-PR-URL: #13871
PR-URL: #12371
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc

Fixes: #12369
Fixes: #12370
Backport-PR-URL: #13871
PR-URL: #12371
Reviewed-By: Anna Henningsen <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
@tniessen tniessen mentioned this pull request Jan 2, 2018
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. os Issues and PRs related to the os subsystem. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

os.userInfo can cause segmentation fault Multiple segmentation faults in contextify when parsing options
6 participants