Hi, You do nothing wrong, this is very definitely a bug (the problem is that var2 is not initialized and the assignment operator crashes). I attached a patch and we will release a new version in a few days (for other reasons, though).
Christian -- Christian Schulte, www.ict.kth.se/~cschulte/ -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jean-Noël Monette Sent: Thursday, March 22, 2012 1:55 PM To: [email protected] Subject: [gecode-users] Segfault when assigning NaryUnion Hello, While writing some propagator using range iterators and testing it, I fell upon a segfault. Tracking it down, it appears to happen when I use the assignment operator on NaryUnion. Here is a (almost) minimal example reproducing the problem: #include "gecode/driver.hh" #include "gecode/iter.hh" using namespace Gecode; class MySpace:public Space { public: virtual Space* copy(bool share){return this;} }; int main(int argc, char* argv[]){ MySpace home; Iter::Ranges::Empty empty; Region region(home); Iter::Ranges::NaryUnion var1(region,empty); Iter::Ranges::NaryUnion var2; std::cout << "pass?" << std::endl; var2 = var1; std::cout << "passed" << std::endl; return 0; } The second print statement is never reached. What am I doing wrong? I'm using Gecode 3.7.1 (I haven't upgraded to 3.7.2 yet but according to the changelog, this problem seems unrelated to the changes between the two versions), on Linux Ubuntu 11.04, and compiling with GCC 4.5.2. Thank you for your answers, Jean-Noël Monette _______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users
patch
Description: Binary data
_______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users
