[gecode-users] seg fault with posting dom constraint

Kish Shen kisshen at cisco.com
Mon Jun 29 20:45:36 CEST 2009


Hi,

I am running into a seg fault with using the dom constraint.
I am testing the ECLiPSe interface to Gecode with the following ECLiPSe 
code:
     A :: [1..3], A :: [1..2].

Basically, this first set the integer variable (A) with the domain 
interval from 1 to 3, and then constrain the variable with a new 
interval 1 to 2. The seg fault seems to happen with this second call.

The calls to Gecode is done at runtime via the interface code I have 
written, so there is no C++ program, but I have traced the calls via 
gdb, and the following calls to Gecode are done:

setting the initial domain to 1..3:
(GecodeSpace is derived from Space with a IntVarArray vInt)

solver = new GecodeSpace();

solver->vInt.reize(*solver, 1);
solver->vInt[0].init(*solver, 1, 3);

constraining the domain to 1..2

size = 1;
IntVarArgs vars(size);
vars[0] = solver->vInt[0];

dom(*solver, vars, 1, 2);

The seg fault seems to happen in this call to dom(). gdb reports that 
the seg fault happens in int/var-imp/int.hpp:349,

which in my version of gecode is:
   forceinline ModEvent
   IntVarImp::gq(Space& home, int n) {
     if (n <= dom.min()) return ME_INT_NONE;  <--- here

(Sorry I had to type the above by hand -- don't seem to be able to cut 
and paste between a VNC window and my mailer running on the host Windows 
XP).

[As far as I know, I did not compile gecode to be debuggable, but gdb 
nevertheless seem to trace some C++ execution, but I am not sure how 
accurate the indication that the seg fault is in line 349 is]

I am using Gecode 3.0.2, g++ 4.2.1 running on 32 bit x86 Linux.

Am I doing something obviously wrong?

Thanks in advance for any help!

--Kish Shen

-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.




More information about the gecode-users mailing list