Sage crash (probably caused by a Debian system upgrade)

32 views
Skip to first unread message

Emmanuel Charpentier

unread,
Jun 8, 2020, 2:49:36 AM6/8/20
to sage-support
After a (routine) upgrade of Debian testing, Sage crashes at start.

I see this in the terminal:

charpent@zen-book-flip:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.2.beta0, Release Date: 2020-05-28               │
│ Using Python 3.7.7. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
---------------------------------------------------------------------------
---------------------------------------------------------------------------
ModuleNotFoundError     Python 3.7.7: /usr/local/sage-exp/local/bin/python3
                                                   Mon Jun  8 08:39:33 2020
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/usr/local/sage-exp/src/bin/sage-ipython in <module>()
      1 #!/usr/bin/env sage-python
      2 # -*- coding: utf-8 -*-
      3 """
      4 Sage IPython startup script.
      5 """
      6 
      7 # Display startup banner. Do this before anything else to give the user
      8 # early feedback that Sage is starting.
      9 from sage.misc.banner import banner
     10 banner()
     11 
     12 from sage.repl.interpreter import SageTerminalApp
     13 
     14 app = SageTerminalApp.instance()
---> 15 app.initialize()
        global app.initialize = <bound method TerminalIPythonApp.initialize of <sage.repl.interpreter.SageTerminalApp object at 0x7f5642721190>>
     16 app.start()

</usr/local/sage-exp/local/lib/python3.7/site-packages/decorator.py:decorator-gen-110> in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)

/usr/local/sage-exp/local/lib/python3.7/site-packages/traitlets/config/application.py in catch_config_error(method=<function TerminalIPythonApp.initialize>, app=<sage.repl.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={})
     72     TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False
     73 else:
     74     raise ValueError("Unsupported value for environment variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' which is none of  {'0', '1', 'false', 'true', ''}."% _envvar )
     75 
     76 
     77 @decorator
     78 def catch_config_error(method, app, *args, **kwargs):
     79     """Method decorator for catching invalid config (Trait/ArgumentErrors) during init.
     80 
     81     On a TraitError (generally caused by bad config), this will print the trait's
     82     message, and exit the app.
     83 
     84     For use on init methods, to prevent invoking excepthook on invalid input.
     85     """
     86     try:
---> 87         return method(app, *args, **kwargs)
        method = <function TerminalIPythonApp.initialize at 0x7f564165a9e0>
        app = <sage.repl.interpreter.SageTerminalApp object at 0x7f5642721190>
        args = (None,)
        kwargs = {}
     88     except (TraitError, ArgumentError) as e:
     89         app.print_help()
     90         app.log.fatal("Bad config encountered during initialization:")
     91         app.log.fatal(str(e))
     92         app.log.debug("Config at the time: %s", app.config)
     93         app.exit(1)
     94 
     95 
     96 class ApplicationError(Exception):
     97     pass
     98 
     99 
    100 class LevelFormatter(logging.Formatter):
    101     """Formatter with additional `highlevel` record
    102 

/usr/local/sage-exp/local/lib/python3.7/site-packages/IPython/terminal/ipapp.py in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
    301 
    302         return super(TerminalIPythonApp, self).parse_command_line(argv)
    303     
    304     @catch_config_error
    305     def initialize(self, argv=None):
    306         """Do actions after construct, but before starting the app."""
    307         super(TerminalIPythonApp, self).initialize(argv)
    308         if self.subapp is not None:
    309             # don't bother initializing further, starting subapp
    310             return
    311         # print self.extra_args
    312         if self.extra_args and not self.something_to_run:
    313             self.file_to_run = self.extra_args[0]
    314         self.init_path()
    315         # create the shell
--> 316         self.init_shell()
        self.init_shell = <bound method SageTerminalApp.init_shell of <sage.repl.interpreter.SageTerminalApp object at 0x7f5642721190>>
    317         # and draw the banner
    318         self.init_banner()
    319         # Now a variety of things that happen after the banner is printed.
    320         self.init_gui_pylab()
    321         self.init_extensions()
    322         self.init_code()
    323 
    324     def init_shell(self):
    325         """initialize the InteractiveShell instance"""
    326         # Create an InteractiveShell instance.
    327         # shell.display_banner should always be False for the terminal
    328         # based app, because we call shell.show_banner() by hand below
    329         # so the banner shows *before* all extension loading stuff.
    330         self.shell = self.interactive_shell_class.instance(parent=self,
    331                         profile_dir=self.profile_dir,

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/repl/interpreter.py in init_shell(self=<sage.repl.interpreter.SageTerminalApp object>)
    772         self.shell.has_sage_extensions = SAGE_EXTENSION in self.extensions
    773 
    774         # Load the %lprun extension if available
    775         try:
    776             import line_profiler
    777         except ImportError:
    778             pass
    779         else:
    780             self.extensions.append('line_profiler')
    781 
    782         if self.shell.has_sage_extensions:
    783             self.extensions.remove(SAGE_EXTENSION)
    784 
    785             # load sage extension here to get a crash if
    786             # something is wrong with the sage library
--> 787             self.shell.extension_manager.load_extension(SAGE_EXTENSION)
        self.shell.extension_manager.load_extension = <bound method ExtensionManager.load_extension of <IPython.core.extensions.ExtensionManager object at 0x7f564009d1d0>>
        global SAGE_EXTENSION = 'sage'
    788 
    789 

/usr/local/sage-exp/local/lib/python3.7/site-packages/IPython/core/extensions.py in load_extension(self=<IPython.core.extensions.ExtensionManager object>, module_str='sage')
     70 
     71         Returns the string "already loaded" if the extension is already loaded,
     72         "no load function" if the module doesn't have a load_ipython_extension
     73         function, or None if it succeeded.
     74         """
     75         if module_str in self.loaded:
     76             return "already loaded"
     77         
     78         from IPython.utils.syspathcontext import prepended_to_syspath
     79         
     80         with self.shell.builtin_trap:
     81             if module_str not in sys.modules:
     82                 with prepended_to_syspath(self.ipython_extension_dir):
     83                     __import__(module_str)
     84             mod = sys.modules[module_str]
