[gecode-users] sorted constraint seg faults with empty arrays

Guido Tack tack at gecode.org
Thu Nov 3 20:16:17 CET 2011


Thanks, Kish.  I just fixed it in the svn trunk.

Cheers,
Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/




On 3 Nov 2011, at 18:36, Kish Shen wrote:

> Hi,
> 
> I am getting a segmentation fault when using the sorted constraint with empty IntVarArgs arrays (i.e. size of the array is zero).
> 
> I found this when I was producing unit tests for the sorted constraint for the ECLiPSe Gecode interface. One of the thing I test for is for the variable array(s) being empty, because I expect the arguments to the constraints to be generated by the user's program, and it could be that this may result in no variables being involved in the constructed constraint. Originally I used to check if such arrays are empty, and raise an error at the ECLiPSe level if it is, so the Gecode constraint was never called with an empty array, but I was sent a program from one of our users who tried to call the lexicographical ordering constraints with empty arrays, and when I did pass the empty array to Gecode, it seem to cope without problems.
> 
> With the sorted constraint, I get a seg. fault. I am using
> 
> sort(home, x, y)
> 
> where both x and y are IntVarArgs of size 0, which should just succeed trivially, but it seems that the seg fault happens during the calling of sort().
> 
> This is the first constraint that I have run into problems with using size 0 IntVarArgs -- I have tested quite a few other constraints so far, and until now they have all worked.
> 
> I am using Gecode 3.7.1, and I tried on both 32 bit Linux and 64 bit Intel Mac.
> 
> Cheers,
> 
> Kish
> 
> -- 
> 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.
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users




More information about the users mailing list