GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vm: properly support symbols on globals by dubzzz · Pull Request #46458 · nodejs/node

Conversation

@dubzzz

@dubzzz dubzzz commented Feb 1, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

A regression has been introduced in node 18.2.0, it lakes the following snippet fails while it used to work in the past:

const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
  enumerable: true,
  writable: true,
  value: 4,
  configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));

The PR that introduced the regression is: #42963. So I basically attempted to start understanding what it changed to make it still fix the initial issue while not breaking the symbol related one.

Fixes: #45983

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem. labels Feb 1, 2023
@dubzzz dubzzz mentioned this pull request Feb 1, 2023
src: always signal V8 for intercepted properties #42963
Merged
aduh95
aduh95 approved these changes Feb 1, 2023
View reviewed changes
@dubzzz

dubzzz commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

I'll rework the commit message to fit the guidelines. Do I need to change the commit in-place and force push or can I push an extra commit on top of it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Feb 1, 2023

Copy link
Copy Markdown
Contributor

I'll rework the commit message to fit the guidelines. Do I need to change the commit in-place and force push or can I push an extra commit on top of it?

Force pushing is the only way in this instance, as we typically squash all the commits in the PR into the first one.

dubzzz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz

This comment was marked as outdated.

Sign in to view
@dubzzz
vm: properly support symbols on globals
0599236
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:

```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
  enumerable: true,
  writable: true,
  value: 4,
  configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```

Regression introduced by: nodejs#42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.

Fixes: nodejs#45983
@dubzzz
dubzzz force-pushed the fix-global-access-issue branch from 70596ac to 0599236 Compare February 1, 2023 09:47
@dubzzz

dubzzz commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

Normally everything should be good now. As suggested by @aduh95, I force-pushed on my original commit to fix the commit message. Only changes made since the original commit (before force-push) are: edit commit message and fix lint on the new test file.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Feb 1, 2023

Copy link
Copy Markdown
Contributor

This PR makes test/parallel/test-repl-underscore fail:

=== release test-repl-underscore ===
Path: parallel/test-repl-underscore
Error: --- stderr ---
node:assert:124
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  [
    "'baz'",
    'Expression assignment to _error now disabled.',
+   'Uncaught TypeError: Cannot redefine property: _error',
-   '0',
    'Uncaught Error: quux',
    '0'
  ]
    at assertOutput (/Users/runner/work/node/node/test/parallel/test-repl-underscore.js:246:10)
    at Immediate._onImmediate (/Users/runner/work/node/node/test/parallel/test-repl-underscore.js:214:5)
    at process.processImmediate (node:internal/timers:475:21)
    at process.topLevelDomainCallback (node:domain:161:15)
    at process.callbackTrampoline (node:internal/async_hooks:128:24) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: [
    "'baz'",
    'Expression assignment to _error now disabled.',
    'Uncaught TypeError: Cannot redefine property: _error',
    'Uncaught Error: quux',
    '0'
  ],
  expected: [
    "'baz'",
    'Expression assignment to _error now disabled.',
    '0',
    'Uncaught Error: quux',
    '0'
  ],
  operator: 'deepStrictEqual'
}

Node.js v20.0.0-pre
Command: out/Release/node /Users/runner/work/node/node/test/parallel/test-repl-underscore.js

===
=== 1 tests failed
===

Failed tests:
out/Release/node /Users/runner/work/node/node/test/parallel/test-repl-underscore.js
dubzzz reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Feb 1, 2023
View reviewed changes
Comment thread test/parallel/test-vm-global-symbol.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz

dubzzz commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

This PR makes test/parallel/test-repl-underscore fail

I'll rework it to make sure this test passes too. I may have missed one condition in the code I added.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz
Adding missing is_contextual_store||check
020bc92
@aduh95

aduh95 commented Feb 1, 2023

Copy link
Copy Markdown
Contributor

Can you get rid of the merge commit please? It tends to break our tooling. (git reset 020bc92a500df7e8e48b632aed011a06cac0f169 --hard && git cherry-pick dda9dc3c9a30fdc91e30d7f754191114fac94b9f && git push -f should do the trick).

dubzzz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz

dubzzz commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

Yes definitely I will

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz @aduh95
Update test/parallel/test-vm-global-symbol.js
b24cd68
Co-authored-by: Antoine du Hamel <[email protected]>
@dubzzz
dubzzz force-pushed the fix-global-access-issue branch from 5d5ad4c to b24cd68 Compare February 1, 2023 22:52
@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Feb 2, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Feb 2, 2023
@nodejs-github-bot

nodejs-github-bot commented Feb 2, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/49303/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz

dubzzz commented Feb 2, 2023

Copy link
Copy Markdown
Contributor Author

Not sure to get the reason of the remaining failures 🤔 I started to check on jenkins side but I don't exactly get the reason of the failure and the link to the current change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Feb 2, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/49315/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Feb 3, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/49343/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz

dubzzz commented Feb 3, 2023

Copy link
Copy Markdown
Contributor Author

