<div dir="ltr">I am having trouble working out when/how to release variables.<div><br></div><div>I have SCIP variables 'inside' my probdata. If I don't release them all in my SCIP_DECL_PROBDELORIG function I get the following (but only in OPT=dbg mode):</div><div><br></div><div>....</div><div><div>WARNING: Original variable <edge#TbOrCa#XRay> not released when freeing SCIP. Consider releasing variable first.</div><div>[src/blockmemshell/memory.c:2503] ERROR: 320 bytes (4 elements of size 80) not freed. First Allocator: src/scip/cons_pseudoboolean.c:424</div><div>[src/blockmemshell/memory.c:2503] ERROR: 768 bytes (12 elements of size 64) not freed. First Allocator: src/scip/cons_nonlinear.c:9476</div><div>[src/blockmemshell/memory.c:2503] ERROR: 1952 bytes (61 elements of size 32) not freed. First Allocator: src/nlpi/expr.c:11977</div><div>[src/blockmemshell/memory.c:2503] ERROR: 40584 bytes (89 elements of size 456) not freed. First Allocator: src/scip/var.c:1900</div><div>[src/blockmemshell/memory.c:2503] ERROR: 2256 bytes (94 elements of size 24) not freed. First Allocator: src/scip/cons_nonlinear.c:9463</div><div>[src/blockmemshell/memory.c:2503] ERROR: 28480 bytes (178 elements of size 160) not freed. First Allocator: src/scip/cons_linear.c:533</div><div>[src/blockmemshell/memory.c:2503] ERROR: 304 bytes (19 elements of size 16) not freed. First Allocator: src/nlpi/expr.c:11977</div><div>[src/blockmemshell/memory.c:2503] ERROR: 8 bytes (1 elements of size 8) not freed. First Allocator: src/scip/cons_bounddisjunction.c:3109</div><div>[src/blockmemshell/memory.c:2521] ERROR: 74672 bytes not freed in total.</div><div><br></div><div>Note that I do not use most of the constraint handlers mentioned above, e.g I do not use cons_pseudoboolean, </div><div><br></div><div><br></div><div>When I do release them all I get the following:</div><div>...</div><div><div>gobnilp: src/scip/var.c:2663: varFree: Assertion `(*var)->probindex == -1' failed.</div><div>Aborted (core dumped)</div></div><div><br></div><div><br></div><div>Here's the gdb backtrace for that:</div><div>...</div><div><div>gobnilp: src/scip/var.c:2663: varFree: Assertion `(*var)->probindex == -1' failed.</div><div><br></div><div>Program received signal SIGABRT, Aborted.</div><div>0x00007ffff5db5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54</div><div>54<span class="gmail-Apple-tab-span" style="white-space:pre">       </span>../sysdeps/unix/sysv/linux/raise.c: No such file or directory.</div><div>(gdb) bt</div><div>#0  0x00007ffff5db5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54</div><div>#1  0x00007ffff5db702a in __GI_abort () at abort.c:89</div><div>#2  0x00007ffff5dadbd7 in __assert_fail_base (fmt=<optimised out>, assertion=assertion@entry=0x17ca38c "(*var)->probindex == -1", file=file@entry=0x17c8e60 "src/scip/var.c", line=line@entry=2663, </div><div>    function=function@entry=0x17d2e68 <__PRETTY_FUNCTION__.20324> "varFree") at assert.c:92</div><div>#3  0x00007ffff5dadc82 in __GI___assert_fail (assertion=0x17ca38c "(*var)->probindex == -1", file=0x17c8e60 "src/scip/var.c", line=2663, function=0x17d2e68 <__PRETTY_FUNCTION__.20324> "varFree") at assert.c:101</div><div>#4  0x0000000000d5a555 in varFree (var=0x7fffffffd0a0, blkmem=0x27d5f70, set=0x27d8170, eventqueue=0x0, lp=0x0) at src/scip/var.c:2663</div><div>#5  0x0000000000d5b660 in SCIPvarRelease (var=0x7fffffffd0a0, blkmem=0x27d5f70, set=0x27d8170, eventqueue=0x0, lp=0x0) at src/scip/var.c:2782</div><div>#6  0x0000000000c07d83 in SCIPreleaseVar (scip=0x27d2f70, var=0x7fffffffd0a0) at src/scip/scip.c:18398</div><div>#7  0x000000000048bcf3 in hashtablefreeArrow (scip=0x27d2f70, psd=0x2a057d0, releasevars=1) at src/utils.c:212</div><div>#8  0x000000000045a7e9 in PS_deallocateParentSetData (scip=0x27d2f70, psd=0x29fa9d0, releasevars=1) at src/parent_set_data.c:94</div><div>#9  0x000000000046508c in probdelorigBN (scip=0x27d2f70, probdata=0x29fbb88) at src/probdata_bn.c:96</div><div>#10 0x0000000000b48c07 in SCIPprobFree (prob=0x27d2fa8, messagehdlr=0x27d3090, blkmem=0x27d5f70, set=0x27d8170, stat=0x29faa50, eventqueue=0x0, lp=0x0) at src/scip/prob.c:448</div><div>#11 0x0000000000bd1312 in SCIPfreeProb (scip=0x27d2f70) at src/scip/scip.c:10409</div><div>#12 0x00000000004aa060 in main (argc=2, argv=0x7fffffffd8e8) at src/gobnilp.c:516</div></div><div><br></div><div>Any ideas out there and what is going on, and how to fix it?</div><div><br></div><div>James</div><div><br></div>-- <br><div class="gmail_signature">James Cussens<br>Dept of Computer Science &<br>York Centre for Complex Systems Analysis<br>Room 326, The Hub, Deramore Lane            Tel    +44 (0)1904 325371<br>University of York                                        Fax  +44 (0)1904 500159<br>York YO10 5GE, UK                               <a href="http://www.cs.york.ac.uk/~jc" target="_blank">http://www.cs.york.ac.uk/~jc</a><br><a href="http://www.york.ac.uk/docs/disclaimer/email.htm" target="_blank">http://www.york.ac.uk/docs/disclaimer/email.htm</a></div>
</div></div>