8000 GGPO: fix heap corruption at session end in the Clang Release build by inada-s · Pull Request #803 · inada-s/pcsx2 · GitHub
[go: up one dir, main page]

Skip to content

GGPO: fix heap corruption at session end in the Clang Release build - #803

Merged
inada-s merged 1 commit into
zdxsv-masterfrom
ai/ggpo-endpoints-delete
Nov 21, 2026
Merged

inada-s merged 1 commit into
zdxsv-masterfrom
ai/ggpo-endpoints-delete

Conversation

@inada-s
@inada-s inada-s commented Nov 21, 2026 •
Copy link
Copy Markdown
Owner

Description of Changes

Peer2PeerBackend now constructs and destroys its UdpProtocol endpoint array by hand (operator new, placement new, explicit destructor calls, operator delete) instead of new[]/delete[].

Rationale behind Changes

v1.1.0 (CI, Clang) crashes with STATUS_HEAP_CORRUPTION in ggpo_close_session when a GGPO battle ends. UdpProtocol has a virtual destructor, so delete[] goes through the vtable's deleting destructor with the array flag; the Clang build's vtable entry is the scalar one, which ignores that flag and frees this, 8 bytes past the allocation's array cookie. Page heap on the Release build stops there with "corrupted start stamp". The MSVC Devel build does not show it.

Suggested Testing Steps

  • Done: MSVC Devel build; 1-player GGPO battle with live uplink on the local stack under page heap, session end passes (private rig).
  • Not done yet: the CI Clang build in a 1-player battle on the public server (crashed every time on v1.1.0).

Did you use AI to help find, test, or implement this issue or feature?

Yes: Claude Code read the crash report and minidump, disassembled the Release build to find the cause, and wrote the fix.

🤖 Generated with Claude Code

…lete[] freed the wrong pointer at session end

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@inada-s
inada-s merged commit c9269d3 into zdxsv-master Nov 21, 2026
4 checks passed
@inada-s
inada-s deleted the ai/ggpo-endpoints-delete branch November 21, 2026 13:56
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.

1 participant

0