---> 85             if self._call_load_ipython_extension(mod):
        self._call_load_ipython_extension = <bound method ExtensionManager._call_load_ipython_extension of <IPython.core.extensions.ExtensionManager object at 0x7f564009d1d0>>
        mod = <module 'sage' from '/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/__init__.py'>
     86                 self.loaded.add(module_str)
     87             else:
     88                 return "no load function"
     89 
     90     def unload_extension(self, module_str):
     91         """Unload an IPython extension by its module name.
     92 
     93         This function looks up the extension's name in ``sys.modules`` and
     94         simply calls ``mod.unload_ipython_extension(self)``.
     95         
     96         Returns the string "no unload function" if the extension doesn't define
     97         a function to unload itself, "not loaded" if the extension isn't loaded,
     98         otherwise None.
     99         """
    100         if module_str not in self.loaded:

/usr/local/sage-exp/local/lib/python3.7/site-packages/IPython/core/extensions.py in _call_load_ipython_extension(self=<IPython.core.extensions.ExtensionManager object>, mod=<module 'sage' from '/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/__init__.py'>)
    117         """
    118         from IPython.utils.syspathcontext import prepended_to_syspath
    119 
    120         if (module_str in self.loaded) and (module_str in sys.modules):
    121             self.unload_extension(module_str)
    122             mod = sys.modules[module_str]
    123             with prepended_to_syspath(self.ipython_extension_dir):
    124                 reload(mod)
    125             if self._call_load_ipython_extension(mod):
    126                 self.loaded.add(module_str)
    127         else:
    128             self.load_extension(module_str)
    129 
    130     def _call_load_ipython_extension(self, mod):
    131         if hasattr(mod, 'load_ipython_extension'):
--> 132             mod.load_ipython_extension(self.shell)
        mod.load_ipython_extension = <function load_ipython_extension at 0x7f56426545f0>
        self.shell = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f564271eed0>
    133             return True
    134 
    135     def _call_unload_ipython_extension(self, mod):
    136         if hasattr(mod, 'unload_ipython_extension'):
    137             mod.unload_ipython_extension(self.shell)
    138             return True
    139 
    140     def install_extension(self, url, filename=None):
    141         """Download and install an IPython extension. 
    142 
    143         If filename is given, the file will be so named (inside the extension
    144         directory). Otherwise, the name from the URL will be used. The file must
    145         have a .py or .zip extension; otherwise, a ValueError will be raised.
    146 
    147         Returns the full path to the installed file.

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/__init__.py in load_ipython_extension(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,))
      1 __all__ = ['all']
      2 
      3 # Set sage.__version__ to the current version number. This is analogous
      4 # to many other Python packages.
      5 from sage.version import version as __version__
      6 
      7 # Make sure that the correct zlib library is loaded. This is needed
      8 # to prevent the system zlib to be loaded instead of the Sage one.
     10 import zlib
     11 
     12 # IPython calls this when starting up
     13 def load_ipython_extension(*args):
     14     import sage.repl.ipython_extension
---> 15     sage.repl.ipython_extension.load_ipython_extension(*args)
        sage.repl.ipython_extension.load_ipython_extension = <function load_ipython_extension at 0x7f563b4e09e0>
        args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f564271eed0>,)
     16 
     17 
     18 # Monkey-patch inspect.isfunction() to support Cython functions.
     19 def isfunction(obj):
     20     """
     21     Check whether something is a function.
     22 
     23     We assume that anything which has a genuine ``__code__``
     24     attribute (not using ``__getattr__`` overrides) is a function.
     25     This is meant to support Cython functions.
     26 
     27     EXAMPLES::
     28 
     29         sage: from inspect import isfunction
     30         sage: def f(): pass
     31         sage: isfunction(f)

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/repl/ipython_extension.py in wrapper(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,), **kwargs={})
    549         ....:     if work:
    550         ....:         return 'foo worked'
    551         ....:     raise RuntimeError("foo didn't work")
    552         sage: foo(False)
    553         Traceback (most recent call last):
    554         ...
    555         RuntimeError: foo didn't work
    556         sage: foo(True)
    557         'foo worked'
    558         sage: foo(False)
    559         sage: foo(True)
    560     """
    561     @wraps(func)
    562     def wrapper(*args, **kwargs):
    563         if not wrapper.has_run:
