ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 21 Dec 2020 00:02:29 +0100Stack overflow in boolean testhttps://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/Using SageMath 8.8, I encountered a strange error involving boolean tests. The following code reproduces the issue:
x, y = var('x, y')
assume(x>0)
assume(y>0)
bool(y*(x-y)==0)
`RuntimeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized.
Proceed with caution.`
This code should obviously return `False`. Changing `y*(x-y)` to `x*(y-x)` indeed returns `False`, which means `x` and `y` cannot be exchanged. Without the assumptions, the code works as expected.
I initially thought it was due to my Sage installation, but running this code on https://sagecell.sagemath.org/ also produces asymmetric behavior, though no error comes out (just a blank answer).
Is this a known issue ? Can someone reproduce this ?Wed, 25 Sep 2019 18:42:43 +0200https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/Comment by FrédéricC for <p>Using SageMath 8.8, I encountered a strange error involving boolean tests. The following code reproduces the issue:</p>
<pre><code>x, y = var('x, y')
assume(x>0)
assume(y>0)
bool(y*(x-y)==0)
</code></pre>
<p><code>RuntimeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized.
Proceed with caution.</code></p>
<p>This code should obviously return <code>False</code>. Changing <code>y*(x-y)</code> to <code>x*(y-x)</code> indeed returns <code>False</code>, which means <code>x</code> and <code>y</code> cannot be exchanged. Without the assumptions, the code works as expected.</p>
<p>I initially thought it was due to my Sage installation, but running this code on <a href="https://sagecell.sagemath.org/">https://sagecell.sagemath.org/</a> also produces asymmetric behavior, though no error comes out (just a blank answer).</p>
<p>Is this a known issue ? Can someone reproduce this ?</p>
https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=48062#post-id-48062Gives me a "core dumped" with 8.9.rc0. This is a bug.Wed, 25 Sep 2019 19:55:02 +0200https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=48062#post-id-48062Comment by eric_g for <p>Using SageMath 8.8, I encountered a strange error involving boolean tests. The following code reproduces the issue:</p>
<pre><code>x, y = var('x, y')
assume(x>0)
assume(y>0)
bool(y*(x-y)==0)
</code></pre>
<p><code>RuntimeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized.
Proceed with caution.</code></p>
<p>This code should obviously return <code>False</code>. Changing <code>y*(x-y)</code> to <code>x*(y-x)</code> indeed returns <code>False</code>, which means <code>x</code> and <code>y</code> cannot be exchanged. Without the assumptions, the code works as expected.</p>
<p>I initially thought it was due to my Sage installation, but running this code on <a href="https://sagecell.sagemath.org/">https://sagecell.sagemath.org/</a> also produces asymmetric behavior, though no error comes out (just a blank answer).</p>
<p>Is this a known issue ? Can someone reproduce this ?</p>
https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=48064#post-id-48064Confirmed with Sage 8.9.rc0, as well as with Sage 8.3. So the bug has been there for a while...Wed, 25 Sep 2019 22:02:41 +0200https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=48064#post-id-48064Comment by Emmanuel Charpentier for <p>Using SageMath 8.8, I encountered a strange error involving boolean tests. The following code reproduces the issue:</p>
<pre><code>x, y = var('x, y')
assume(x>0)
assume(y>0)
bool(y*(x-y)==0)
</code></pre>
<p><code>RuntimeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized.
Proceed with caution.</code></p>
<p>This code should obviously return <code>False</code>. Changing <code>y*(x-y)</code> to <code>x*(y-x)</code> indeed returns <code>False</code>, which means <code>x</code> and <code>y</code> cannot be exchanged. Without the assumptions, the code works as expected.</p>
<p>I initially thought it was due to my Sage installation, but running this code on <a href="https://sagecell.sagemath.org/">https://sagecell.sagemath.org/</a> also produces asymmetric behavior, though no error comes out (just a blank answer).</p>
<p>Is this a known issue ? Can someone reproduce this ?</p>
https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=48071#post-id-48071With 8.9.rc1+[Trac#28534](https://trac.sagemath.org/ticket/28534), I get a Sage **crash** ("Segmentation error").
Nice one...Thu, 26 Sep 2019 06:05:30 +0200https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=48071#post-id-48071Answer by tmonteil for <p>Using SageMath 8.8, I encountered a strange error involving boolean tests. The following code reproduces the issue:</p>
<pre><code>x, y = var('x, y')
assume(x>0)
assume(y>0)
bool(y*(x-y)==0)
</code></pre>
<p><code>RuntimeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized.
Proceed with caution.</code></p>
<p>This code should obviously return <code>False</code>. Changing <code>y*(x-y)</code> to <code>x*(y-x)</code> indeed returns <code>False</code>, which means <code>x</code> and <code>y</code> cannot be exchanged. Without the assumptions, the code works as expected.</p>
<p>I initially thought it was due to my Sage installation, but running this code on <a href="https://sagecell.sagemath.org/">https://sagecell.sagemath.org/</a> also produces asymmetric behavior, though no error comes out (just a blank answer).</p>
<p>Is this a known issue ? Can someone reproduce this ?</p>
https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?answer=48067#post-id-48067This is clearly a bug, thanks for reporting, it is now [trac ticket 28538](https://trac.sagemath.org/ticket/28538)
Thu, 26 Sep 2019 00:12:01 +0200https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?answer=48067#post-id-48067Comment by slelievre for <p>This is clearly a bug, thanks for reporting, it is now <a href="https://trac.sagemath.org/ticket/28538">trac ticket 28538</a></p>
https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=54787#post-id-54787The ticket fixed the issue, and was merged in Sage 9.2.beta11.
Any later version of Sage, in particular Sage 9.2 and later, is free from this bug.Mon, 21 Dec 2020 00:02:29 +0100https://ask.sagemath.org/question/48058/stack-overflow-in-boolean-test/?comment=54787#post-id-54787