Opened 6 months ago

Closed 6 months ago

#32843 closed defect (invalid)

Saving and loading expressions with symbolic functions makes print crash

Reported by: rburing Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: symbolics Keywords: save, load, function, expression, print
Cc: Merged in:
Authors: Reviewers: Michael Orlitzky
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


The following innocent code crashes SageMath 9.4 as well as 9.5.beta5:

f = function('f')(x)
save(f, 'f')
f = load('f.sobj')


TypeError                                 Traceback (most recent call last)
~/Downloads/sage-9.5.beta5/local/var/lib/sage/venv-python3.7/lib/python3.7/site-packages/sage/symbolic/pynac_impl.pxi in sage.symbolic.expression.py_print_function_pystring (build/cythonized/sage/symbolic/expression.cpp:10229)()
    499         olist = [func._name]
    500     olist.extend(['(', ', '.join(map(repr, args)), ')'])
--> 501     return ''.join(olist)
    503 cdef stdstring* py_print_function(unsigned id, args):

TypeError: sequence item 0: expected str instance, bytes found
Unhandled SIGSEGV: A segmentation fault occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
Segmentation Fault

Originally reported in Ask SageMath question #59632.

Change History (3)

comment:1 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.5 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

dup of #30018

comment:2 Changed 6 months ago by mjo

  • Reviewers set to Michael Orlitzky
  • Status changed from needs_review to positive_review

comment:3 Changed 6 months ago by mkoeppe

  • Resolution set to invalid
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.