https://bugs.winehq.org/show_bug.cgi?id=51539
Bug ID: 51539 Summary: "server: Get the process entry point from the exe image info" breaks running if exe is loaded at a non-default address Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: martin@martin.st CC: jacek@codeweavers.com, julliard@winehq.org Regression SHA1: a3c92a02cc7014cfdb1f90f1d070037868067097 Distribution: ---
Since "server: Get the process entry point from the exe image info", a3c92a02cc7014cfdb1f90f1d070037868067097, starting a process fails if the exe image ends up loaded at a non-default address.
This can be easily triggered e.g. with this patch:
---8<--- diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 8ceba611875..2515d73ee9e 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2405,8 +2405,10 @@ static NTSTATUS virtual_map_image( HANDLE mapping, ACCESS_MASK access, void **ad base = wine_server_get_ptr( image_info->base ); if ((ULONG_PTR)base != image_info->base) base = NULL;
+#if 0 if ((char *)base >= (char *)address_space_start) /* make sure the DOS area remains free */ status = map_view( &view, base, size, alloc_type & MEM_TOP_DOWN, vprot, zero_bits_64 ); +#endif
if (status) status = map_view( &view, NULL, size, alloc_type & MEM_TOP_DOWN, vprot, zero_bits_64 ); if (status) goto done; ---8<---
This seems to happen a lot on 32 bit arm builds (on Ubuntu 20.04), when the expected low addresses used as default load address of 0x400000 conflicts with e.g. /home/martin/wine32/share/wine/nls/sortdefault.nls which is mapped at 0x00230000-0x00564000.