Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Or-ing of booleans with BoolExpr causes SEGV #139

Open
yurivict opened this issue Dec 18, 2021 · 1 comment
Open

Or-ing of booleans with BoolExpr causes SEGV #139

yurivict opened this issue Dec 18, 2021 · 1 comment

Comments

@yurivict
Copy link

Describe the bug

This code pattern:

  BoolExpr sum;
  sum = sum || (var1 && var2);
  sum = sum || (var3 && var4);
  rel(*this, sum);

always causes crash:

Program received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
0x0000000800db2247 in ?? () from /usr/local/lib/libgecodeminimodel.so.51
(gdb) bt
#0  0x0000000800db2247 in ?? () from /usr/local/lib/libgecodeminimodel.so.51
#1  0x0000000800db2384 in ?? () from /usr/local/lib/libgecodeminimodel.so.51
#2  0x0000000800db2384 in ?? () from /usr/local/lib/libgecodeminimodel.so.51
#3  0x0000000800db2384 in ?? () from /usr/local/lib/libgecodeminimodel.so.51
#4  0x0000000800db2e1e in Gecode::BoolExpr::rel(Gecode::Home, Gecode::IntPropLevels const&) const () from /usr/local/lib/libgecodeminimodel.so.51
#5  0x0000000800db3ee1 in Gecode::rel(Gecode::Home, Gecode::BoolExpr const&, Gecode::IntPropLevels const&) () from /usr/local/lib/libgecodeminimodel.so.51

But this code succeeds:

  BoolExpr sum;
  sum = (var1 && var2);
  sum = sum || (var3 && var4);
  rel(*this, sum);

BoolExpr doesn't seem to accept a boolean initializer, like LinIntExpr accepts an integer initializer.

Is boolean initialization forgotten, or what might be a solution?

@yurivict yurivict changed the title Multiple or-ing of boleans with BoolExpr causes SEGv Or-ing of boleans with BoolExpr causes SEGv Dec 18, 2021
@yurivict yurivict changed the title Or-ing of boleans with BoolExpr causes SEGv Or-ing of boleans with BoolExpr causes SEGV Dec 18, 2021
@yurivict yurivict changed the title Or-ing of boleans with BoolExpr causes SEGV Or-ing of booleans with BoolExpr causes SEGV Dec 30, 2021
@sirwhinesalot
Copy link

Late reply @yurivict but I work around this by adding auto TRUE = BoolVar(home, 1, 1) and FALSE = BoolVar(home, 0, 0) to my model. They really should be built-in though I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants