Index: generic/nsf.c =================================================================== diff -u -r8fd1f04745ab17b9091fda6a5ae7c6cae4750a8c -rdc8041e12624cd5102fe91ead6bdcaef0117e1cc --- generic/nsf.c (.../nsf.c) (revision 8fd1f04745ab17b9091fda6a5ae7c6cae4750a8c) +++ generic/nsf.c (.../nsf.c) (revision dc8041e12624cd5102fe91ead6bdcaef0117e1cc) @@ -13970,6 +13970,22 @@ rst = RUNTIME_STATE(interp); /* + * If for some strange reason the runtime state is already deleted, don't + * crash. + */ + if (unlikely(rst == NULL)) { + + if ((Tcl_Interp_flags(interp) & DELETED)) { + return TCL_OK; + } + } + /* + * In all other cases (aside of the DELETED interp), we expect a runtime + * state. If this is violated, flag this via exception in development mode. + */ + assert(rst != NULL); + + /* * Don't call destroy after exit handler started physical * destruction, or when it was called already before */