src: fix permission inspector crash#53389
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Jun 10, 2024
Merged
Conversation
9e5e24a to
7573b6b
Compare
anonrig
approved these changes
Jun 8, 2024
Member
|
cc @eugeneo |
Collaborator
RafaelGSS
approved these changes
Jun 9, 2024
eugeneo
approved these changes
Jun 9, 2024
Contributor
|
Interesting. I see a crash locally (but I did not debug it):
```
$ node --experimental-permission --inspect-brk --eval "console.log('Hi')"
Segmentation fault
```
I wonder if this is the same or a different issue.
…On Sat, Jun 8, 2024 at 8:50 PM theanarkh ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/parallel/test-permission-inspector-brk.js
<#53389 (comment)>:
> +const common = require('../common');
+const assert = require('assert');
+const { spawnSync } = require('child_process');
+const fixtures = require('../common/fixtures');
+const file = fixtures.path('permission', 'inspector-brk.js');
+
+common.skipIfWorker();
+common.skipIfInspectorDisabled();
+
+const { status, stderr } = spawnSync(
+ process.execPath,
+ [
+ '--experimental-permission',
+ '--allow-fs-read=*',
+ '--inspect-brk',
+ file,
It seems the process does not crash when using --eval because the crash
is caused by this
<https://github.com/nodejs/node/blob/main/lib/internal/modules/cjs/loader.js#L1425>
code.
—
Reply to this email directly, view it on GitHub
<#53389 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACGJLJPMQ4N4X2XFELQLS3ZGPGHBAVCNFSM6AAAAABJAF5ZIWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMBWGA3DCNJZHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Contributor
Author
|
I will add permission check in node_contextify.cc to fix this(Node.js will run into EvaluateMachine of node_contextify.cc when setting --eval flag). |
MoLow
reviewed
Jun 9, 2024
MoLow
approved these changes
Jun 9, 2024
4a8cf55 to
ac0f283
Compare
ac0f283 to
5fee021
Compare
cola119
approved these changes
Jun 10, 2024
Collaborator
Collaborator
Collaborator
Collaborator
|
Landed in 430c026 |
eliphazbouye
pushed a commit
to eliphazbouye/node
that referenced
this pull request
Jun 20, 2024
PR-URL: nodejs#53389 Fixes: nodejs#53385 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
bmeck
pushed a commit
to bmeck/node
that referenced
this pull request
Jun 22, 2024
PR-URL: nodejs#53389 Fixes: nodejs#53385 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #53385
make -j4 test(UNIX), orvcbuild test(Windows) passes