--> 564             result = func(*args, **kwargs)
        result = undefined
        global func = undefined
        args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f564271eed0>,)
        kwargs = {}
    565             wrapper.has_run = True
    566             return result
    567     wrapper.has_run = False
    568     return wrapper
    569 
    570 
    571 @run_once
    572 def load_ipython_extension(ip):
    573     """
    574     Load the extension in IPython.
    575     """
    576     # this modifies ip
    577     SageCustomizations(shell=ip)

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/repl/ipython_extension.py in load_ipython_extension(ip=<sage.repl.interpreter.SageTerminalInteractiveShell object>)
    562     def wrapper(*args, **kwargs):
    563         if not wrapper.has_run:
    564             result = func(*args, **kwargs)
    565             wrapper.has_run = True
    566             return result
    567     wrapper.has_run = False
    568     return wrapper
    569 
    570 
    571 @run_once
    572 def load_ipython_extension(ip):
    573     """
    574     Load the extension in IPython.
    575     """
    576     # this modifies ip
--> 577     SageCustomizations(shell=ip)
        global SageCustomizations = <class 'sage.repl.ipython_extension.SageCustomizations'>
        global shell = undefined
        ip = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f564271eed0>

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/repl/ipython_extension.py in __init__(self=<sage.repl.ipython_extension.SageCustomizations object>, shell=<sage.repl.interpreter.SageTerminalInteractiveShell object>)
    420     def __init__(self, shell=None):
    421         """
    422         Initialize the Sage plugin.
    423         """
    424         self.shell = shell
    425 
    426         self.auto_magics = SageMagics(shell)
    427         self.shell.register_magics(self.auto_magics)
    428 
    429         import sage.misc.edit_module as edit_module
    430         self.shell.set_hook('editor', edit_module.edit_devel)
    431 
    432         self.init_inspector()
    433         self.init_line_transforms()
    434 
--> 435         import sage.all # until sage's import hell is fixed
        sage.all = undefined
    436 
    437         self.shell.verbose_quit = True
    438         self.set_quit_hook()
    439 
    440         self.register_interface_magics()
    441 
    442         if SAGE_IMPORTALL == 'yes':
    443             self.init_environment()
    444 
    445     def register_interface_magics(self):
    446         """
    447         Register magics for each of the Sage interfaces
    448         """
    449         from sage.repl.interface_magic import InterfaceMagic
    450         InterfaceMagic.register_all(self.shell)

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/all.py in <module>()
    104 
    105 from sage.env import SAGE_ROOT, SAGE_SRC, SAGE_DOC_SRC, SAGE_LOCAL, DOT_SAGE, SAGE_ENV
    106 
    107 
    108 ###################################################################
    109 
    110 # This import also sets up the interrupt handler
    111 from cysignals.signals import (AlarmInterrupt, SignalError,
    112         sig_on_reset as sig_on_count)
    113 
    114 from time                import sleep
    115 from functools import reduce  # in order to keep reduce in python3
    116 
    117 import sage.misc.lazy_import
    118 
--> 119 from sage.misc.all       import *         # takes a while
        global sage.misc.all = undefined
    120 from sage.typeset.all    import *
    121 from sage.repl.all       import *
    122 
    123 from sage.misc.sh import sh
    124 
    125 from sage.libs.all       import *
    126 from sage.data_structures.all import *
    127 from sage.doctest.all    import *
    128 
    129 from sage.structure.all  import *
    130 from sage.rings.all      import *
    131 from sage.arith.all      import *
    132 from sage.matrix.all     import *
    133 
    134 from sage.symbolic.all   import *

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/misc/all.py in <module>()
     69 
     70 from .defaults import (set_default_variable_name,
     71                         series_precision, set_series_precision)
     72 
     73 from .sage_eval import sage_eval, sageobj
     74 
     75 from .sage_input import sage_input
     76 
     77 lazy_import("sage.misc.cython", ["cython_lambda", "cython_create_local_so"])
     78 lazy_import("sage.misc.cython", "cython_compile", "cython")
     79 
     80 from .persist import save, load, dumps, loads, db, db_save
     81 
     82 from .func_persist import func_persist
     83 
