Skip to content

mermaid: Fix stack overflow when laying out deeply nested subgraphs#58325

Merged
cameron1024 merged 1 commit into
mainfrom
fix-merman-panic
Jun 2, 2026
Merged

mermaid: Fix stack overflow when laying out deeply nested subgraphs#58325
cameron1024 merged 1 commit into
mainfrom
fix-merman-panic

Conversation

@smitbarmase

Copy link
Copy Markdown
Member

Closes FR-49

This PR fixes stack overflow in flowcharts with deeply nested subgraphs. Rewrote recursive call to iterate with an explicit stack on heap. Added test which reproduces the overflow.

We use our fork now, with patch on existing v0.4.0: zed-industries/merman@1c765dc

Release Notes:

  • Fixed a crash in when rendering Mermaid diagram flowcharts with deeply nested subgraphs.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 2, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 2, 2026
@maxdeviant maxdeviant changed the title merman-render: Fix stack overflow when laying out deeply nested subgraphs mermaid_render: Fix stack overflow when laying out deeply nested subgraphs Jun 2, 2026
@smitbarmase smitbarmase changed the title mermaid_render: Fix stack overflow when laying out deeply nested subgraphs mermaid: Fix stack overflow when laying out deeply nested subgraphs Jun 2, 2026
@smitbarmase smitbarmase requested a review from cameron1024 June 2, 2026 12:08
@cameron1024 cameron1024 added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit 4e949a1 Jun 2, 2026
46 checks passed
@cameron1024 cameron1024 deleted the fix-merman-panic branch June 2, 2026 13:24
@smitbarmase

Copy link
Copy Markdown
Member Author

/cherry-pick preview

zed-zippy Bot added a commit that referenced this pull request Jun 3, 2026
…58325) (cherry-pick to preview) (#58396)

Cherry-pick of #58325 to preview

----
Closes FR-49

This PR fixes stack overflow in flowcharts with deeply nested subgraphs.
Rewrote recursive call to iterate with an explicit stack on heap. Added
test which reproduces the overflow.

We use our fork now, with patch on existing v0.4.0:

zed-industries/merman@1c765dc

Release Notes:

- Fixed a crash in when rendering Mermaid diagram flowcharts with deeply
nested subgraphs.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
dandv pushed a commit to dandv/zed that referenced this pull request Jun 3, 2026
…ed-industries#58325)

Closes FR-49

This PR fixes stack overflow in flowcharts with deeply nested subgraphs.
Rewrote recursive call to iterate with an explicit stack on heap. Added
test which reproduces the overflow.

We use our fork now, with patch on existing v0.4.0:
zed-industries/merman@1c765dc

Release Notes:

- Fixed a crash in when rendering Mermaid diagram flowcharts with deeply
nested subgraphs.
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 8, 2026
…ed-industries#58325)

Closes FR-49

This PR fixes stack overflow in flowcharts with deeply nested subgraphs.
Rewrote recursive call to iterate with an explicit stack on heap. Added
test which reproduces the overflow.

We use our fork now, with patch on existing v0.4.0:
zed-industries/merman@1c765dc

Release Notes:

- Fixed a crash in when rendering Mermaid diagram flowcharts with deeply
nested subgraphs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants