Opened 9 years ago

Closed 8 years ago

#14029 closed enhancement (fixed)

Exit Sage ungracefully upon SIGQUIT

Reported by: jdemeyer Owned by: jdemeyer
Priority: major Milestone: sage-5.13
Component: c_lib Keywords:
Cc: leif, pbruin Merged in: sage-5.13.beta2
Authors: Jeroen Demeyer Reviewers: Peter Bruin
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #13908, #13996 Stopgaps:

Status badges

Description (last modified by jdemeyer)

When Sage is somehow totally stuck, one can still quit Sage using SIGQUIT (CTRL-\ on the keyboard). It would be useful if this would give a nice traceback. In other words: treat SIGQUIT like SIGSEGV, except that it should always exit Sage, never raise an exception.

Attachments (1)

14029_SIGQUIT.patch (10.5 KB) - added by jdemeyer 9 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from SIGQUIT: exit Sage ungracefully with traceback to Exit Sage ungracefully upon SIGQUIT

comment:2 Changed 9 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Dependencies changed from #13908 to #13908, #13996

comment:3 Changed 9 years ago by jdemeyer

  • Status changed from new to needs_review

Changed 9 years ago by jdemeyer

comment:4 Changed 9 years ago by leif

  • Cc leif added

comment:5 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:6 Changed 8 years ago by pbruin

  • Cc pbruin added

comment:7 follow-up: Changed 8 years ago by pbruin

  • Reviewers set to Peter Bruin
  • Status changed from needs_review to positive_review

This looks like a useful feature to me. The patch looks good and behaves as expected, and all doctests pass.

The fact that sage-CSI is run does mean that if GDB is available, it now takes about 10 seconds before you are back at the shell. Pressing ^\ a second time does not immediately interrupt sage-CSI. I'm not sure why; is the ^\ somehow intercepted by GDB? Pressing ^C during these 10 seconds does generate a Python KeyboardInterrupt in sage-CSI, but does not immediately get you back to the shell either.

Anyway, the issues in the above paragraph are only slightly annoying and should probably be addressed elsewhere than in this ticket (if at all), so no reason against a positive review.

comment:8 in reply to: ↑ 7 Changed 8 years ago by jdemeyer

Replying to pbruin:

The fact that sage-CSI is run does mean that if GDB is available, it now takes about 10 seconds before you are back at the shell. Pressing ^\ a second time does not immediately interrupt sage-CSI. I'm not sure why; is the ^\ somehow intercepted by GDB? Pressing ^C during these 10 seconds does generate a Python KeyboardInterrupt in sage-CSI, but does not immediately get you back to the shell either.

That's right indeed. It seems that, once GDB gets hold of a process, there is no easy way to get out.

comment:9 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.13.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.