---> 84 from .functional import (additive_order,
        global functional = undefined
        global additive_order = undefined
        global base_ring = undefined
        global base_field = undefined
        global basis = undefined
        global category = undefined
        global charpoly = undefined
        global characteristic_polynomial = undefined
        global coerce = undefined
        global cyclotomic_polynomial = undefined
        global decomposition = undefined
        global denominator = undefined
        global det = undefined
        global dimension = undefined
        global dim = undefined
        global discriminant = undefined
        global disc = undefined
        global eta = undefined
        global fcp = undefined
        global gen = undefined
        global gens = undefined
        global hecke_operator = undefined
        global image = undefined
        global integral = undefined
        global integrate = undefined
        global integral_closure = undefined
        global interval = undefined
        global xinterval = undefined
        global is_commutative = undefined
        global is_even = undefined
        global is_integrally_closed = undefined
        global is_field = undefined
        global is_odd = undefined
        global kernel = undefined
        global krull_dimension = undefined
        global lift = undefined
        global log = undefined
        global log_b = undefined
        global minimal_polynomial = undefined
        global minpoly = undefined
        global multiplicative_order = undefined
        global ngens = undefined
        global norm = undefined
        global numerator = undefined
        global numerical_approx = undefined
        global n = undefined
        global N = undefined
        global objgens = undefined
        global objgen = undefined
        global order = undefined
        global rank = undefined
        global regulator = undefined
        global round = undefined
        global quotient = undefined
        global quo = undefined
        global isqrt = undefined
        global squarefree_part = undefined
        global symbolic_sum = undefined
        global sum = undefined
        global symbolic_prod = undefined
        global product = undefined
        global transpose = undefined
     85                         base_ring,
     86                         base_field,
     87                         basis,
     88                         category,
     89                         charpoly,
     90                         characteristic_polynomial,
     91                         coerce,
     92                         cyclotomic_polynomial,
     93                         decomposition,
     94                         denominator,
     95                         det,
     96                         dimension,
     97                         dim,
     98                         discriminant,
     99                         disc,

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/misc/functional.py in <module>()
     11 
     12 - David Joyner (2005-12-20): More Examples
     13 """
     14 #*****************************************************************************
     15 #       Copyright (C) 2004 William Stein <wst...@gmail.com>
     16 #
     17 # This program is free software: you can redistribute it and/or modify
     18 # it under the terms of the GNU General Public License as published by
     19 # the Free Software Foundation, either version 2 of the License, or
     20 # (at your option) any later version.
     21 #                  https://www.gnu.org/licenses/
     22 #*****************************************************************************
     23 from __future__ import absolute_import
     24 import builtins
     25 
---> 26 from sage.rings.complex_double import CDF
        global sage.rings.complex_double = undefined
        global CDF = undefined
     27 from sage.rings.real_double import RDF, RealDoubleElement
     28 from sage.rings.integer_ring import ZZ
     29 from sage.rings.integer import Integer
     30 from sage.misc.superseded import deprecation
     31 
     32 ##############################################################################
     33 # There are many functions on elements of a ring, which mathematicians
     34 # usually write f(x), e.g., it is weird to write x.log() and natural
     35 # to write log(x).  The functions below allow for the more familiar syntax.
     36 ##############################################################################
     37 
     38 
     39 def additive_order(x):
     40     """
     41     Return the additive order of ``x``.

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/complex_double.pyx in init sage.rings.complex_double (build/cythonized/sage/rings/complex_double.c:24342)()
     84 cimport sage.rings.integer
     85 
     86 from sage.structure.element cimport RingElement, Element, ModuleElement, FieldElement
     87 from sage.structure.parent  cimport Parent
     88 from sage.structure.parent_gens import ParentWithGens
     89 from sage.structure.richcmp cimport rich_to_bool
     90 from sage.categories.morphism cimport Morphism
     91 from sage.structure.coerce cimport is_numpy_type
     92 
     93 from cypari2.gen cimport Gen as pari_gen
     94 from cypari2.convert cimport new_gen_from_double, new_t_COMPLEX_from_double
     95 
     96 from . import complex_number
     97 
     98 from .complex_field import ComplexField
---> 99 cdef CC = ComplexField()
        global cdef = undefined
        global CC = undefined
        global ComplexField = <function ComplexField at 0x7f541e191560>
    100 
    101 from .real_mpfr import RealField
    102 cdef RR = RealField()
    103 
    104 from .real_double cimport RealDoubleElement, double_repr
    105 from .real_double import RDF
    106 from sage.rings.integer_ring import ZZ
    107 
    108 cimport gmpy2
    109 gmpy2.import_gmpy2()
    110 
    111 def is_ComplexDoubleField(x):
    112     """
    113     Return ``True`` if ``x`` is the complex double field.
    114 

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/complex_field.py in ComplexField(prec=53, names=None)
     99         Complex Field with 53 bits of precision
    100         sage: ComplexField(100)
    101         Complex Field with 100 bits of precision
    102         sage: ComplexField(100).base_ring()
    103         Real Field with 100 bits of precision
    104         sage: i = ComplexField(200).gen()
    105         sage: i^2
    106         -1.0000000000000000000000000000000000000000000000000000000000
    107     """
    108     global cache
    109     if prec in cache:
    110         X = cache[prec]
    111         C = X()
    112         if not C is None:
    113             return C
--> 114     C = ComplexField_class(prec)
        C = undefined
        global ComplexField_class = <class 'sage.rings.complex_field.ComplexField_class'>
        prec = 53
    115     cache[prec] = weakref.ref(C)
    116     return C
    117 
    118 
    119 class ComplexField_class(ring.Field):
    120     """
    121     An approximation to the field of complex numbers using floating
    122     point numbers with any specified precision. Answers derived from
    123     calculations in this approximation may differ from what they would
    124     be if those calculations were performed in the true field of
    125     complex numbers. This is due to the rounding errors inherent to
    126     finite precision calculations.
    127 
    128     EXAMPLES::
    129 

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/complex_field.py in __init__(self=Complex Field with 53 bits of precision, prec=53)
    199             sage: C = ComplexField(200)
    200             sage: C.category()
    201             Join of Category of fields and Category of infinite sets and Category of complete metric spaces
    202             sage: TestSuite(C).run()
    203 
    204             sage: CC.is_field()
    205             True
    206 
    207             sage: CC.is_finite()
    208             False
    209         """
    210         self._prec = int(prec)
    211         from sage.categories.fields import Fields
    212         ParentWithGens.__init__(self, self._real_field(), ('I',), False, category=Fields().Infinite().Metric().Complete())
    213 #        self._populate_coercion_lists_()
--> 214         self._populate_coercion_lists_(coerce_list=[RRtoCC(self._real_field(), self)])
        self._populate_coercion_lists_ = <built-in method _populate_coercion_lists_ of ComplexField_class_with_category object at 0x7f541e16b830>
        global coerce_list = undefined
        global RRtoCC = <class 'sage.rings.complex_number.RRtoCC'>
        self._real_field = <bound method ComplexField_class._real_field of Complex Field with 53 bits of precision>
        self = Complex Field with 53 bits of precision
    215 
    216     def __reduce__(self):
    217         """
    218         For pickling.
    219 
    220         EXAMPLES::
    221 
    222             sage: loads(dumps(ComplexField())) == ComplexField()
    223             True
    224         """
    225         return ComplexField, (self._prec, )
    226 
    227     def is_exact(self):
    228         """
    229         Return whether or not this field is exact, which is always ``False``.

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/complex_number.pyx in sage.rings.complex_number.RRtoCC.__init__ (build/cythonized/sage/rings/complex_number.c:20646)()
   2565 
   2566 cdef class RRtoCC(Map):
   2567 
   2568     cdef ComplexNumber _zero
   2569 
   2570     def __init__(self, RR, CC):
   2571         """
   2572         EXAMPLES::
   2573 
   2574             sage: from sage.rings.complex_number import RRtoCC
   2575             sage: RRtoCC(RR, CC)
   2576             Natural map:
   2577               From: Real Field with 53 bits of precision
   2578               To:   Complex Field with 53 bits of precision
   2579         """
-> 2580         Map.__init__(self, RR, CC)
        global Map.__init__ = undefined
        global self = undefined
        global RR = undefined
        global CC = undefined
   2581         self._zero = ComplexNumber(CC, 0)
   2582         self._repr_type_str = "Natural"
   2583 
   2584     cdef dict _extra_slots(self):
   2585         """
   2586         A helper for pickling and copying.
   2587 
   2588         INPUT:
   2589 
   2590         ``_slots`` -- a dictionary
   2591 
   2592         OUTPUT:
   2593 
   2594         The given dictionary, with zero added.
   2595 

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/categories/map.pyx in sage.categories.map.Map.__init__ (build/cythonized/sage/categories/map.c:3524)()
    110             sage: Map(Hom(QQ, ZZ, Rings()))
    111             Generic map:
    112               From: Rational Field
    113               To:   Integer Ring
    114 
    115         Using domain and codomain::
    116 
    117             sage: Map(QQ['x'], SymmetricGroup(6))
    118             Generic map:
    119               From: Univariate Polynomial Ring in x over Rational Field
    120               To:   Symmetric group of order 6! as a permutation group
    121         """
    122         if codomain is not None:
    123             if isinstance(parent, type):
    124                 parent = Set_PythonType(parent)
--> 125             parent = homset.Hom(parent, codomain)
        global parent = undefined
        global homset.Hom = <function Hom at 0x7f564271f050>
        global codomain = undefined
    126         elif not isinstance(parent, homset.Homset):
    127             raise TypeError("parent (=%s) must be a Homspace" % parent)
    128         Element.__init__(self, parent)
    129         D = parent.domain()
    130         C = parent.codomain()
    131         self._category_for = parent.homset_category()
    132         self._codomain = C
    133         self.domain    = ConstantFunction(D)
    134         self.codomain  = ConstantFunction(C)
    135         self._is_coercion = False
    136         if D.is_exact() and C.is_exact():
    137             self._coerce_cost = 10 # default value.
    138         else:
    139             self._coerce_cost = 10000 # inexact morphisms are bad.
    140 

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/categories/homset.py in Hom(X=Real Field with 53 bits of precision, Y=Complex Field with 53 bits of precision, category=Join of Category of fields and Category of infinite sets and Category of complete metric spaces, check=True)
    381     key = (X,Y,category)
    382     try:
    383         H = _cache[key]
    384     except KeyError:
    385         H = None
    386     if H is not None:
    387         # Return H unless the domain or codomain breaks the unique parent condition
    388         if H.domain() is X and H.codomain() is Y:
    389             return H
    390 
    391     # Determines the category
    392     if category is None:
    393         category = X.category()._meet_(Y.category())
    394         # Recurse to make sure that Hom(X, Y) and Hom(X, Y, category) are identical
    395         # No need to check the input again
--> 396         H = Hom(X, Y, category, check=False)
        H = None
        global Hom = <function Hom at 0x7f564271f050>
        X = Real Field with 53 bits of precision
        Y = Complex Field with 53 bits of precision
        category = Join of Category of fields and Category of infinite sets and Category of complete metric spaces
        check = True
    397     else:
    398         if check:
    399             if not isinstance(category, Category):
    400                 raise TypeError("Argument category (= {}) must be a category.".format(category))
    401             for O in [X, Y]:
    402                 try:
    403                     category_mismatch = O not in category
    404                 except Exception:
    405                     # An error should not happen, this here is just to be on
    406                     # the safe side.
    407                     category_mismatch = True
    408                 # A category mismatch does not necessarily mean that an error
    409                 # should be raised. Instead, it could be the case that we are
    410                 # unpickling an old pickle (that doesn't set the "check"
    411                 # argument to False). In this case, it could be that the

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/categories/homset.py in Hom(X=Real Field with 53 bits of precision, Y=Complex Field with 53 bits of precision, category=Join of Category of fields and Category of infinite sets and Category of complete metric spaces, check=False)
    408                 # A category mismatch does not necessarily mean that an error
    409                 # should be raised. Instead, it could be the case that we are
    410                 # unpickling an old pickle (that doesn't set the "check"
    411                 # argument to False). In this case, it could be that the
    412                 # (co)domain is not properly initialised, which we are
    413                 # checking now. See trac #16275 and #14793.
    414                 if category_mismatch and O._is_category_initialized():
    415                     # At this point, we can be rather sure that O is properly
    416                     # initialised, and thus its string representation is
    417                     # available for the following error message. It simply
    418                     # belongs to the wrong category.
    419                     raise ValueError("{} is not in {}".format(O, category))
    420 
    421         # Construct H
    422         try: # _Hom_ hook from the parent
--> 423             H = X._Hom_(Y, category)
        H = None
        X._Hom_ = <bound method Rings.ParentMethods._Hom_ of Real Field with 53 bits of precision>
        Y = Complex Field with 53 bits of precision
        category = Join of Category of fields and Category of infinite sets and Category of complete metric spaces
    424         except (AttributeError, TypeError):
    425             # Workaround in case the above fails, but the category
    426             # also provides a _Hom_ hook.
    427             # FIXME:
    428             # - If X._Hom_ actually comes from category and fails, it
    429             #   will be called twice.
    430             # - This is bound to fail if X is an extension type and
    431             #   does not actually inherit from category.parent_class
    432             # For join categories, we check all of the direct super
    433             #   categories as the parent_class of the join category is
    434             #   not (necessarily) inherited and join categories do not
    435             #   implement a _Hom_ (see trac #23418).
    436             if not isinstance(category, JoinCategory):
    437                 cats = [category]
    438             else:

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/categories/rings.py in _Hom_(self=Real Field with 53 bits of precision, Y=Complex Field with 53 bits of precision, category=Join of Category of fields and Category of infinite sets and Category of complete metric spaces)
    388             TESTS::
    389 
    390                 sage: Hom(QQ, QQ, category = Rings()).__class__
    391                 <class 'sage.rings.homset.RingHomset_generic_with_category'>
    392 
    393                 sage: Hom(CyclotomicField(3), QQ, category = Rings()).__class__
    394                 <class 'sage.rings.number_field.homset.CyclotomicFieldHomset_with_category'>
    395 
    396                 sage: TestSuite(Hom(QQ, QQ, category = Rings())).run() # indirect doctest
    397 
    398             """
    399             if category is not None and not category.is_subcategory(Rings()):
    400                 raise TypeError("%s is not a subcategory of Rings()"%category)
    401             if Y not in Rings():
    402                 raise TypeError("%s is not a ring"%Y)
--> 403             from sage.rings.homset import RingHomset
        global sage.rings.homset = undefined
        RingHomset = undefined
    404             return RingHomset(self, Y, category = category)
    405 
    406         # this is already in sage.rings.ring.Ring,
    407         # but not all rings descend from that class,
    408         # e.g., matrix spaces.
    409         def _mul_(self, x, switch_sides=False):
    410             """
    411             Multiplication of rings with, e.g., lists.
    412 
    413             NOTE:
    414 
    415             This method is used to create ideals. It is
    416             the same as the multiplication method for
    417             :class:`~sage.rings.ring.Ring`. However, not
    418             all parents that belong to the category of

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/homset.py in <module>()
      4 
      5 #*****************************************************************************
      6 #       Copyright (C) 2006 William Stein <wst...@gmail.com>
      7 #
      8 #  Distributed under the terms of the GNU General Public License (GPL)
      9 #
     10 #                  http://www.gnu.org/licenses/
     11 #*****************************************************************************
     12 from __future__ import absolute_import
     13 
     14 from sage.categories.homset import HomsetWithBase
     15 from sage.categories.rings import Rings
     16 _Rings = Rings()
     17 
     18 from . import morphism
---> 19 from . import quotient_ring
        global quotient_ring = undefined
     20 
     21 def is_RingHomset(H):
     22     """
     23     Return ``True`` if ``H`` is a space of homomorphisms between two rings.
     24 
     25     EXAMPLES::
     26 
     27         sage: from sage.rings.homset import is_RingHomset as is_RH
     28         sage: is_RH(Hom(ZZ, QQ))
     29         True
     30         sage: is_RH(ZZ)
     31         False
     32         sage: is_RH(Hom(RR, CC))
     33         True
     34         sage: is_RH(Hom(FreeModule(ZZ,1), FreeModule(QQ,1)))

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/quotient_ring.py in <module>()
     99 """
    100 #*****************************************************************************
    101 #       Copyright (C) 2005 William Stein <wst...@gmail.com>
    102 #
    103 # This program is free software: you can redistribute it and/or modify
    104 # it under the terms of the GNU General Public License as published by
    105 # the Free Software Foundation, either version 2 of the License, or
    106 # (at your option) any later version.
    107 #                  http://www.gnu.org/licenses/
    108 #*****************************************************************************
    109 
    110 from __future__ import absolute_import
    111 
    112 import sage.misc.latex as latex
    113 from . import ring, ideal, quotient_ring_element
--> 114 import sage.rings.polynomial.multi_polynomial_ideal
        global sage.rings.polynomial.multi_polynomial_ideal = undefined
    115 from sage.structure.category_object import normalize_names
    116 from sage.structure.richcmp import richcmp_method, richcmp
    117 import sage.structure.parent_gens
    118 from sage.interfaces.singular import singular as singular_default, is_SingularElement
    119 from sage.misc.cachefunc import cached_method
    120 from sage.categories.rings import Rings
    121 from sage.categories.commutative_rings import CommutativeRings
    122 
    123 def QuotientRing(R, I, names=None):
    124     r"""
    125     Creates a quotient ring of the ring `R` by the twosided ideal `I`.
    126 
    127     Variables are labeled by ``names`` (if the quotient ring is a quotient
    128     of a polynomial ring).  If ``names`` isn't given, 'bar' will be appended
    129     to the variable names in `R`.

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py in <module>()
    222 #       Copyright (C) 2008,2009 Martin Albrecht <ma...@informatik.uni-bremen.de>
    223 #
    224 #  Distributed under the terms of the GNU General Public License (GPL)
    225 #
    226 #    This code is distributed in the hope that it will be useful,
    227 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
    228 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    229 #    General Public License for more details.
    230 #
    231 #  The full text of the GPL is available at:
    232 #
    233 #                  http://www.gnu.org/licenses/
    234 #*****************************************************************************
    235 from __future__ import print_function
    236 
--> 237 from sage.interfaces.all import (singular as singular_default,
        global sage.interfaces.all = undefined
        global singular = undefined
        global singular_default = undefined
        global macaulay2 = undefined
        global macaulay2_default = undefined
        global magma = undefined
        global magma_default = undefined
    238                                  macaulay2 as macaulay2_default,
    239                                  magma as magma_default)
    240 
    241 from sage.interfaces.expect import StdOutContext
    242 
    243 from sage.rings.ideal import Ideal_generic
    244 from sage.rings.noncommutative_ideals import Ideal_nc
    245 from sage.rings.integer import Integer
    246 from sage.structure.sequence import Sequence
    247 from sage.structure.richcmp import (richcmp_method, op_EQ, op_NE,
    248                                     op_LT, op_GT, op_LE, op_GE, rich_to_bool)
    249 from sage.misc.cachefunc import cached_method
    250 from sage.misc.all import prod, verbose, get_verbose
    251 from sage.misc.method_decorator import MethodDecorator
    252 

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/interfaces/all.py in <module>()
     17 from .gnuplot import gnuplot
     18 from .kash import  kash, kash_version, Kash
     19 from .lisp import lisp, Lisp
     20 from .magma import magma, Magma
     21 from .magma_free import magma_free
     22 from .macaulay2 import macaulay2, Macaulay2
     23 from .maple import maple, Maple
     24 from .maxima import maxima, Maxima
     25 # import problems
     26 #from maxima_lib import maxima_lib
     27 from .mathematica import mathematica, Mathematica
     28 from .matlab import matlab, matlab_version, Matlab
     29 from .mupad import mupad, Mupad  # NOT functional yet
     30 from .mwrank import mwrank, Mwrank
     31 from .octave import octave, Octave
---> 32 from .polymake import polymake
        global polymake = undefined
     33 from .qepcad import qepcad, qepcad_version, qepcad_formula
     34 from .qsieve import qsieve
     35 from .singular import singular, singular_version, Singular
     36 from .sage0 import sage0 as sage0, sage0_version, Sage
     37 from .scilab import scilab
     38 from .tachyon import tachyon_rt
     39 from .psage import PSage
     40 from .ecm import ECM, ecm
     41 from .povray import povray
     42 from .lie import lie, LiE
     43 from .r import r, R, r_version
     44 from .read_data import read_data
     45 
     46 interfaces = ['gap', 'gap3', 'giac', 'gp', 'mathematica', 'gnuplot', \
     47               'kash', 'magma', 'macaulay2', 'maple', 'maxima', \

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/interfaces/polymake.py in <module>()
   2626     Returns the polymake interface object defined in :mod:`sage.interfaces.polymake`.
   2627 
   2628     EXAMPLES::
   2629 
   2630         sage: from sage.interfaces.polymake import reduce_load_Polymake
   2631         sage: reduce_load_Polymake()
   2632         Polymake
   2633     """
   2634     return polymake
   2635 
   2636 
   2637 polymake_expect = PolymakeExpect()
   2638 
   2639 polymake_jupymake = PolymakeJuPyMake()
   2640 
-> 2641 from sage.features import PythonModule
        global sage.features = undefined
        global PythonModule = undefined
   2642 if PythonModule("JuPyMake").is_present():
   2643     polymake = polymake_jupymake
   2644 else:
   2645     polymake = polymake_expect

/usr/local/sage-exp/local/lib/python3.7/site-packages/sage/features/__init__.py in <module>()
     40 
     41     sage: Executable(name="sh", executable="sh").require()
     42 
     43     sage: Executable(name="random", executable="randomOochoz6x", spkg="random", url="http://rand.om").require()
     44     Traceback (most recent call last):
     45     ...
     46     FeatureNotPresentError: random is not available.
     47     Executable 'randomOochoz6x' not found on PATH.
     48     To install random you can try to run 'sage -i random'.
     49     Further installation instructions might be available at http://rand.om.
     50 
     51 As can be seen above, features try to produce helpful error messages.
     52 """
     53 
     54 import os
---> 55 from distutils.errors import CCompilerError
        global distutils.errors = undefined
        global CCompilerError = undefined
     56 from distutils.spawn import find_executable
     57 
     58 from sage.env import SAGE_SHARE
     59 
     60 
     61 class TrivialClasscallMetaClass(type):
     62     """
     63     A trivial version of :class:`ClasscallMetaclass` without Cython dependencies.
     64     """
     65     def __call__(cls, *args, **kwds):
     66         r"""
     67         This method implements ``cls(<some arguments>)``.
     68         """
     69         if hasattr(cls, '__classcall__'):
     70             return cls.__classcall__(cls, *args, **kwds)

ModuleNotFoundError: No module named 'distutils.errors'

**********************************************************************

Oops, Sage crashed. We do our best to make it stable, but...

A crash report was automatically generated with the following information:
  - A verbatim copy of the crash traceback.
  - A copy of your input history during this session.
  - Data on your current Sage configuration.

It was left in the file named:
'/home/charpent/.sage/ipython-5.0.0/Sage_crash_report.txt'
If you can email this file to the developers, the information in it will help
them in understanding and correcting the problem.

You can mail it to: sage-support at sage-s...@googlegroups.com
with the subject 'Sage Crash Report'.

If you want to do it now, the following command will work (under Unix):
mail -s 'Sage Crash Report' sage-s...@googlegroups.com < /home/charpent/.sage/ipython-5.0.0/Sage_crash_report.txt

In your email, please also include information about:
- The operating system under which the crash happened: Linux, macOS, Windows,
  other, and which exact version (for example: Ubuntu 16.04.3, macOS 10.13.2,
  Windows 10 Pro), and whether it is 32-bit or 64-bit;
- How Sage was installed: using pip or conda, from GitHub, as part of
  a Docker container, or other, providing more detail if possible;
- How to reproduce the crash: what exact sequence of instructions can one
  input to get the same crash? Ideally, find a minimal yet complete sequence
  of instructions that yields the crash.

To ensure accurate tracking of this issue, please file a report about it at:

Hit <Enter> to quit (your terminal may close):

The Sage_crash_report is attached.

The big fat hint is :

ModuleNotFoundError: No module named 'distutils.errors'

ISTR that my morning upgrade of Debian involved some (system) Python packages upgrade, but I didn't notice any problem during this upgrade.

Suggestions for unhosing this system ?

Sage_crash_report.txt

Dima Pasechnik

unread,
Jun 8, 2020, 3:00:43 AM6/8/20
to sage-support
any update of a library used in Sage has potential for causing this. 

whether you can get away with a small rebuild, is another question.

Emmanuel Charpentier

unread,
Jun 8, 2020, 3:01:48 AM6/8/20
to sage-support
I forgot to specify that my Sage installation is compiled from source.

HTH,

Emmanuel Charpentier

unread,
Jun 8, 2020, 3:10:11 AM6/8/20
to sage-support


Le lundi 8 juin 2020 09:00:43 UTC+2, Dima Pasechnik a écrit :
any update of a library used in Sage has potential for causing this. 

Aaaarghhh... This makes Sage extremely brittle...

I'll try `sage -b`, then `make`, and keep you posted.

[ Snip... ]

Dima Pasechnik

unread,
Jun 8, 2020, 3:16:21 AM6/8/20
to sage-support
the end of your attachment suggests

sage -f random

for some reason

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/b0910bef-c613-4eee-ae66-42fb3202009co%40googlegroups.com.

Emmanuel Charpentier

unread,
Jun 8, 2020, 6:40:01 AM6/8/20
to sage-support
This didn't work (make failed to find a target for "random-clean") ; furthermore, Sage displayed a "failure to build Sage" notice at further attempts.

In fact, nothing worked short of "make distclean ; ./configure ; make", which mercifully worked with apparent success...

Le lundi 8 juin 2020 09:16:21 UTC+2, Dima Pasechnik a écrit :
the end of your attachment suggests

sage -f random

for some reason

[ Snip... ]

HTH,
 
Reply all
Reply to author
Forward
0 new messages