[SCIP] How to safely release the pricing variable?

Stefan Vigerske svigerske at gams.com
Thu Aug 28 11:10:11 CEST 2025


Hi,

it sounds to me as if that should work. You should check that the 
variable is not released somewhere else as well. Also make sure you 
compiled SCIP in debug-mode to have the assertions activated.
If you are on Linux or macOS, then you could try enabling the tracing of 
capture and release in var.c. Check around line 90 on how to activate it.

Best,
Stefan


On 26/08/2025 09:42, 杨瑞光 wrote:
> Hi,
> 
> 
> In the process of implementing branch-and-price using C++ and SCIP, I added variables to the model using SCIP_CALL (SCIPaddVar (scip, var)) (a variable in the initial solution of the model) and SCIP_CALL (SCIPaddPricedVar (scip, priced_var, 1.0)) in main.cpp and pricer.cpp, respectively, and added var and priced_var to var_vec (vector<SCIP_VAR*>) using var_vec.push_back (var) and var_vec.push_back (priced_var). However, after releasing variables using SCIP_CALL (SCIPreleaseVar (scip,&var_vec[i])), a memory access conflict occurred when calling SCIP_CALL (SCIPfreeTransform(scip)) and SCIP_CALL(SCIPfree(&scip)).
> 
> 
> I tried to disable the pricing function of the model and found that the memory access conflict disappeared. I don't know why this happened. Do I need to perform any other processing on the pricing variables to safely release them?
> 
> 
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list