[gecode-users] ES_SUBSUMED_FIX error

Mikael Zayenz Lagerkvist zayenz at gmail.com
Wed Dec 3 14:59:44 CET 2008


Hi,

In this particular instance, canceling the subscriptions should not be
necessary. In the general case it should be done if subsumption
happens before the all variables the advisor subscribes to are
assigned.

As for the problem, next() should really not be garbage, so there is
something erroneous here. Reading your program more carefully, I see
that you have the council as a member of the space. This is incorrect,
the council should be a member of the propagator. Furthermore, the
council should not be default-constructed, but should be constructed
with the Council<A>::Council(Space*) constructor. I haven't tested
this (gecode 2.2.0 still compiling on my Windows-machine), but that
should be the error.

Cheers,
Mikael

On Wed, Dec 3, 2008 at 2:23 PM, David Rijsman <David.Rijsman at quintiq.com> wrote:
> Hi Mikael,
>
> Windows XP Professional x64 edition, X64-based PC,
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
> gecode 2.1.1 and also gecode 2.2.2
>
> - The code is a reproduction of the bug so I didn't bother about the clean-up because the error happens in the dispose of the second advisor long before any cleanup
> - Checking the same variable is also done on purpose but is not required to reproduce the scenario
>
> You are pointing to the ViewAdvisor and this makes me wonder if I am doing the right thing. My goal is actually to cancel the subscription of the advisor for that variable and to remove the advisor. I am assuming that ES_SUBSUME_FIX is doing that and also returns ES_FIX.
>
> I am wondering if I should add the cancel invocation (which does not change the behavior), you can also change the second condition to MX.one() (does not change behavior either):
>
> if(padvisor->MIndex)
>      {
>        if( MY.one() )
>        {
>          MY.cancel(home,padvisor);
>          return ES_SUBSUMED_FIX(padvisor,home,MCouncil);
>        }
>      }
>      else
>      {
>        if( MY.one() )
>        {
>          MX.cancel(home,padvisor);
>          return ES_SUBSUMED_FIX(padvisor,home,MCouncil);
>        }
>      }
>
> What I see is that the second dispose on the second MyAdvisor is checking if MyAdvisor::next() is disposed, next is garbage....crash
>
>>>>
> From:   "Mikael Zayenz Lagerkvist" <zayenz at gmail.com>
> To:     "David Rijsman" <David.Rijsman at quintiq.com>
> CC:     <users at gecode.org>
> Date:   12/3/2008 1:59 PM
> Subject:        Re: [gecode-users] ES_SUBSUMED_FIX error
>
> Hi,
>
> The program does not crash on my machine (Athlon 64, gcc 4.2.4, gecode
> 2.2.0). What kind of machine and compiler do you use?
>
> Apart form that, I see one bug and a potential bug in your code.
> First: the subscriptions are never canceled! This should be done
> somewhere in the clean-up code. Either it could be done in the advisor
> itself (as is done in the ViewAdvisor class [1]), or it could be done
> in the class by iterating over the advisors in the council [2].
>
> A potential bug is that the advise function is ill-formed, in that
> both branches check the value of the MY-variable. Since you assign the
> MY-variable first, the problem never occurs, but if you change the
> order of the rel calls in the main function the advise function
> returns with garbage as return vale.
>
> Cheers,
> Mikael
>
> [1] http://www.gecode.org/gecode-doc-latest/classGecode_1_1ViewAdvisor.html
> [2] http://www.gecode.org/gecode-doc-latest/classGecode_1_1Advisors.html
>
> On Wed, Dec 3, 2008 at 1:07 PM, David Rijsman <David.Rijsman at quintiq.com> wrote:
>> Attached you find a little sample in which I have written a peace of code in which I am trying to subsume my advisors and it is crashing on de second subsume invocation... Am I doing something wrong or missing something?
>>
>> thanks,
>>
>> David
>>
>>
>> This message contains information that may be privileged or confidential and is the property of Quintiq. It is only intended for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute or use this message or any part thereof. If you have received this message in error, please notify the sender immediately and delete all copies of this message. Please note that e-mails are susceptible to change, therefore they are not binding.
>>
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org
>> https://www.gecode.org/mailman/listinfo/gecode-users
>>
>>
>
>
>
> --
> Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
>
>
> This message contains information that may be privileged or confidential and is the property of Quintiq. It is only intended for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute or use this message or any part thereof. If you have received this message in error, please notify the sender immediately and delete all copies of this message. Please note that e-mails are susceptible to change, therefore they are not binding.
>



-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list