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 — src: do not call path.back() when it is empty by zcbenz · Pull Request #55072 · nodejs/node

Conversation

@zcbenz

@zcbenz zcbenz commented Sep 23, 2024

Copy link
Copy Markdown
Contributor

Fix a crash when running tests with the GN build of node:

../out/Debug/node test/parallel/test-cli-permission-multiple-allow.js

Crash trace:

$ lldb ../out/Debug/node
(lldb) target create "../out/Debug/node"
Current executable set to '/Users/zcbenz/codes/node_with_gn/out/Debug/node' (arm64).
(lldb) run --experimental-permission --allow-fs-write /Users/zcbenz/codes/node_with_gn/node/tmp --allow-fs-write /Users/zcbenz/codes/node_with_gn/node/other-path -e 'console.log(process.permission.has("fs.write"));'
Process 28010 launched: '/Users/zcbenz/codes/node_with_gn/out/Debug/node' (arm64)
../../third_party/gn/third_party/libc++/src/include/string:1364: assertion !empty() failed: string::back(): string is empty
Process 28010 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000018b88e0dc libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
->  0x18b88e0dc <+8>:  b.lo   0x18b88e0fc               ; <+40>
    0x18b88e0e0 <+12>: pacibsp 
    0x18b88e0e4 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x18b88e0e8 <+20>: mov    x29, sp
Target 0: (node) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x000000018b88e0dc libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x000000018b8c5cc0 libsystem_pthread.dylib`pthread_kill + 288
    frame #2: 0x000000018b7d1a40 libsystem_c.dylib`abort + 180
    frame #3: 0x0000000103ddb5bc node`std::__Cr::__libcpp_verbose_abort(format="%s") at verbose_abort.cpp:74:3
    frame #4: 0x00000001004f0ef8 node`std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>::back(this="") const at string:1364:5
    frame #5: 0x000000010070bfd4 node`node::PathResolve(env=0x0000000134898a00, paths=size=1) at path.cc:269:55
    frame #6: 0x000000010070cd0c node`(anonymous namespace)::is_tree_granted(env=0x0000000134898a00, granted_tree=0x00006000006b44e8, param="") at fs_permission.cc:58:32
    frame #7: 0x000000010070cc2c node`node::permission::FSPermission::is_granted(this=0x00006000006b44d8, env=0x0000000134898a00, perm=kFileSystemWrite, param="") const at fs_permission.cc:168:15
    frame #8: 0x00000001000e0d10 node`node::permission::Permission::is_scope_granted(this=0x0000000134898f78, env=0x0000000134898a00, permission=kFileSystemWrite, res="") const at permission.h:83:33
    frame #9: 0x0000000100714878 node`node::permission::(anonymous namespace)::Has(v8::FunctionCallbackInfo<v8::Value> const&) [inlined] node::permission::Permission::is_granted(this=0x0000000134898f78, env=0x0000000134898a00, permission=kFileSystemWrite, res="") const at permission.h:56:12
    frame #10: 0x0000000100714844 node`node::permission::(anonymous namespace)::Has(args=0x000000016fdfa658) at permission.cc:58:55

Crash was introduced by #54224.

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
@zcbenz
src: do not call path.back() when it is empty
9edbef8
@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. labels Sep 23, 2024
@zcbenz zcbenz added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 23, 2024
@avivkeller avivkeller added the path Issues and PRs related to the path subsystem. label Sep 23, 2024
@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 Sep 23, 2024
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@codecov

codecov Bot commented Sep 23, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.23%. Comparing base (4f88179) to head (9edbef8).
Report is 123 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55072      +/-   ##
==========================================
- Coverage   88.23%   88.23%   -0.01%     
==========================================
  Files         652      652              
  Lines      183920   183920              
  Branches    35863    35868       +5     
==========================================
- Hits       162286   162280       -6     
+ Misses      14913    14912       -1     
- Partials     6721     6728       +7     
Files with missing lines Coverage Δ
src/path.cc 67.39% <100.00%> (ø)

... and 21 files with indirect coverage changes

All reactions

Sorry, something went wrong.

Uh oh!

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

lpinca
lpinca approved these changes Sep 23, 2024
View reviewed changes
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 23, 2024
@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 Sep 23, 2024
@nodejs-github-bot

nodejs-github-bot commented Sep 23, 2024

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos

targos commented Sep 23, 2024

Copy link
Copy Markdown
Member

Could we add a regression test?

All reactions

Sorry, something went wrong.

Uh oh!

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

aymen94
aymen94 approved these changes Sep 23, 2024
View reviewed changes
@zcbenz

zcbenz commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

Could we add a regression test?

The crash only happens when building with a newer version of libc++ that asserts on calling back() on an empty string, for the official build I don't see a way to test this.

All reactions

Sorry, something went wrong.

Uh oh!

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

anonrig
anonrig approved these changes Sep 23, 2024
View reviewed changes
@aduh95 aduh95 added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 24, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 25, 2024
@nodejs-github-bot
nodejs-github-bot merged commit 773e7c6 into nodejs:main Sep 25, 2024
@nodejs-github-bot

nodejs-github-bot commented Sep 25, 2024

Copy link
Copy Markdown
Collaborator

Landed in 773e7c6

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos targos added dont-land-on-v18.x dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Oct 4, 2024
@aduh95 aduh95 mentioned this pull request Oct 14, 2024
2024-10-16, Version 23.0.0 (Current) #55338
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lpinca lpinca lpinca approved these changes
@anonrig anonrig anonrig approved these changes
+1 more reviewer
@aymen94 aymen94 aymen94 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

c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

8 participants

@zcbenz @nodejs-github-bot @targos @lpinca @anonrig @aymen94 @aduh95 @avivkeller
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.