Terminal interruptions (Cntrl-C, Cntrl-Z) are not working in ROOT6 interactive session

In my interactive ROOT6 session terminal interruption keys Cntrl-C and Cntr-Z are not working, while they are still working in the ROOT5 session with the same script. Any idea how to fix this annoying problem?

On which platform ? with which ROOT6 version ?

** SYSTEM DEFINITIONS ***
  OS: Linux, Distribution: RedHat
  Info: 'Red Hat Enterprise Linux Server release 7.4 (Maipo)'
  System info (uname -a):
    Linux nu76-78.jinr.ru 3.10.0-693.5.2.el7.x86_64 #1 SMP Thu Oct 19 14:21:12 PDT 2017 x86_64 x86_64 x86_64 GNU/Linux

   ------------------------------------------------------------
  | Welcome to ROOT 6.10/08                http://root.cern.ch |
  |                               (c) 1995-2017, The ROOT Team |
  | Built for linuxx8664gcc                                    |
  | From tag v6-10-08, 16 October 2017                         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

I cannot reproduce that, so I’ll need some extra info:

  • What happens when you press control-Z?
  • What happens when you press control-C? This is meant to cancel input, i.e. if you type “42” and then press control C you should get a new, empty input line, and the 42 should be ignored.
  • Which terminal do you use?
  • What does echo $TERM show?
  • Which display manager do you use?

Cheers, Axel.

It seems like problem occurs after some actions inside my script, which is quit complicated, if I run simple loop (the same stop code as in my big script):

{
int i=0;
while(true) {
Info(“Loop”,"Step %d: press [Enter] to continue… ",++i); cin.get();
}
}

Interruptions work for it.

I have also tried to run the script remotely from other terminal (putty under window computer connected by ssh), interruptions are also blocked. Some additional observations.

Before typing Cntrl-C scipt behaves in the same way like script above. Typed letters (not [Enter] or interruptions) are appeared in the input line, like here I have typed word ‘some’

ev 1: press [Enter] to continue… some

Pressing [Enter] leads to loop number of typed symbols +1 = 5 times, like it is expected from cin.get() functions:

ev 6: press [Enter] to continue…

After typing Cntrl-C symbol ^C appears on the screen

ev 6: press [Enter] to continue… ^C

but interruption doesn’t happen like in the simple script above:

Info in : Step 3: press [Enter] to continue…
^C
*** Break *** keyboard interrupt

But status is changing for the input. Now any character works like [Enter], typing of any character leads to one step loop cycle (work of cin.get() functions).

Cntrl-Z is actually works if Cntrl-C has not been yet pressed. After pressing Cntrl-C, Cntrl-Z is blocked and works like any other character.

It seems ok, I am using Cnrl-Z to stop&kill the script now, it is not clear how to catch the reason of this case in the main big script and whether it worth to spend time on it.

Thanks. Do you think you’ll be able to upload a reproducer? It’s impossible for me to guess what’s happening without, even based on the details you provided. (Terminals are complex beasts with lots of hidden state.)

Hi Axel,

I was thinking it is well known problem…

Just take hsimple.C and increase loop counts, that it runs for a while.
It cannot be stopped with Ctrl-C.
I observe it on my latest OpenSUSE since a while with all ROOT6 versions I tested.

Regards,
Sergey

Yes, I see the same effect with hsimple.C setting 25000000 events in the loop!

All is working well in ROOT5 (5.34/26).

That’s a bug; I have created https://sft.its.cern.ch/jira/browse/ROOT-9160

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Finally fixed in the future v6.12/08, 6.14/00 and 6.16/00. Thanks for reporting!
Axel.