Skip to content
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

Modify error message for failed RW mappings #102458

Merged
merged 1 commit into from
May 22, 2024

Conversation

janvorli
Copy link
Member

The executable allocator can fail to create a RW mapping for an existing RX mapping due to both being out of memory and exceeding maximum number of memory mappings. People were getting confused by the original error message.
This change updates it to explicitly mention the cases when it can occur.

@janvorli janvorli added this to the 9.0.0 milestone May 20, 2024
@janvorli janvorli requested a review from cshung May 20, 2024 15:12
@janvorli janvorli self-assigned this May 20, 2024
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@janvorli
Copy link
Member Author

@ayende, @loop-evgeny, does the modified message sound sufficient to you?

@ayende
Copy link
Contributor

ayende commented May 20, 2024

I would mention the configuration item explicitly, or add a specific term that you can search by it.
Otherwise, you aren't actually giving enough information for someone that isn't familiar with the actual problem.

Copy link
Contributor

@ayende ayende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion that explicitly mention the actual probem.

@@ -905,7 +905,7 @@ void* ExecutableAllocator::MapRW(void* pRX, size_t size, CacheableMapping cacheM

if (pRW == NULL)
{
g_fatalErrorHandler(COR_E_EXECUTIONENGINE, W("Failed to create RW mapping for RX memory"));
g_fatalErrorHandler(COR_E_EXECUTIONENGINE, W("Failed to create RW mapping for RX memory. This can be caused by not enough memory or by exceeding the configured maximum number of memory mappings."));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
g_fatalErrorHandler(COR_E_EXECUTIONENGINE, W("Failed to create RW mapping for RX memory. This can be caused by not enough memory or by exceeding the configured maximum number of memory mappings."));
g_fatalErrorHandler(COR_E_EXECUTIONENGINE, W("Failed to create RW mapping for RX memory. This can cause by insufficient memory or hitting the limit of memory mapping on Unix (vm.map_max_count)."));
Suggested change
g_fatalErrorHandler(COR_E_EXECUTIONENGINE, W("Failed to create RW mapping for RX memory. This can be caused by not enough memory or by exceeding the configured maximum number of memory mappings."));
g_fatalErrorHandler(COR_E_EXECUTIONENGINE, W("Failed to create RW mapping for RX memory. This can be caused by not enough memory or by exceeding the configured maximum number of memory mappings."));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good. I'll just change "Unix" to "Linux", as that setting is Linux specific.

@loop-evgeny
Copy link

I like ayende's wording!

The executable allocator can fail to create a RW mapping for an existing
RX mapping due to both being out of memory and exceeding maximum number
of memory mappings. People were getting confused by the original error
message.
This chnage updates it to explicitly mention the cases when it can
occur.
@janvorli janvorli force-pushed the update-mapping-error-message branch from 12289ff to b8bd95d Compare May 20, 2024 15:46
Copy link
Member

@cshung cshung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@janvorli janvorli merged commit f5eb26e into dotnet:main May 22, 2024
84 of 87 checks passed
steveharter pushed a commit to steveharter/runtime that referenced this pull request May 28, 2024
The executable allocator can fail to create a RW mapping for an existing
RX mapping due to both being out of memory and exceeding maximum number
of memory mappings. People were getting confused by the original error
message.
This chnage updates it to explicitly mention the cases when it can
occur.
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull request May 30, 2024
The executable allocator can fail to create a RW mapping for an existing
RX mapping due to both being out of memory and exceeding maximum number
of memory mappings. People were getting confused by the original error
message.
This chnage updates it to explicitly mention the cases when it can
occur.
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants