Skip to content

[release/6.0] Single-file apps should not use copy-on-write mapping of the .exe on windows. #59194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/native/corehost/bundle/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ char* info_t::config_t::map(const pal::string_t& path, const location_t* &locati
// * There is no performance limitation due to a larger sized mapping, since we actually only read the pages with relevant contents.
// * Files that are too large to be mapped (ex: that exhaust 32-bit virtual address space) are not supported.

#ifdef _WIN32
// Since we can't use in-situ parsing on Windows, as JSON data is encoded in
// UTF-8 and the host expects wide strings.
// We do not need COW and read-only mapping will be enough.
char* addr = (char*)pal::mmap_read(app->m_bundle_path);
#else // _WIN32
char* addr = (char*)pal::mmap_copy_on_write(app->m_bundle_path);
#endif // _WIN32
if (addr == nullptr)
{
trace::error(_X("Failure processing application bundle."));
Expand Down