[gecode-users] Debugging branching
Malcolm Ryan
malcolmr at cse.unsw.edu.au
Wed Jan 21 07:21:59 CET 2009
I've written a custom branching and I am trying to write some unit
tests to make sure it is working properly. As such, I am doing the
branching and propagation process step-by-step, but there is something
wrong with my code. I have:
ConcretePlanSpace *space = new ConcretePlanSpace(graph, 1, 10);
ConcretePlanBranching *branching = new (space)
ConcretePlanBranching(space);
assert(space->status() == SS_BRANCH);
const BranchingDesc* desc = space->description();
space->commit(desc, 0);
assert(space->status() == SS_BRANCH);
That much of the code works fine, but I want to create a clone of the
space to test out different alternatives:
Space* copy = space->clone(false);
desc = copy->description();
copy->commit(desc, 0);
When it gets to commit() the code fails. GDB shows:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000b
0x001d1e0b in Gecode::Space::commit (this=0xf17460, d=0x7, a=0) at
gecode/kernel/core.cc:330
330 while ((b_commit != Branching::cast(&a_actors)) &&
Any ideas what I am doing wrong?
Thanks,
Malcolm
More information about the gecode-users
mailing list