#8784 closed defect (fixed)
remove quit_sage() command from all.py top level
Reported by:  was  Owned by:  jason 

Priority:  major  Milestone:  sage9.6 
Component:  misc  Keywords:  
Cc:  Merged in:  
Authors:  Michael Orlitzky  Reviewers:  Dima Pasechnik 
Report Upstream:  N/A  Work issues:  
Branch:  ef89f43 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description
It is stupid that it is this easy to accidentally destabilize and segfault Sage. Also, having a function "quit_sage()" available at the sage: prompt by default that does not quit sage, is dumb.
wstein@boxen:~/build/sage4.4$ ./sage   Sage Version 4.4, Release Date: 20100424   Type notebook() for the GUI, and license() for information.   sage: quit_sage() Exiting Sage (CPU time 0m0.04s, Wall time 0m3.16s). sage: quit Exiting Sage (CPU time 0m0.07s, Wall time 0m4.80s). /virtual/scratch/wstein/build/sage4.4/local/bin/sagesage: line 206: 11559 Segmentation fault sageipython "$@" i wstein@boxen:~/build/sage4.4$
The fix is to rename quit_sage() somehow and change *all* code that calls it.
Change History (17)
comment:1 Changed 12 years ago by
comment:2 Changed 9 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:3 Changed 9 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:4 Changed 8 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:5 Changed 8 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:6 Changed 7 months ago by
 Branch set to u/mjo/ticket/8784
 Commit set to b2d1032755b54c5624ea503e2cbbbc5a1dea981d
 Status changed from new to needs_review
Now all of the cleanup happens automatically and quit_sage()
is a noop:
sage: quit_sage() <ipythoninput1ce1781e96a1f>:1: DeprecationWarning: quit_sage is deprecated and now does nothing; please simply delete it See http://trac.sagemath.org/8784 for details. quit_sage() sage:
New commits:
94dcf5c  Trac #8784: clean up after symmetrica when sage exits.

7890d1b  Trac #8784: clean up after m4ri when sage exits.

0cd365d  Trac #8784: free the flint stack when sage terminates.

ebeb316  Trac #8784: free the integer pool when sage exits.

b7ae30f  Trac #8784: clear quaternion algebra globals when sage exits.

15182f2  Trac #8784: cdef two internal quaternion functions.

eaf3978  Trac #8784: quit pexpect processes when sage terminates.

b2d1032  Trac #8784: deprecate quit_sage().

comment:7 Changed 7 months ago by
 Milestone changed from sage6.4 to sage9.6
comment:8 followups: ↓ 9 ↓ 10 Changed 6 months ago by
Does this mean that sagecleaner
may go, too?
comment:9 in reply to: ↑ 8 Changed 6 months ago by
Replying to dimpase:
Does this mean that
sagecleaner
may go, too?
Not yet, although that's another longterm goal of mine. sagecleaner also cleans up "temporary" files, which it wouldn't have to do if we used the OS's builtin tempfile functions instead of our homegrown SAGE_TMP
. The first and easiest part of that cleanup is #33213.
comment:10 in reply to: ↑ 8 Changed 6 months ago by
comment:11 Changed 5 months ago by
 Reviewers set to Dima Pasechnik
 Status changed from needs_review to positive_review
OK, looks and tests good.
comment:12 Changed 5 months ago by
perhaps you want to rebase on the latest beta
comment:13 Changed 5 months ago by
 Commit changed from b2d1032755b54c5624ea503e2cbbbc5a1dea981d to ef89f43d374691171c23b8296e6737efcc72dedb
 Status changed from positive_review to needs_review
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:
7abf04d  Trac #8784: clean up after symmetrica when sage exits.

3424071  Trac #8784: clean up after m4ri when sage exits.

a053757  Trac #8784: free the flint stack when sage terminates.

4f5a56d  Trac #8784: free the integer pool when sage exits.

1bf07ff  Trac #8784: clear quaternion algebra globals when sage exits.

1f86192  Trac #8784: cdef two internal quaternion functions.

75e7ccb  Trac #8784: quit pexpect processes when sage terminates.

ef89f43  Trac #8784: deprecate quit_sage().

comment:14 Changed 4 months ago by
 Status changed from needs_review to positive_review
oops, overlooked this, sorry. Looks good.
comment:15 Changed 4 months ago by
 Branch changed from u/mjo/ticket/8784 to ef89f43d374691171c23b8296e6737efcc72dedb
 Resolution set to fixed
 Status changed from positive_review to closed
comment:16 Changed 4 months ago by
 Commit ef89f43d374691171c23b8296e6737efcc72dedb deleted
Follow up in #33706.
comment:17 Changed 3 weeks ago by
We have a complaint about ipython processes staying alive in a patchbot. https://groups.google.com/d/msgid/sagedevel/20220717160807.GA13671%40metelu.net
Could it be due to this ticket, perhaps the change for src/sage/repl/ipython_extension.py
was an overkill?
Maybe rename it to "sage_library_cleanup"?