@aduh95 Not sure what to do for the nodejs-github-bot failures, I don't get exactly what is failing 🤯

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Feb 3, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/49351/

dubzzz reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos
targos approved these changes Feb 4, 2023
View reviewed changes
@aduh95

aduh95 commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

Not sure what to do for the nodejs-github-bot failures, I don't get exactly what is failing 🤯

Unfortunately sometimes the CI reports unrelated CI failures (either because the test is flaky, or because of a hardware/infra failure). Restarting the CI did not trigger the same issue twice, so it's fair to assume it was indeed unrelated :)

dubzzz reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Feb 4, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Feb 4, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 6bbc2fb into nodejs:main Feb 4, 2023
@nodejs-github-bot

nodejs-github-bot commented Feb 4, 2023

Copy link
Copy Markdown
Collaborator

Landed in 6bbc2fb

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz

dubzzz commented Feb 4, 2023

Copy link
Copy Markdown
Contributor Author

As it fixes an issue in node 18, any way to put it in the next release of node 18 too?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

As it fixes an issue in node 18, any way to put it in the next release of node 18 too?

Before landing on Node.js 18.x, it will need to be released on Node.js 19.x for at least 2 weeks. The backport should be done by a releaser without any action from you after that, or if a manual backport is needed, they'll add a comment here.

node/doc/contributing/backporting-to-release-lines.md

Lines 19 to 25 in a0440c9

## What can be backported?
The "Current" release line is much more lenient than the LTS release lines in
what can be landed. Our LTS release lines (see the [Release Plan][])
require that commits mature in the Current release for at least 2 weeks before
they can be landed in an LTS staging branch. Only after "maturation" will those
commits be cherry-picked or backported.

dubzzz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz dubzzz mentioned this pull request Feb 4, 2023
[Bug]: Object.getOwnPropertySymbols() does not work against global instance with jest+node18 jestjs/jest#13338
Closed
This was referenced Feb 5, 2023
CI Reliability 2023-02-05 nodejs/reliability#495
Open
CI Reliability 2023-02-06 nodejs/reliability#497
Open
@dubzzz

dubzzz commented Feb 6, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

For the record, as some other regressions have been reported following #42963 (the original PR, I patched with this one), I'm trying to cover all of them via dedicated tests and possibly adapt again the proposed option (by adding comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dubzzz dubzzz mentioned this pull request Feb 11, 2023
vm: properly handle defining props on any value #46615
Merged
33 of 40 tasks
@dubzzz

dubzzz commented Feb 11, 2023

Copy link
Copy Markdown
Contributor Author

I opened a follow-up PR that should fix the previously reported issues linked to 18.2.0 and 18.0.0. See #46615

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MylesBorins pushed a commit that referenced this pull request Feb 18, 2023
@dubzzz @MylesBorins
vm: properly support symbols on globals
17b3ee3
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:

```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
  enumerable: true,
  writable: true,
  value: 4,
  configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```

Regression introduced by: #42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.

Fixes: #45983
PR-URL: #46458
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 19, 2023
v19.7.0 proposal #46725
Merged
dubzzz added a commit to dubzzz/node that referenced this pull request Mar 9, 2023
@dubzzz
vm: properly handle defining props on any value
b636069
While it was supposed to fix most of the remaining issues,
nodejs#46458 missed some in strict mode.

This PR adds some additional checks. It also clarifies what we are
really checking to execute or not the `GetReturnValue`.
nodejs-github-bot pushed a commit that referenced this pull request Mar 18, 2023
@dubzzz
vm: properly handle defining props on any value
aa6e9c8
While it was supposed to fix most of the remaining issues,
#46458 missed some in strict mode.

This PR adds some additional checks. It also clarifies what we are
really checking to execute or not the `GetReturnValue`.

PR-URL: #46615
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Mar 18, 2023
@dubzzz @targos
vm: properly handle defining props on any value
9537672
While it was supposed to fix most of the remaining issues,
#46458 missed some in strict mode.

This PR adds some additional checks. It also clarifies what we are
really checking to execute or not the `GetReturnValue`.

PR-URL: #46615
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
danielleadams pushed a commit that referenced this pull request Apr 11, 2023
@dubzzz @danielleadams
vm: properly support symbols on globals
b801873
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:

```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
  enumerable: true,
  writable: true,
  value: 4,
  configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```

Regression introduced by: #42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.

Fixes: #45983
PR-URL: #46458
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@danielleadams danielleadams mentioned this pull request Apr 11, 2023
v18.16.0 release proposal #47502
Merged
MylesBorins pushed a commit that referenced this pull request Jun 23, 2023
@dubzzz @MylesBorins
vm: properly handle defining props on any value
fb90b6b
While it was supposed to fix most of the remaining issues,
#46458 missed some in strict mode.

This PR adds some additional checks. It also clarifies what we are
really checking to execute or not the `GetReturnValue`.

PR-URL: #46615
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aduh95 aduh95 aduh95 approved these changes
+1 more reviewer
@targos targos targos approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

vm module regression in node 18.2.0: failing to list properties of an object

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@dubzzz @aduh95 @nodejs-github-bot @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.