Sage crashes when attempting to coerce Magma element to boolean

Skip to first unread message

Daniel Hast

Oct 19, 2021, 1:02:37 AMOct 19
to sage-devel
I think I've found a bug in Sage's interface to Magma: Attempting to coerce a Magma element into a Python boolean causes Sage to crash with a stack overflow error.

To reproduce, start Sage and run the following line of code (note: the same bug also seems to occur if magma(True) is replaced with any other Magma element):

Expected result: the expression evaluates to the boolean value True, or at worst raises a sensible exception in Python.

Actual result: Python crashes with the message "Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow." I've attached a copy-paste of a complete Sage session where this occurred.

I am running Sage 9.4, using Python 3.9.5, and Magma V2.26-5. My operating system is macOS 10.5.7 running on a 64-bit Intel Core i7 processor with 16 GB of RAM.

Does this look like a bug in Sage or in Magma? And if it's a bug in Sage and isn't already reported, how would I go about reporting it?

Daniel Hast

David Roe

Oct 19, 2021, 1:46:18 AMOct 19
to sage-devel

You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages