On 2017-09-08 14:55, Simon King wrote:
sage: cython("""
....: #!clib gap
....: from sage.libs.gap.gap_includes cimport *
....: from sage.libs.gap.element cimport GapElement_FiniteField
....: from sage.libs.gap.libgap import libgap
....: def test(x):
....: libgap_enter()
....: cdef GapElement_FiniteField y = libgap(x)
....: libgap_exit()
....: """)
sage: test(GF(2).zero())
The above crashes. When I move libgap_enter() one line down, it works.
As others have said, this is not calling the libGAP C API. So the call
libgap(x) *also* does libgap_enter(). So you are nesting two calls to
libgap_enter(), which is not allowed.
One could consider it a bug that this totally crashes Sage. Maybe
libgap_enter() should do sig_on() and libgap_exit() should do sig_off().
That way, calling libgap_enter() twice would be an ordinary exception
instead of a hard crash.
--
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.