Is this new behaviour?

206 views
Skip to first unread message

Martin R

unread,
Jun 8, 2026, 12:17:36 PMJun 8
to sage-devel
sage: limit(x^(1/sqrt(x)), x=0)

Condition of type: SIMPLE-CONDITION
Undefined limit product $MINF * $ZEROA in lim-times
Available restarts:

1. (CONTINUE) Return from BREAK.

Top level in: #<process TOP-LEVEL 0x7d78c784bf80>.
>

OHappyDay

unread,
Jun 12, 2026, 8:17:22 AMJun 12
to sage-devel
10.8 seems to behave the same way. Also the appimages show the same behaviour.

After pressing CTRL-D I get this dump:

sage: limit(x^(1/sqrt(x)),x=0)

Condition of type: SIMPLE-CONDITION
Undefined limit product $MINF * $ZEROA in lim-times
Available restarts:

1. (CONTINUE) Return from BREAK.

Top level in: #<process TOP-LEVEL 0x78caab987f80>.
>  
------------------------------------------------------------------------
/datadisk/apps/sage-10.9/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/cysignals/signals.cpython-312-x86_64-linux-gnu.so(+0x8754)[0x78cb041e5754]
/datadisk/apps/sage-10.9/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/cysignals/signals.cpython-312-x86_64-linux-gnu.so(+0x8816)[0x78cb041e5816]
/datadisk/apps/sage-10.9/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/cysignals/signals.cpython-312-x86_64-linux-gnu.so(+0x8bea)[0x78cb041e5bea]
/lib/x86_64-linux-gnu/libc.so.6(+0x45330)[0x78cb04245330]
python3(PyException_GetTraceback+0x4)[0x552fa4]
python3(PyTraceBack_Here+0x28)[0x610798]
/datadisk/apps/sage-10.9/build/sage-distro/src/sage/libs/ecl.cpython-312-x86_64-linux-gnu.so(+0xfddd)[0x78caaba5cddd]
/datadisk/apps/sage-10.9/build/sage-distro/src/sage/libs/ecl.cpython-312-x86_64-linux-gnu.so(+0x17858)[0x78caaba64858]
python3(_PyObject_MakeTpCall+0x75)[0x5492b5]
python3(_PyEval_EvalFrameDefault+0xa89)[0x5d7389]
python3(PyEval_EvalCode+0x15b)[0x5d58bb]
python3[0x5d36ac]
python3[0x58206d]
python3(PyObject_Vectorcall+0x35)[0x549cb5]
python3(_PyEval_EvalFrameDefault+0xa89)[0x5d7389]
python3[0x555caf]
python3[0x551a54]
python3(PyObject_Vectorcall+0x35)[0x549cb5]
python3(_PyEval_EvalFrameDefault+0xa89)[0x5d7389]
python3(PyEval_EvalCode+0x15b)[0x5d58bb]
python3[0x608b52]
python3[0x6b5263]
python3(_PyRun_SimpleFileObject+0x1aa)[0x6b4fca]
python3(_PyRun_AnyFileObject+0x4f)[0x6b4dff]
python3(Py_RunMain+0x3b5)[0x6bce65]
python3(Py_BytesMain+0x2d)[0x6bc94d]
/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca)[0x78cb0422a1ca]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b)[0x78cb0422a28b]
python3(_start+0x25)[0x657b05]
------------------------------------------------------------------------
Attaching gdb to process id 21281.
GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
   <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
[New LWP 21411]
[New LWP 21410]
[New LWP 21409]
[New LWP 21408]
[New LWP 21407]
[New LWP 21406]
[New LWP 21405]
[New LWP 21404]
[New LWP 21403]
[New LWP 21402]
[New LWP 21401]
[New LWP 21400]
[New LWP 21399]
[New LWP 21398]
[New LWP 21397]
[New LWP 21393]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x000078cb04310813 in __GI___wait4 (pid=21413, stat_loc=stat_loc@entry=0x0,  
   options=options@entry=0, usage=usage@entry=0x0)
   at ../sysdeps/unix/sysv/linux/wait4.c:30

Stack backtrace
---------------
   stat_loc=stat_loc@entry=0x0, options=options@entry=0,  
   usage=usage@entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
       sc_ret = -512
       sc_cancel_oldtype = 0
       sc_ret = <optimized out>
#1  0x000078cb0431091b in __GI___waitpid (pid=<optimized out>,  
   stat_loc=stat_loc@entry=0x0, options=options@entry=0)
   at ./posix/waitpid.c:38
No locals.
#2  0x000078cb041e587d in print_enhanced_backtrace ()
   at ../src/cysignals/implementation.c:780
       parent_pid = 21281
       pid = <optimized out>
#3  sigdie (sig=sig@entry=11,  
   s=s@entry=0x78cb041ec6a0 "Unhandled SIGSEGV: A segmentation fault occurred.") at ../src/cysignals/implementation.c:806
No locals.
#4  0x000078cb041e5bea in sigdie_for_sig (inside=0, sig=11)
   at ../src/cysignals/implementation.c:262
No locals.
#5  cysigs_signal_handler (sig=11) at ../src/cysignals/implementation.c:464
       inside = <optimized out>
#6  <signal handler called>
No locals.
#7  0x0000000000552fa4 in PyException_GetTraceback ()
No symbol table info available.
#8  0x0000000000610798 in PyTraceBack_Here ()
No symbol table info available.
#9  0x000078caaba5cddd in __Pyx_AddTraceback (funcname=<optimized out>,  
   py_line=828, filename=<optimized out>, c_line=<optimized out>)
   at src/sage/libs/ecl.cpython-312-x86_64-linux-gnu.so.p/src/sage/libs/ecl.pyx.c:21512
       py_code = 0x78caabaa4e00
       py_frame = 0x78caac5cea70
       tstate = <optimized out>
       ptype = <optimized out>
       pvalue = <optimized out>
       ptraceback = <optimized out>
       bad = <optimized out>
#10 0x000078caaba64858 in __pyx_pf_4sage_4libs_3ecl_9EclObject_14__call__ (
   __pyx_v_args=0x78caabc71720, __pyx_v_self=0x78caac6fa0a0)
   at src/sage/libs/ecl.cpython-312-x86_64-linux-gnu.so.p/src/sage/libs/ecl.pyx.c:11079
       __pyx_v_lispargs = 0x78caac50c6c0
       __pyx_t_3 = 0x0
       __pyx_clineno = 0
       __pyx_r = 0x0
       __pyx_t_1 = 0x0
       __pyx_t_4 = 1
       __pyx_filename = 0x78caaba6c4d0 "sage/libs/ecl.pyx"
       __pyx_L1_error = <optimized out>
       __pyx_t_2 = 0x0
       __pyx_t_5 = <optimized out>
       __pyx_lineno = 828
       __pyx_L0 = <optimized out>
       __pyx_v_lispargs = <optimized out>
       __pyx_r = <optimized out>
       __pyx_t_1 = <optimized out>
       __pyx_t_2 = <optimized out>
       __pyx_t_3 = <optimized out>
       __pyx_t_4 = <optimized out>
       __pyx_t_5 = <optimized out>
       __pyx_lineno = <optimized out>
       __pyx_filename = <optimized out>
       __pyx_clineno = <optimized out>
       __pyx_L1_error = <optimized out>
       __pyx_L0 = <optimized out>
       __pyx_callargs = <optimized out>
#11 __pyx_pw_4sage_4libs_3ecl_9EclObject_15__call__ (
   __pyx_v_self=0x78caac6fa0a0, __pyx_args=0x78caabc71720,  
   __pyx_kwds=<optimized out>)
   at src/sage/libs/ecl.cpython-312-x86_64-linux-gnu.so.p/src/sage/libs/ecl.pyx.c:11007
       __pyx_v_args = 0x78caabc71720
       __pyx_nargs = <optimized out>
       __pyx_kwvalues = 0x0
       __pyx_r = 0x0
       __pyx_kwds_len = <optimized out>
