You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows you to set e.g. WINE_PREVENT_OVERCOMMIT_EXEMPT=ubaagent.exe to exempt some processes from Wine overcommit prevention.
This is necessary for UbaAgent, which can not tolerate memory allocation failures under some circumstances. In particular, Session::ProcessExited in UbaAgent will occur when processes are exiting due to memory pressure, and this function allocates through the m_deadProcesses.emplace_back call. When Wine overcommit prevention is enabled, the underlying mi_malloc_aligned call from emplace_back can return nullptr, resulting in a segmentation fault.
@hach-que thanks for providing this, and apologies for the delay in reviewing the changes! The proposed functionality sounds helpful, but I did have a few questions:
Is there any specific benefit in having two separate environment variables (one to toggle the exemption behaviour and one to specify the executable name) rather than just one that's either empty to disable exemption or contains a non-empty executable name to enable exemption? It seems like WINE_PREVENT_OVERCOMMIT_EXEMPT_DEBUG could be removed to simplify things, but perhaps I've overlooked something?
If I've understood the code correctly, it looks like it currently checks all of the command-line arguments for the process for matches. That would mean the matching behaviour would apply to any process with one or more command-line arguments that include the value of WINE_PREVENT_OVERCOMMIT_EXEMPT as a substring, rather than only matching the executable name for the process. Was this intentional behaviour, or is it simply that the logic is designed to handle potential scenarios where argv[0] might be wine / wine64 and the Windows executable is argv[1]?
At the moment, this just supports specifying a single executable for exemption. Would you be open to expanding the functionality to allow the user to specify a list with multiple (perhaps comma-delimited) items?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows you to set e.g.
WINE_PREVENT_OVERCOMMIT_EXEMPT=ubaagent.exeto exempt some processes from Wine overcommit prevention.This is necessary for UbaAgent, which can not tolerate memory allocation failures under some circumstances. In particular,
Session::ProcessExitedin UbaAgent will occur when processes are exiting due to memory pressure, and this function allocates through them_deadProcesses.emplace_backcall. When Wine overcommit prevention is enabled, the underlyingmi_malloc_alignedcall fromemplace_backcan returnnullptr, resulting in a segmentation fault.