Skip to content

Fix macOS allocator-boundary crash in monolithic Unreal builds - #51

Open
Gogoshika-ga wants to merge 4 commits into
mainfrom
fix/mac-libcxx-allocator-boundary
Open

Fix macOS allocator-boundary crash in monolithic Unreal builds#51
Gogoshika-ga wants to merge 4 commits into
mainfrom
fix/mac-libcxx-allocator-boundary

Conversation

@Gogoshika-ga

Copy link
Copy Markdown
Member

On macOS, libc++ string/stringstream/thread code lives in libc++.1.dylib and uses the system allocator. Hosts with private operator new/delete (monolithic Unreal) then crash with Attempt to free an unrecognized pointer.

  • Explicitly instantiate std::string/stringstream templates in the SDK (Apple only)
  • GAThread: pthread-backed thread on Apple; std::thread elsewhere
  • snprintf instead of std::to_string(double) in GAValidator
  • New CTest: runtime allocator-boundary test + nm check for libc++ string imports

🤖 Generated with Claude Code

Keeps their allocations inside the SDK binary instead of libc++.1.dylib,
fixing allocator mismatch crashes in hosts with private operator new/delete
(monolithic Unreal).
libc++'s std::thread frees its TLS block inside libc++.1.dylib, crashing
hosts with private operator new/delete. GAHTTPApi's std::async was
effectively synchronous; run it inline.
std::to_string(double) allocates inside libc++.1.dylib.
@Gogoshika-ga
Gogoshika-ga requested a review from dorin-ga August 27, 2026 11:16
Runtime test with private operator new/delete, plus an nm check that no
libc++ string/stringstream members are imported.
@Gogoshika-ga
Gogoshika-ga force-pushed the fix/mac-libcxx-allocator-boundary branch from fd22ef1 to bed99c0 Compare August 27, 2026 11:18
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

LCOV of commit bed99c0 during Test Coverage #151

Summary coverage rate:
  lines......: 40.7% (1157 of 2843 lines)
  functions..: 52.6% (210 of 399 functions)
  branches...: no data found

Files changed coverage rate: n/a

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