#12 0x00000000005492b5 in _PyObject_MakeTpCall ()
No symbol table info available.
#13 0x00000000005d7389 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#14 0x00000000005d58bb in PyEval_EvalCode ()
No symbol table info available.
#15 0x00000000005d36ac in ?? ()
No symbol table info available.
#16 0x000000000058206d in ?? ()
No symbol table info available.
#17 0x0000000000549cb5 in PyObject_Vectorcall ()
No symbol table info available.
#18 0x00000000005d7389 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#19 0x0000000000555caf in ?? ()
No symbol table info available.
#20 0x0000000000551a54 in ?? ()
No symbol table info available.
#21 0x0000000000549cb5 in PyObject_Vectorcall ()
No symbol table info available.
#22 0x00000000005d7389 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#23 0x00000000005d58bb in PyEval_EvalCode ()
No symbol table info available.
#24 0x0000000000608b52 in ?? ()
No symbol table info available.
#25 0x00000000006b5263 in ?? ()
No symbol table info available.
#26 0x00000000006b4fca in _PyRun_SimpleFileObject ()
No symbol table info available.
#27 0x00000000006b4dff in _PyRun_AnyFileObject ()
No symbol table info available.
#28 0x00000000006bce65 in Py_RunMain ()
No symbol table info available.
#29 0x00000000006bc94d in Py_BytesMain ()
No symbol table info available.
#30 0x000078cb0422a1ca in __libc_start_call_main (main=main@entry=0x518c60,  
   argc=argc@entry=3, argv=argv@entry=0x7ffe2f3eec18)
   at ../sysdeps/nptl/libc_start_call_main.h:58
       self = <optimized out>
       result = <optimized out>
       unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140729691073560,  
               5895170405948743079, 3, 0, 10649040, 132813347000320,  
               5895170405963423143, 6892069254013279655},  
             mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x3,  
             0x7ffe2f3eec10}, data = {prev = 0x0, cleanup = 0x0,  
             canceltype = 3}}}
       not_first_call = <optimized out>
#31 0x000078cb0422a28b in __libc_start_main_impl (main=0x518c60, argc=3,  
   argv=0x7ffe2f3eec18, init=<optimized out>, fini=<optimized out>,  
   rtld_fini=<optimized out>, stack_end=0x7ffe2f3eec08)
   at ../csu/libc-start.c:360
No locals.
#32 0x0000000000657b05 in _start ()
No symbol table info available.
[Inferior 1 (process 21281) detached]
Warnung: 30     ../sysdeps/unix/sysv/linux/wait4.c: Datei oder Verzeichnis nicht gefunden
Python Exception <class 'ModuleNotFoundError'>: No module named 'Cython'
Error occurred in Python: No module named 'Cython'
Saved trace to /home/klaus/.sage/crash_logs/crash_g8vo06r7.log
------------------------------------------------------------------------
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.
------------------------------------------------------------------------
Speicherzugriffsfehler (Speicherabzug geschrieben)


Martin R

unread,
Jun 12, 2026, 4:08:46 PMJun 12
to sage-devel
I can now confirm that this is also present in sage 8.0 (!).

Antonio Rojas

unread,
Jun 12, 2026, 4:35:05 PMJun 12
to sage-devel
Works fine with system maxima 5.49, so will likely be fixed by https://github.com/sagemath/sage/pull/41879

Martin R

unread,
Jun 13, 2026, 6:49:11 PMJun 13
to sage-devel
I don't see what this has to do with system maxima.  For example, in sagemath 8.0 (via docker), I have


sage: maxima.console()
;;; Loading #P"/opt/sage/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/opt/sage/local/lib/ecl/sockets.fas"
;;; Loading #P"/opt/sage/local/lib/ecl/defsystem.fas"
;;; Loading #P"/opt/sage/local/lib/ecl/cmp.fas"
Maxima 5.39.0 http://maxima.sourceforge.net
using Lisp ECL 16.1.2
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) limit(x^(1/sqrt(x)), x, 0);
                                          1
                                       -------
                                       sqrt(x)
