Skip to content

[v12.x] src: move CHECK in AddIsolateFinishedCallback - #38010

Closed
indutny wants to merge 1 commit into
nodejs:v12.xfrom
indutny:fix/electron-worker-threads-crash
Closed

[v12.x] src: move CHECK in AddIsolateFinishedCallback#38010
indutny wants to merge 1 commit into
nodejs:v12.xfrom
indutny:fix/electron-worker-threads-crash

Conversation

@indutny

@indutnyindutny commented Mar 31, 2021

Copy link
Copy Markdown
Member

CHECK(it->second) asserts that we have PerIsolatePlatformData
in the per_isolate_ map, and not just a key with empty value. When
it == per_isolate_.end(), however, it means that we don't have the
isolate and the CHECK(it->second) is guaranteed to fail then!

@indutny
indutny requested a review from addaleaxMarch 31, 2021 20:33
@nodejs-github-botnodejs-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. v12.x labels Mar 31, 2021
@indutny
indutnyforce-pushed the fix/electron-worker-threads-crash branch from b964433 to d248ed3CompareMarch 31, 2021 21:06
Comment threadsrc/env.cc Outdated
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData`
in the `per_isolate_` map, and not just a key with empty value. When
`it == per_isolate_.end()`, however, it means that we don't have the
isolate and the `CHECK(it->second)` is guaranteed to fail then!
@indutny
indutnyforce-pushed the fix/electron-worker-threads-crash branch from d248ed3 to ad7f207CompareMarch 31, 2021 21:57
@indutnyindutny changed the title env: fix use-after-free in keep-alive allocatorssrc: move CHECK in AddIsolateFinishedCallbackMar 31, 2021
@indutny

Copy link
Copy Markdown
MemberAuthor

Thank you @addaleax !

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jasnelljasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 28, 2021
@jasnelljasnell changed the title src: move CHECK in AddIsolateFinishedCallback[v12.x] src: move CHECK in AddIsolateFinishedCallbackApr 30, 2021
@jasnell

Copy link
Copy Markdown
Member

This is ready to go for the next v12.x release but can't land in the staging branch yet.

richardlau pushed a commit that referenced this pull request Jul 23, 2021
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData`
in the `per_isolate_` map, and not just a key with empty value. When
`it == per_isolate_.end()`, however, it means that we don't have the
isolate and the `CHECK(it->second)` is guaranteed to fail then!
PR-URL: #38010
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau

Copy link
Copy Markdown
Member

Landed in 8a9f949.

@richardlaurichardlau mentioned this pull request Jul 23, 2021
guybedford pushed a commit that referenced this pull request Jul 26, 2021
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData`
in the `per_isolate_` map, and not just a key with empty value. When
`it == per_isolate_.end()`, however, it means that we don't have the
isolate and the `CHECK(it->second)` is guaranteed to fail then!
PR-URL: #38010
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 26, 2021
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData`
in the `per_isolate_` map, and not just a key with empty value. When
`it == per_isolate_.end()`, however, it means that we don't have the
isolate and the `CHECK(it->second)` is guaranteed to fail then!
PR-URL: #38010
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@indutny@nodejs-github-bot@jasnell@richardlau@addaleax@cjihrig