Skip to content

macos_host: a probe for C++ throws in a DLL the guest loads - #9

Open
Lucasyudi wants to merge 1 commit into
adrbn:mac-native-hostfrom
Lucasyudi:macos-host/eh-any-image
Open

Lucasyudi wants to merge 1 commit into
adrbn:mac-native-hostfrom
Lucasyudi:macos-host/eh-any-image

Conversation

@Lucasyudi

@Lucasyudi Lucasyudi commented Nov 24, 2026 •

Copy link
Copy Markdown

A regression test for the tiny_game eh → 70 I reported on #7446, which e1c9d1e60 fixed (the /MD throw path only searched the host's main image, gta6rt.exe under --run). I had sent the same eh.cpp fix here; dropped it in favour of yours, so this is only the test.

guest/eh_module_probe.cpp loads guest/eh_dll.cpp's DLL with LoadLibraryA: a throw caught inside the DLL (destructors counted), and an int thrown there and caught by the exe. That is the multi-image path without gta6rt.

Apple M4 Pro, macOS 27.2.1, Rosetta 2, clang/lld 23.1.6:

  • eh_module_probe: 70 on 84a90a6ed ("unhandled C++ exception (no catch in the game's frames)"), 0 on a1c8d43be. With the CatchableType's name read against the frame's image instead of the thrower's it fails with 70.
  • On a1c8d43be + this: guest, crt_probe, pool_probe, eh_probe, eh_probe_mt, cpuid_probe, shell_probe exit 0; illegal_probe traps 21, all ok; gta6rt --run tiny_game.exe -- hello 42 tls eh exit-code exits 42.

No game files used. AI-assisted.

🤖 Generated with Claude Code

guest/eh_module_probe.cpp loads guest/eh_dll.cpp's DLL with LoadLibraryA: a
throw caught inside the DLL (destructors counted), and an int thrown there and
caught by the exe. It covers the multi-image /MD throw path e1c9d1e fixed
without gta6rt: exit 70 on 84a90a6, 0 after.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lucasyudi
Lucasyudi force-pushed the macos-host/eh-any-image branch from 8e499d4 to 20a2119 Compare November 24, 2026 00:34
@Lucasyudi Lucasyudi changed the title macos_host: C++ exceptions thrown in any mapped image, not only the main one macos_host: a probe for C++ throws in a DLL the guest loads Nov 24, 2026
@Lucasyudi

Copy link
Copy Markdown
Author

Thanks, and for merging #5. Your e1c9d1e60 fixes the same thing the same way, so I dropped my eh.cpp change and this PR is now only the regression test. eh_module_probe loads eh_dll.dll (a throw caught inside the DLL, and one thrown there and caught by the exe), so it covers the multi-image path without gta6rt. It exits 70 on 84a90a6ed and 0 on a1c8d43be.

AI-assisted.

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