(%o1)                           limit  x
                               x -> 0
(%i2)

Nils Bruin

unread,
Jun 14, 2026, 2:28:25 AMJun 14
to sage-devel
It is a maxima issue, but one that probably only arises from the particular setting sage makes for maxima. With maxima 5.47.0 on ecl 24.5.10:

sage: maxima_calculus("limit(x^(1/sqrt(x)), x, 0);")
Condition of type: SIMPLE-CONDITION
Undefined limit product $MINF * $ZEROA in lim-times

That string gets passed directly to maxima's parser (in the context of the maxima_calculus settings that sage uses), so that excludes subtle translation errors from sage to maxima. If 5.49.0 does this OK, it's clearly a bug that is solved.

Nils Bruin

unread,
Jun 14, 2026, 2:52:06 AMJun 14
to sage-devel

Martin R

unread,
Jun 14, 2026, 4:29:28 AMJun 14
to sage-devel
But it shouldn't crash sage.  Why is

Condition of type: SIMPLE-CONDITION
Undefined limit product $MINF * $ZEROA in lim-times

not caught?

Actually, on my computer, ubuntu 24.04,

sage: maxima.version()
'5.47.0'

sage: maxima_calculus("limit(x^(1/sqrt(x)), x, 0);")

Condition of type: SIMPLE-CONDITION
Undefined limit product $MINF * $ZEROA in lim-times
Available restarts:

1. (CONTINUE) Return from BREAK.

Top level.
> :exit

ends in a segfault, whereas I have

sage: maxima_calculus("limit(x^(1/x), x, 0);")

;;;
;;; Detected access to protected memory, also known as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

with the last message repeating forever.

Martin

Nils Bruin

unread,
Jun 14, 2026, 10:00:29 AMJun 14
to sage-devel
Normally, code should run in ecl in such a way that conditions (that's what "raised errors" are called in CL) are caught. This happens in


and lines below it. I don't know why it doesn't work here. Perhaps SIMPLE-CONDITION is normally not raised and somehow isn't detected by the guard? It will be a tough bug to debug since the underlying maxima bug is going to be resolved.

We should be using ECL in such a way that we catch the errors we're supposed to catch. So then it becomes a question "is maxima supposed to raise this condition"? You can argue either way for whether we should try and investigate and change how we're using ECL. You can file a ticket and work on it or perhaps there's someone else who thinks it's a fun project. It's pretty deep down, though, so relatively intimidating to work on.

Nils Bruin

unread,
Jun 14, 2026, 7:25:51 PMJun 14
to sage-devel
The error in question does get raised with a special routine:

(defun tay-error ...

Normally it would execute an `merror which is how most maxima errors are raised. We execute our maxima code inside a "(with-$error", which normally means a condition gets raised we can intercept (normally, maxima would drop into its own interactive debugging environment).

However, there is a "taylor-silent-flag" (which, when querying the environment indeed seems to be set to T) there that changes the behaviour to a catch/throw. Perhaps the catch/throw ends up escaping the condition-catch somehow. It's a little strange because a SIMPLE-CONDITION is a CONDITION so the SHOULD be caught. Perhaps that an uncaught catch/throw somehow breaks through the HANDLE-CONDITION and then raises a SIMPLE-CONDITION somehow?

I think this can count as an error in maxima (if my assessment is correct): code there should only set taylor-silent-flag if it actually sets up a catch for it. One shouldn't leak throws.

Martin R

unread,
Jun 15, 2026, 5:05:17 AMJun 15
to sage-devel
Could you share this with the maxima people?  (I am not on their mailing list, is there someone around who is?)  I think, if the fix is not too hard, it would be good to do it.

Martin
Reply all
Reply to author
Forward
0 new messages