Skip to content

Commit 9862c18

Browse files
committed
src/sage/doctest/control.py: log cysignals crashes to the default path
Our doctest controller is overriding the value of CYSIGNALS_CRASH_LOGS to save any crash logs arising from a doctest in a tmp_dir(). At some point in the past, these "temporary" logs would have been somewhat permanent: the tmp_dir() function did not clean up after itself, and there were no tmpfiles.d entries to prune /tmp before a reboot. But both of these circumstances have changed, meaning that the crash logs now lie in the convex hull of very and extremely temporary. For consistency, it makes more sense to place the doctest crash logs in the same place as the "regular" crash logs. Doctest crashes can be important too, and if they are worth retaining at all, they are worth retaining beyond the end of the sage session, or a reboot, or ten days, etc. They should also be a rare occurrence. Moreover if the logs were never meant to be kept, i.e. if they were truly meant to be temporary, that could have been achieved with CYSIGNALS_CRASH_LOGS="". It was not; so in that sense, using the default location restores the intended behavior. This commit removes the override, causing the crash logs to be saved to whatever the current value of CYSIGNALS_CRASH_LOGS is, or to the current working directory as a fallback. (These are cysignals implementation details.) Note that the sage-env script sets CYSIGNALS_CRASH_LOGS to $DOT_SAGE/crash_logs, so for typical sage users these logs will be saved there.
1 parent 94fe540 commit 9862c18

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/sage/doctest/control.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
from sage.doctest.util import Timer, count_noun, dict_difference
5656
from sage.env import DOT_SAGE, SAGE_EXTCODE, SAGE_LIB, SAGE_SRC
5757
from sage.misc import randstate
58-
from sage.misc.temporary_file import tmp_dir
5958
from sage.structure.sage_object import SageObject
6059

6160
# Optional tags which are always automatically added
@@ -1368,8 +1367,6 @@ def run_val_gdb(self, testing=False):
13681367
return
13691368

13701369
# Setup signal handlers.
1371-
# Save crash logs in temporary directory.
1372-
os.putenv('CYSIGNALS_CRASH_LOGS', tmp_dir("crash_logs_"))
13731370
init_cysignals()
13741371

13751372
import signal

0 commit comments

Comments
 (0)