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" <[EMAIL PROTECTED]> To: "David Rijsman" <[EMAIL PROTECTED]> CC: <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 > [EMAIL PROTECTED] > 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. _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users