Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.5.x] fix: Fix Chrome stack overflow during highlighting #64074

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

sourcegraph-release-bot
Copy link
Collaborator

Using the spread operator with large arrays can trigger a
stack overflow in Chrome/V8. For example, see:

In a highlighting context, we can have 10k-100k occurrences
in a file, so let's avoid using the spread operator.

Fixes https://linear.app/sourcegraph/issue/GRAPH-772

Test plan

Manually tested against sample file.

CleanShot 2024-07-25 at 11 10 43@2x

Changelog

Using the spread operator with large arrays can trigger a
stack overflow in Chrome/V8. For example, see:
- nodejs/node#16870

In a highlighting context, we can have 10k-100k occurrences
in a file, so let's avoid using the spread operator.

Fixes https://linear.app/sourcegraph/issue/GRAPH-772

## Test plan

Manually tested against sample file.

![](https://github.com/user-attachments/assets/e096c664-063e-44ed-a991-72629af36651)

## Changelog

- Fixes a Chrome-specific stack overflow when highlighting large files.

(cherry picked from commit 2644e24)
@sourcegraph-release-bot sourcegraph-release-bot requested review from varungandhi-src, a team and jdpleiness and removed request for a team July 25, 2024 06:18
@sourcegraph-release-bot sourcegraph-release-bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) cla-signed backports team/product-platform backported-to-5.5.x labels Jul 25, 2024
@craigfurman
Copy link
Contributor

FYI, we recently removed the branch protection rules that caused only the release team to be able to merge (see https://sourcegraph.slack.com/archives/C0EPTDE9L/p1720640223975069). Please feel free to merge this yourself.

@varungandhi-src varungandhi-src merged commit 8cf3916 into 5.5.x Jul 25, 2024
13 checks passed
@varungandhi-src varungandhi-src deleted the backport-64072-to-5.5.x branch July 25, 2024 12:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backported-to-5.5.x backports cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants