[Scip] BMS claims not freed memory for dynamic arrays

Martin Bergner mbergner at mathematik.tu-darmstadt.de
Tue Jun 15 11:19:28 MEST 2010


Hello all,

I'm currently using SCIP_PTRARRAY and SCIP_INTARRAY as dynamic arrays.
While the error occurs with both, I will only show the example with
ptrarrays.

Creation:
    SCIP_CALL(SCIPcreatePtrarray(scip, ptrarray));

Usage:
1. SCIP_CALL(SCIPextendPtrarray(scip, ptrarray, 0, number));

2. SCIP_CALL(SCIPsetPtrarrayVal(scip, ptrarray, index, ptr);
   (also beyond the maximal extension as indicated by 1. -- there is a
    certain minimal number I know but now all in advance)

3. int elements = SCIPgetPtrarrayMaxIdx(scip, ptrarray) + 1;

4. Ptr* ptr = (Ptr*) SCIPgetPtrarrayVal(scip, ptrarray, index);

Free:
    SCIPfreePtrarray(scip, &ptrarray)

That somehow looks ok to me. However, BMScheckEmptyMemory() shows:

64 bytes (2 elements of size 32) not freed. First Allocator:
src/scip/var.c:2061
3208 bytes (1 elements of size 3208) not freed. First Allocator:
src/scip/misc.c:1599
7728 bytes (1 elements of size 7728) not freed. First Allocator:
src/scip/misc.c:2309
11000 bytes not freed in total.
[src/scip/misc.c:2265] ERROR: Tried to free pointer <0x200b180> in block
memory <0x1cf6250> of unknown size 7728
[src/scip/misc.c:2266] ERROR: Tried to free pointer <0x1f858e0> in block
memory <0x1cf6250> of unknown size 32
[src/scip/misc.c:1555] ERROR: Tried to free pointer <0x1febaa0> in block
memory <0x1cf6250> of unknown size 3208
[src/scip/misc.c:1556] ERROR: Tried to free pointer <0x1f85900> in block
memory <0x1cf6250> of unknown size 32

Well, they are both in the free methods of the arrays. I can't explain
the 2 32byte chunks either but lets postpone that until I know my
program works 100% correctly.

Any Ideas?

Regards and thanks,
Martin



More information about the Scip mailing list