#7449: Some doc request hangs sage eating all memory.
-----------------------------+----------------------------------------------
   Reporter:  hivert         |       Owner:  mvngu
       Type:  defect         |      Status:  new  
   Priority:  major          |   Milestone:       
  Component:  documentation  |    Keywords:  doc  
Work_issues:                 |      Author:       
   Reviewer:                 |      Merged:       
-----------------------------+----------------------------------------------

Comment(by was):

 Fernando Perez solved the problem:
 {{{

 On Mon, Nov 16, 2009 at 2:31 AM, Fernando Perez
 <> wrote:
 > The fact that Ctrl-C cleanly stops the crazy loop *without* a
 > KeyboardInterrupt makes me think that ipython is trying to introspect
 > the MS object and some C code is going into a mad loop (otherwise we'd
 > see the Python signal handler showing a traceback).  Do you have any
 > other bugs related to this type of object that sound along those
 > lines?

 Half-right. IPython is swallowing the kbd interrupt, but the bug is in
 sage, it's the fact that len(MS) never returns:

 sage: MS = MatrixSpace(QQ,6,6,sparse=True); MS
 Full MatrixSpace of 6 by 6 sparse matrices over Rational Field
 sage: len(MS)
 ^C---------------------------------------------------------------------------
 KeyboardInterrupt                         Traceback (most recent call
 last)

 /home/fperez/ipython/repo/kernel-config-lp/docs/<ipython console> in
 <module>()

 /opt/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
 in sage.structure.parent.Parent.__len__
 (sage/structure/parent.c:5533)()

 /opt/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
 in sage.structure.parent.Parent.list (sage/structure/parent.c:4995)()

 /opt/sage/local/lib/python2.6/site-packages/sage/matrix/matrix_space.pyc
 in __iter__(self)
    751             while True:
    752                 for iv in
 sage.combinat.integer_vector.IntegerVectors(weight,
 number_of_entries):
 --> 753                     yield self(entries=[base_elements[i] for i
 in iv], rows=True)
    754
    755                 weight += 1

 /opt/sage/local/lib/python2.6/site-packages/sage/matrix/matrix_space.pyc
 in __call__(self, entries, coerce, copy, rows)
    371             copy = False
    372         elif self.__is_sparse and isinstance(entries, (list,
 tuple)):
 --> 373             entries = list_to_dict(entries, self.__nrows,
 self.__ncols, rows=rows)
    374             coerce = True
    375             copy = False

 /opt/sage/local/lib/python2.6/site-packages/sage/matrix/matrix_space.pyc
 in list_to_dict(entries, nrows, ncols, rows)
   1240                 d[(row,col)] = x
   1241             else:
 -> 1242                 d[(col,row)] = x
   1243     return d
   1244

 /opt/sage/local/lib/python2.6/site-packages/sage/interfaces/get_sigs.pyc
 in my_sigint(x, n)
      7
      8 def my_sigint(x, n):
 ----> 9     raise KeyboardInterrupt
     10
     11 def my_sigfpe(x, n):

 KeyboardInterrupt:


 It seems that the ms object implements __len__, but this function
 never returns.  It's just that ipython was calling len() on it.

 Cheers,

 f
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7449#comment:3>
Sage <http://www.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
-~----------~----~----~----~------~----~------~--~---

Reply via email to