[PATCH v2 0/1] MR8962: dbghelp: Fix pointer truncation issues when parsing 64-bit Mach-O binaries in a Wow64 process
When running `SymInitializeW(GetCurrentProcess(), NULL, TRUE)` in a 32-bit EXE on 64-bit macOS, there are a number of syscall faults resulting from 64-bit pointers being truncated to 32 bits and then passed to `ReadProcessMemory()`. Fix these, mostly by widening variables to 64 bits. -- v2: dbghelp: Don't try to load 64-bit ELF/Mach-O debug info in a Wow64 process. https://gitlab.winehq.org/wine/wine/-/merge_requests/8962
From: Brendan Shanks <bshanks(a)codeweavers.com> Patch by Eric Pouech. --- dlls/dbghelp/dbghelp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index a46d052b8c7..911daeca782 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -417,7 +417,7 @@ static BOOL check_live_target(struct process* pcs, BOOL wow64, BOOL child_wow64) if (!base) return FALSE; TRACE("got debug info address %#I64x from PEB %p\n", base, pbi.PebBaseAddress); - if (!elf_read_wine_loader_dbg_info(pcs, base) && !macho_read_wine_loader_dbg_info(pcs, base)) + if (base != (ULONG_PTR)base || (!elf_read_wine_loader_dbg_info(pcs, base) && !macho_read_wine_loader_dbg_info(pcs, base))) { WARN("couldn't load process debug info at %#I64x\n", base); pcs->loader = &empty_loader_ops; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8962
On Fri Sep 12 17:13:38 2025 +0000, eric pouech wrote:
does this simpler approach works? (assuming wine loader is above 4G) [dh.patch](/uploads/5375ed08db3804a4026726c4735f8d9c/dh.patch) I think it's better to disable fully system modules searching & loading in that case (32bit dbghelp managing a live new wow process) Thanks, yes that does work and avoids the syscall faults
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8962#note_115775
participants (2)
-
Brendan Shanks -
Brendan Shanks (@bshanks)