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 — buffer: FreeCallback should be tied to ArrayBuffer by indutny · Pull Request #3198 · nodejs/node

Conversation

@indutny

@indutny indutny commented Oct 6, 2015

Copy link
Copy Markdown
Member

FreeCallback should be invoked on the storage disposal (ArrayBuffer),
not when the view (Uint8Array or Buffer) is disposed. This causes
bug and crashes in addons which create buffers and store only slices of
them.

cc @trevnorris @bnoordhuis @nodejs/collaborators

Sorry, something went wrong.

Uh oh!

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

All reactions
@indutny

indutny commented Oct 6, 2015

Copy link
Copy Markdown
Member Author

@bnoordhuis I wonder if it may be a good opportunity to write our first C++ test.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fishrock123 Fishrock123 added the buffer Issues and PRs related to the buffer subsystem. label Oct 6, 2015
@indutny
indutny force-pushed the fix/buffer-wrong-free-callback-handle branch from 21c3543 to 1ce1e17 Compare October 6, 2015 04:30
@indutny

indutny commented Oct 6, 2015

Copy link
Copy Markdown
Member Author

Nah, gtest didn't work out. It was simpler to just write an test addon.

All reactions

Sorry, something went wrong.

Uh oh!

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

trevnorris
trevnorris reviewed Oct 6, 2015
View reviewed changes
Comment thread test/addons/buffer-free-callback/binding.cc Outdated

@trevnorris trevnorris Oct 6, 2015

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Out of curiosity, is it viable to use a technique similar to https://groups.google.com/d/msg/v8-users/JmhzmswiqvM/IC6UtV5FEC4J so that --expose-gc doesn't have to be passed?

Sorry, something went wrong.

Uh oh!

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

All reactions

@indutny indutny Oct 6, 2015

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

idk, seems to be a legit use of RequestGC here

Sorry, something went wrong.

Uh oh!

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

All reactions
@trevnorris

trevnorris commented Oct 6, 2015

Copy link
Copy Markdown
Contributor

LGTM. Does CI run these tests?

All reactions

Sorry, something went wrong.

Uh oh!

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

bnoordhuis
bnoordhuis reviewed Oct 6, 2015
View reviewed changes
Comment thread test/addons/buffer-free-callback/binding.cc Outdated

@bnoordhuis bnoordhuis Oct 6, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can I suggest you make this a counter and check that it's > 0 in FreeCallback?

Sorry, something went wrong.

Uh oh!

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

All reactions

@indutny indutny Oct 6, 2015

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sure.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bnoordhuis

bnoordhuis commented Oct 6, 2015

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

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

@indutny
buffer: FreeCallback should be tied to ArrayBuffer
9d4063e
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`),
not when the view (`Uint8Array` or `Buffer`) is disposed. This causes
bug and crashes in addons which create buffers and store only slices of
them.

PR-URL: nodejs#3198
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
@indutny
indutny force-pushed the fix/buffer-wrong-free-callback-handle branch from 1ce1e17 to 9d4063e Compare October 6, 2015 17:37
@indutny

indutny commented Oct 6, 2015

Copy link
Copy Markdown
Member Author

All fixed and rebased. Running CI.

All reactions

Sorry, something went wrong.

Uh oh!

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

@indutny

indutny commented Oct 6, 2015

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@indutny

indutny commented Oct 6, 2015

Copy link
Copy Markdown
Member Author

Landed in d1f2404, please backport to v4.x

All reactions

Sorry, something went wrong.

Uh oh!

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

indutny added a commit that referenced this pull request Oct 6, 2015
@indutny
buffer: FreeCallback should be tied to ArrayBuffer
d1f2404
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`),
not when the view (`Uint8Array` or `Buffer`) is disposed. This causes
bug and crashes in addons which create buffers and store only slices of
them.

PR-URL: #3198
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
@indutny indutny added the land-on-v4.x label Oct 6, 2015
@indutny indutny closed this Oct 6, 2015
@indutny
indutny deleted the fix/buffer-wrong-free-callback-handle branch October 6, 2015 22:58
@jasnell jasnell mentioned this pull request Oct 8, 2015
Preparing v4.x for LTS #3252
Closed
29 tasks done
indutny added a commit that referenced this pull request Oct 8, 2015
@indutny @jasnell
buffer: FreeCallback should be tied to ArrayBuffer
660f759
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`),
not when the view (`Uint8Array` or `Buffer`) is disposed. This causes
bug and crashes in addons which create buffers and store only slices of
them.

PR-URL: #3198
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
@jasnell jasnell added the lts-landed-on-v4.x label Oct 8, 2015
@jasnell jasnell mentioned this pull request Oct 8, 2015
Release proposal: v4.2.0 'Argon' (LTS) #3258
Closed
@MylesBorins

MylesBorins commented Nov 17, 2015

Copy link
Copy Markdown
Contributor

landed in v4.x-staging in 660f759

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins MylesBorins removed the land-on-v4.x label Nov 17, 2015
This was referenced Nov 30, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#326
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#328
Open
This was referenced Nov 30, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#888
Open
[Snyk] Fix for 2 vulnerabilities aliscco/alisco-node#892
Open
This was referenced Nov 30, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#334
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#340
Open
This was referenced Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#978
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#985
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#992
Open
This was referenced Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#398
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#414
Open
This was referenced Dec 2, 2023
[Snyk] Fix for 2 vulnerabilities aliscco/alisco-node#1006
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1011
Open
[Snyk] Fix for 2 vulnerabilities aliscco/alisco-node#1014
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1016
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1017
Open
@leonardoadame leonardoadame mentioned this pull request Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#430
Open
This was referenced Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1029
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1042
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1043
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1047
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1052
Open
This was referenced Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#449
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#454
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#456
Open
@aliscco aliscco mentioned this pull request Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1060
Open
@leonardoadame leonardoadame mentioned this pull request Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#461
Open
This was referenced Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1063
Open
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1064
Open
@leonardoadame leonardoadame mentioned this pull request Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#469
Open
@aliscco aliscco mentioned this pull request Dec 2, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1073
Open
This was referenced Dec 3, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#476
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#494
Open
@aliscco aliscco mentioned this pull request Dec 3, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1091
Open
This was referenced Dec 4, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#524
Open
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#546
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

buffer Issues and PRs related to the buffer 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.

6 participants

@indutny @trevnorris @bnoordhuis @MylesBorins @jasnell @Fishrock123
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.