From: Bernhard Übelacker <bernhardu@mailbox.org> Followup of 07160a23fa2, 9e006e94c9c, 8fd49c4d8e9, d9d012965de. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58332 rr-debugger-Bug: https://github.com/rr-debugger/rr/issues/3972 --- dlls/ntdll/unix/virtual.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index a2ea5244b9f..62f143d6c4f 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2364,7 +2364,16 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start /* changes to the file are not guaranteed to be visible in read-only MAP_PRIVATE mappings, * but they are on Linux so we take advantage of it */ #ifdef __linux__ - flags |= MAP_PRIVATE; + static int use_map_private = -1; + if (use_map_private == -1) + use_map_private = getenv("RUNNING_UNDER_RR") ? FALSE : TRUE; + if (vprot & SEC_FILE || use_map_private) + flags |= MAP_PRIVATE; + else + { + flags |= MAP_SHARED; + prot &= ~PROT_WRITE; + } #else flags |= MAP_SHARED; prot &= ~PROT_WRITE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10925