Repository navigation
Preserve problem arrays and ownership after allocation failure - #224
Open
reinhardullrich wants to merge 1 commit into
Open
reinhardullrich wants to merge 1 commit into
reinhardullrich wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem and fix
An allocation failure while growing a problem's variable or constraint array can lead to SIGSEGV in
SCIPprobFree()during cleanup.BMSreallocMemoryArrayassigns its null return directly to the owned pointer, losing access to an existing array even though it still contains live objects.Grow the five problem arrays through temporary pointers and commit them only after success. Also defer the problem's variable capture and the constraint's array-position assignment until the required capacity is available. Successful growth retains the same capacity policy and solver behavior.
Regression and validation
A standalone Linux/shared-library regression injects one failed problem-array resize using executable-local symbol interposition. It checks both variable and constraint insertion, the
SCIP_NOMEMORYreturn, retained object ownership, and successful cleanup. It needs neither a large allocation nor Criterion; assertions stay enabled in Release and core dumps are disabled.ctest --test-dir build -R '^problem_array_allocation_failure$' --output-on-failurepasses.This is scoped to problem-array growth. It does not claim to fix every allocation-failure path, GMP allocation aborts, or general memory-limit enforcement. No public API, parameter, or solver formulation changes. No performance benchmark was run.