Opened 8 years ago

Closed 8 years ago

#727 closed bug (need more information)

CTRL-C sometimes interrupts command *after* interrupt

Reported by: jdemeyer@… Owned by: somebody
Priority: minor Milestone: 4-1-0 and higher
Component: dontKnow Version: 3-1-7
Keywords: cntrlc, interrupt Cc:

Description

In certain hard-to-reproduce cases, the following can happen in Singular (strace log):

write(1, "> ", 2)                       = 2
read(0, "kill a;\n", 1024)              = 8
write(1, "> ", 2)                       = 2
--- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
write(1, "> ", 2)                       = 2
read(0, "\n", 1024)                     = 1
rt_sigaction(SIGINT, {0x52d430, [], SA_RESTORER|0x555640, 0x7f979662fbf0}, {0x52d430, [], SA_RESTORER|SA_RESTART, 0x7f979662fbf0}, 8) = 0
rt_sigreturn()                          = 2
read(0, "if(defined(sage32)){kill sage32;};def sage33=2+3;\n", 1024) = 50
write(2, "   ? ", 5)                    = 5
write(2, "abort...", 8)                 = 8
write(2, "\n", 1)                       = 1
write(2, "   ? ", 5)                    = 5
write(2, "error occurred in or before STDIN line 14: `if(defined(sage32)){kill sage32;};def sage33=2+3;`", 94) = 94
write(2, "\n", 1)                       = 1
write(1, "> ", 2)                       = 2

Here, you see that first an interrupt is received and a new prompt is displayed, and afterwards the command

if(defined(sage32)){kill sage32;};def sage33=2+3;

is read, which is then "interrupted".

Change History (1)

comment:1 Changed 8 years ago by hannes

Resolution: need more information
Status: newclosed

This depends (probably) on the current input method: readline, emulated readline or fgets. Probably the call to reading a new input line was interrupted: fgets will simply be restarted, while readline/emulated readline have other methods. If the interrupt happens shortly after or before that call, the handler of Singular will be called, asking how to proceed. It would be difficult to change and not so useful: one usually does not need to interrupt anything if Singular is waiting for input. To give a definite answer, the currently used input method must be known.

Note: See TracTickets for help on using tickets.