Skip to content

Use Get() instead of deprecated arrow operator.#4328

Merged
erikcorry merged 5 commits intomainfrom
erikcorry/deprecated-get
Jun 18, 2025
Merged

Use Get() instead of deprecated arrow operator.#4328
erikcorry merged 5 commits intomainfrom
erikcorry/deprecated-get

Conversation

@erikcorry
Copy link
Contributor

In preparation for V8 13.9 where the operator is
gone.

@erikcorry erikcorry requested review from a team as code owners June 13, 2025 12:43
@kentonv
Copy link
Member

kentonv commented Jun 13, 2025

Is this the same change we've tried to make several times before and it caused crashes in production every time but no one ever debugged it?

@anonrig
Copy link
Member

anonrig commented Jun 13, 2025

Is this the same change we've tried to make several times before and it caused crashes in production every time but no one ever debugged it?

Yes. I've tried it twice at least

@fhanau fhanau self-requested a review June 13, 2025 23:33
@kentonv
Copy link
Member

kentonv commented Jun 13, 2025

First attempt: #714
Reverted: #716
Second attempt: #909
Reverted: #916

@fhanau
Copy link
Contributor

fhanau commented Jun 13, 2025

I wasn't sure but yes it is. Same as #714, currently we patch in the old version in patches/v8/0011-Revert-TracedReference-deref-API-removal.patch.

@kentonv
Copy link
Member

kentonv commented Jun 13, 2025

Both reverts only say it caused trouble in tests, though.

I thought there was a time it got to prod and caused crashes but maybe I'm misremembering.

@anonrig
Copy link
Member

anonrig commented Jun 13, 2025

Fifth attempt: #4122

@kentonv
Copy link
Member

kentonv commented Jun 14, 2025

Probably the problem is that handle.Get(isolate) creates a new local handle, but this callback is called during garbage collection, which is a bad time for creating new handles. We need some other way to get an the internal pointers, without any side effects.

@erikcorry erikcorry force-pushed the erikcorry/deprecated-get branch from f1afebc to d04ffd1 Compare June 17, 2025 14:12
@erikcorry
Copy link
Contributor Author

It's sort of dumb to make handles during a GC, since they are roots, and the number of roots should not change during GC, but the new API requires it. However I think it's enough to just create a HandleScope so that the newly created handles are quickly destroyed again before GC continues. Let's see if that fixes it (or was that also already tried)?

I'm also trying to upstream https://chromium-review.googlesource.com/c/v8/v8/+/6652167 to make this footgun less subtle.

@erikcorry
Copy link
Contributor Author

I checked the linked attempts here, and none of them added the HandleScope.

@erikcorry erikcorry merged commit 03e07ec into main Jun 18, 2025
31 of 32 checks passed
@erikcorry erikcorry deleted the erikcorry/deprecated-get branch June 18, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants