http://bugs.winehq.org/show_bug.cgi?id=31090
Bug #: 31090 Summary: Wine overwrites dyld debug information Product: Wine Version: 1.5.7 Platform: x86 OS/Version: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: loader AssignedTo: wine-bugs@winehq.org ReportedBy: per@morth.org Classification: Unclassified
I've been trying to get windbag --gdb working on OS X. There seem to be multiple issues, but a major one is that it can't load the debug headers needed to get information out of the debugged processes.
What happens is that dbghelp/macho_module tries to read memory from the symbol _dyld_all_image_infos in the target process. Turns out this symbol is always at the address 0x8fe340e0, at least on my machine.
Looking with vmmap on a running wine process, this address is in an unreadable mapping:
VM_ALLOCATE 82000000-8d9f0000 [185.9M] ---/rwx SM=NUL
which I traced to
void mmap_init(void) { ... if (base > user_space_limit) reserve_area( user_space_limit, base ); }
before this call the region points to /usr/lib/dyld: __DATA 8fe33000-8fe38000 [ 20K] rw-/rwx SM=COW /usr/lib/dyld
but after it is as above.
But I'm afraid I don't know how to fix it. I tried adding
wine_mmap_add_reserved_area( (void*)0x82000000, 0x8ff2c000 - 0x82000000 );
to loader/main.c but it didn't seem to help. So I'm writing this bug report, hoping someone else is able to fix it.