#7001: Sage's GAP interface not properly leaving GAP's break loop
------------------------+---------------------------------------------------
Reporter: SimonKing | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.2
Component: interfaces | Keywords: gap interface recursion depth trap
Reviewer: | Author:
Merged: |
------------------------+---------------------------------------------------
It seems to me that it is forgotten to quit GAP's break loop before
continuing. By consequence, GAP runs into a recursion depth trap (by
default, GAP throws an error if a recursion of depth 5000 occurs) if there
are too many errors.
Example:
{{{
sage: def bugtrigger(n):
....: a = gap(1)
....: for i in range(n):
....: try:
....: b = gap.eval('Name(%s)'%a.name())
....: a += 1
....: except Exception, msg:
....: if 'recursion depth' in str(msg):
....: return i,msg
....:
sage: bugtrigger(10000)
(4998,
RuntimeError('Gap produced error output\nrecursion depth trap
(5000)\n\n\n executing Name($sage1);',))
}}}
__Explanation:__
"Name" is not defined for a, so, an error occurs, that we catch and
continue. If this is done 4998 times then we have 4998 break loops inside
the main loop, and then call {{{"Name(%s)"%a.name()}}} -- this is a total
of 5000 nested loops (main loop, 4998 break loops, function call).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7001>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---