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 — [v8.x] src: fix fs.write() externalized string handling by addaleax · Pull Request #22731 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Sep 6, 2018

Copy link
Copy Markdown
Member

Backport #18216

The merge conflicts in node_file.cc were non-trivial, so the changes there deserve to be treated like original content during review.

Sorry, something went wrong.

Uh oh!

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

All reactions
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. v8.x labels Sep 6, 2018
@addaleax addaleax mentioned this pull request Sep 6, 2018
src: fix fs.write() externalized string handling #18216
Merged
@nodejs-github-bot

nodejs-github-bot commented Sep 6, 2018

Copy link
Copy Markdown
Collaborator

@addaleax build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/817/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

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

@addaleax addaleax mentioned this pull request Sep 6, 2018
Large strings decoded from latin1 and then encoded to utf8 has wrong size #22728
Closed
@addaleax

addaleax commented Sep 6, 2018

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins

MylesBorins commented Sep 6, 2018

Copy link
Copy Markdown
Contributor

@addaleax should this be included in the 8.12.0 release or is it ok to wait until 8.12.1?

All reactions

Sorry, something went wrong.

Uh oh!

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

@jasnell

jasnell commented Sep 6, 2018

Copy link
Copy Markdown
Member

@addaleax ... would it make sense to add a new test similar to the example case in #22728? Or are the test modifications made here already sufficient?

All reactions

Sorry, something went wrong.

Uh oh!

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

@addaleax

addaleax commented Sep 6, 2018

Copy link
Copy Markdown
Member Author

@MylesBorins It’s hard to tell – I’d be in favour of including it. It’s been in master for long enough to be sure that this doesn’t break anything, I’d say?

@jasnell The tests added here do check the broken code path in string_bytes.cc that #22728 also triggers. How about adding a test similar to that in a separate PR against master?

All reactions

Sorry, something went wrong.

Uh oh!

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

@jasnell

jasnell commented Sep 6, 2018

Copy link
Copy Markdown
Member

How about adding a test similar to that in a separate PR against master?

As long as there is appropriate coverage for this particular piece then it should be fine.

All reactions

Sorry, something went wrong.

Uh oh!

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

jasnell
jasnell approved these changes Sep 6, 2018
View reviewed changes
mihalskiy
mihalskiy approved these changes Sep 6, 2018
View reviewed changes
@trivikr

trivikr commented Sep 15, 2018

Copy link
Copy Markdown
Member

Resume build: https://ci.nodejs.org/job/node-test-pull-request/17206/

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins

MylesBorins commented Sep 25, 2018

Copy link
Copy Markdown
Contributor

one more ci: https://ci.nodejs.org/job/node-test-pull-request/17439/

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins

MylesBorins commented Sep 26, 2018

Copy link
Copy Markdown
Contributor

This PR seems to be making windows completely fail, any idea what's up?

All reactions

Sorry, something went wrong.

Uh oh!

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

@richardlau

richardlau commented Sep 26, 2018

Copy link
Copy Markdown
Member

It's some sort of compilation failure,

e.g. https://ci.nodejs.org/job/node-compile-windows/21107/label=win-vs2015/console

17:21:30 src\string_bytes.cc(341): error C2589: '(': illegal token on right side of '::' [c:\workspace\node-compile-windows\node_lib.vcxproj]
17:21:30 src\string_bytes.cc(341): error C2059: syntax error: '::' [c:\workspace\node-compile-windows\node_lib.vcxproj]
All reactions

Sorry, something went wrong.

Uh oh!

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

@richardlau

richardlau commented Sep 26, 2018

Copy link
Copy Markdown
Member

src\string_bytes.cc(341):
https://github.com/nodejs/node/blob/ed7b009709bf0156ab2cde9c1ce98c777df72250/src/string_bytes.cc#L341

Among the search results for C2589 is https://stackoverflow.com/questions/5004858/stdmin-gives-error
which suggests we need to define NOMINMAX, which looks like the original PR (#18216) did in 0b1841d.

MylesBorins 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.

@joyeecheung joyeecheung mentioned this pull request Sep 26, 2018
Investigate flaky addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary on FreeBSD 11 #22317
Closed
@BethGriggs

BethGriggs commented Oct 2, 2018

Copy link
Copy Markdown
Member

@addaleax are you able to take a look? Thanks

All reactions

Sorry, something went wrong.

Uh oh!

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

bnoordhuis added 2 commits October 2, 2018 08:37
@bnoordhuis @addaleax
build: define NOMINMAX on windows
89d092e
Build with `-DNOMINMAX` to stop `<windows.h>` from defining macros that
conflict with `std::min()` and `std::max()`.

PR-URL: nodejs#18216
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@bnoordhuis @addaleax
src: fix fs.write() externalized string handling
590aa1f
* Respect `encoding` argument when the string is externalized.

* Copy the string when the write request can outlive the externalized
  string.

This commit removes `StringBytes::GetExternalParts()` because it is
fundamentally broken.

Fixes: nodejs#18146
Fixes: nodejs#22728
PR-URL: nodejs#18216
@addaleax
addaleax force-pushed the backport-18216 branch from ed7b009 to 590aa1f Compare October 2, 2018 15:39
@addaleax

addaleax commented Oct 2, 2018

Copy link
Copy Markdown
Member Author

@BethGriggs Thanks for the ping!

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

All reactions

Sorry, something went wrong.

Uh oh!

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

BethGriggs pushed a commit that referenced this pull request Oct 16, 2018
@bnoordhuis @BethGriggs
build: define NOMINMAX on windows
ca8d4e3
Build with `-DNOMINMAX` to stop `<windows.h>` from defining macros that
conflict with `std::min()` and `std::max()`.

Backport-PR-URL: #22731
PR-URL: #18216
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>

PR-URL: #22731
BethGriggs pushed a commit that referenced this pull request Oct 16, 2018
@bnoordhuis @BethGriggs
src: fix fs.write() externalized string handling
b67bf38
* Respect `encoding` argument when the string is externalized.

* Copy the string when the write request can outlive the externalized
  string.

This commit removes `StringBytes::GetExternalParts()` because it is
fundamentally broken.

Fixes: #18146
Fixes: #22728
Backport-PR-URL: #22731
PR-URL: #18216

Reviewed-By: James M Snell <[email protected]>
@BethGriggs

BethGriggs commented Oct 16, 2018

Copy link
Copy Markdown
Member

Landed in v8.x-staging 48f31bd...b67bf38

All reactions

Sorry, something went wrong.

Uh oh!

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

@BethGriggs BethGriggs closed this Oct 16, 2018
@BethGriggs BethGriggs mentioned this pull request Oct 30, 2018
v8.13.0 proposal #23974
Merged
@beevelop beevelop mentioned this pull request Nov 20, 2018
2018-11-20 Version 8.13.0 'Carbon' (LTS) @MylesBorins prepared by @BethGriggs beevelop/docker-android-nodejs#250
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
+1 more reviewer
@mihalskiy mihalskiy mihalskiy 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++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories.

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.

9 participants

@addaleax @nodejs-github-bot @MylesBorins @jasnell @trivikr @richardlau @BethGriggs @mihalskiy @bnoordhuis
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 01402775 — 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.