#8772: Maxima interface chokes randomly
--------------------------+-------------------------------------------------
   Reporter:  dunfield    |       Owner:  was       
       Type:  defect      |      Status:  new       
   Priority:  critical    |   Milestone:  sage-4.5.3
  Component:  interfaces  |    Keywords:  Maxima    
     Author:              |    Upstream:  N/A       
   Reviewer:              |      Merged:            
Work_issues:              |  
--------------------------+-------------------------------------------------

Comment(by leif):

 Replying to [comment:7 leif]:
 > Doctesting in parallel with 32 threads ({{{ptestlong}}}) btw. gave no
 errors. I'll have to inspect the log of the run with 64 threads, but IIRC
 there was only one "intentional" timeout due to SIGALARM set to 1
 second...

 Not really (the run with 64 threads):
 {{{
 ...

 ----------------------------------------------------------------------

 The following tests failed:

         sage -t  -long devel/sage/sage/interfaces/expect.py # 1 doctests
 failed
         sage -t  -long devel/sage/sage/symbolic/expression.pyx # 1
 doctests failed
         sage -t  -long devel/sage/sage/schemes/elliptic_curves/heegner.py
 # 1 doctests failed
 ----------------------------------------------------------------------
 Total time for all tests: 1799.8 seconds
 }}}
 The failing tests:
 {{{
 sage -t  -long devel/sage/sage/interfaces/expect.py
 **********************************************************************
 File "/home/leif/Sage/sage-4.5.3.rc0/devel/sage-
 main/sage/interfaces/expect.py", line 808:
     sage: print sage0.eval("alarm(1); singular._expect_expr('1')")
 Expected:
     Control-C pressed.  Interrupting Singular. Please wait a few
 seconds...
     ...
     KeyboardInterrupt: computation timed out because alarm was set for 1
 seconds
 Got:
 ---------------------------------------------------------------------------
     KeyboardInterrupt                         Traceback (most recent call
 last)
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/data/extcode/sage/<ipython console> in
 <module>()
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/interfaces/expect.pyc in _expect_expr(self, expr, timeout)
         815             expr = self._prompt_wait
         816         if self._expect is None:
     --> 817             self._start()
         818         try:
         819             if timeout:
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/interfaces/singular.pyc in _start(self, alt_message)
         373         """
         374         self.__libs = []
     --> 375         Expect._start(self, alt_message)
         376         # Load some standard libraries.
         377         self.lib('general')   # assumed loaded by
 misc/constants.py
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/interfaces/expect.pyc in _start(self, alt_message,
 block_during_init)
         449             self._expect = pexpect.spawn(cmd,
 logfile=self.__logfile)
         450             if self._do_cleaner():
     --> 451                 cleaner.cleaner(self._expect.pid, cmd)
         452
         453         except (ExceptionPexpect, pexpect.EOF, IndexError):
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/interfaces/cleaner.pyc in cleaner(pid, cmd)
          30     o.write('%s %s\n'%(pid, cmd))
          31     o.close()
     ---> 32     start_cleaner_if_not_running()
          33
          34 ################
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/interfaces/cleaner.pyc in start_cleaner_if_not_running()
          41         return
          42     except (IOError, OSError, ValueError):
     ---> 43         os.system('sage-cleaner &')   # it has died
          44
          45
     <BLANKLINE>
     /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/misc/misc.pyc in __mysig(a, b)
        1695 __alarm_time=0
        1696 def __mysig(a,b):
     -> 1697     raise KeyboardInterrupt, "computation timed out because
 alarm was set for %s seconds"%__alarm_time
        1698
        1699 def alarm(seconds):
     <BLANKLINE>
     KeyboardInterrupt: computation timed out because alarm was set for 1
 seconds
 **********************************************************************
 1 items had failures:
    1 of  10 in __main__.example_15
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file
 /home/leif/.sage//tmp/.doctest_expect.py
          [101.9 s]
 }}}
 (I think this is ok, as mentioned.)

 {{{
 sage -t  -long devel/sage/sage/symbolic/expression.pyx
 **********************************************************************
 File "/home/leif/Sage/sage-4.5.3.rc0/devel/sage-
 main/sage/symbolic/expression.pyx", line 1146:
     sage: (x > 2).assume()
 Expected nothing
 Got:
     Maxima crashed -- automatically restarting.
 **********************************************************************
 1 items had failures:
    1 of  15 in __main__.example_36
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file
 /home/leif/.sage//tmp/.doctest_expression.py
          [564.5 s]
 }}}
 This might also simply be a timeout.

 {{{
 sage -t  -long devel/sage/sage/schemes/elliptic_curves/heegner.py
 **********************************************************************
 File "/home/leif/Sage/sage-4.5.3.rc0/devel/sage-
 main/sage/schemes/elliptic_curves/heegner.py", line 6946:
     sage: QQ[sqrt(-195)].class_number()
 Exception raised:
     Traceback (most recent call last):
       File "/home/leif/Sage/sage-4.5.3.rc0/local/bin/ncadoctest.py", line
 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/home/leif/Sage/sage-4.5.3.rc0/local/bin/sagedoctest.py", line
 38, in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/home/leif/Sage/sage-4.5.3.rc0/local/bin/ncadoctest.py", line
 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_235[7]>", line 1, in <module>
         QQ[sqrt(-Integer(195))].class_number()###line 6946:
     sage: QQ[sqrt(-195)].class_number()
       File "ring.pyx", line 205, in sage.rings.ring.Ring.__getitem__
 (sage/rings/ring.c:2556)
       File "/home/leif/Sage/sage-4.5.3.rc0/local/lib/python/site-
 packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 343,
 in PolynomialRing
         R = _single_variate(base_ring, name, sparse, implementation)
       File "/home/leif/Sage/sage-4.5.3.rc0/local/lib/python/site-
 packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 395,
 in _single_variate
         name = normalize_names(1, name)
       File "parent_gens.pyx", line 204, in
 sage.structure.parent_gens.normalize_names
 (sage/structure/parent_gens.c:2093)
       File "parent_gens.pyx", line 145, in
 sage.structure.parent_gens._certify_names
 (sage/structure/parent_gens.c:1650)
     ValueError: variable names must be alphanumeric, but one is
 'sqrt(-195)' which is not.
 **********************************************************************
 1 items had failures:
    1 of  11 in __main__.example_235
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file
 /home/leif/.sage//tmp/.doctest_heegner.py
          [1178.8 s]
 }}}
 No idea. I get the same error if I just type that line in Sage. Doctesting
 the file succeeds...

 Oh wait, that was the Sage session that gave the Maxima error! After
 restarting Sage, I get the expected result:
 {{{
 ...
 TypeError: Error executing code in Maxima
 CODE:
         sage75684 : ((a)+(-1))*((a)^(-1))$
 Maxima ERROR:
          Incorrect syntax: Illegal use of delimiter )
 (%i529800) Incorrect syntax: Premature termination of input at $.
 (%i529801)
  sage:

 sage:
 sage: QQ[sqrt(-195)].class_number()
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/leif/Sage/sage-4.5.3.rc0/<ipython console> in <module>()

 /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/rings/ring.so in sage.rings.ring.Ring.__getitem__
 (sage/rings/ring.c:2556)()

 /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_ring_constructor.pyc in
 PolynomialRing(base_ring, arg1, arg2, sparse, order, names, name,
 implementation)
     341                 raise TypeError, "if second arguments is a string
 with no commas, then there must be no other non-optional arguments"
     342             name = arg1
 --> 343             R = _single_variate(base_ring, name, sparse,
 implementation)
     344         else:
     345             # 2-4. PolynomialRing(base_ring, names,
 order='degrevlex'):

 /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_ring_constructor.pyc in
 _single_variate(base_ring, name, sparse, implementation)
     393 def _single_variate(base_ring, name, sparse, implementation):
     394     import sage.rings.polynomial.polynomial_ring as m
 --> 395     name = normalize_names(1, name)
     396     key = (base_ring, name, sparse, implementation)
     397     R = _get_from_cache(key)

 /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/structure/parent_gens.so in
 sage.structure.parent_gens.normalize_names
 (sage/structure/parent_gens.c:2093)()

 /home/leif/Sage/sage-4.5.3.rc0/local/lib/python2.6/site-
 packages/sage/structure/parent_gens.so in
 sage.structure.parent_gens._certify_names
 (sage/structure/parent_gens.c:1650)()

 ValueError: variable names must be alphanumeric, but one is 'sqrt(-195)'
 which is not.
 sage:
 Exiting Sage (CPU time 1m33.85s, Wall time 1921m38.11s).
 Exiting spawned Maxima process.
 l...@quadriga:~/Sage/sage-4.5.3.rc0$ ./sage
 ----------------------------------------------------------------------
 | Sage Version 4.5.3.rc0, Release Date: 2010-08-30                   |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 **********************************************************************
 *                                                                    *
 * Warning: this is a prerelease version, and it may be unstable.     *
 *                                                                    *
 **********************************************************************
 sage: QQ[sqrt(-195)].class_number()
 4
 sage:
 }}}
 (I exited Sage as usual - with Control-D; just in case you wonder.)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8772#comment:8>
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