shivamisation's blog

By shivamisation, history, 3 years ago, In English

I've been facing this issue for a long time , whenever there is an infinite loop in my code , my system freezes and I have to restart my system EVEN DURING CONTESTS . Is there a way to stop this , I am using Linux Mint distro and Geany IDE . Any suggestions will be highly appreciated .

  • Vote: I like it
  • +16
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I also have linux, but use Vscode with this extension to run test cases (https://marketplace.visualstudio.com/items?itemName=DivyanshuAgrawal.competitive-programming-helper). Which will automatically terminate your program if its run infinitely with returning the error of SIGTERM.

»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it

You can change running command with timeout. Read here: Timeout Command

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you please help me with the command.

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 2   Vote: I like it +65 Vote: I do not like it

      It's simply timeout 2s ./your-binary-file if you want to exit your program after 2s.

»
3 years ago, # |
  Vote: I like it -8 Vote: I do not like it

I don't think mint 20.2 have this issue anymore. What is your version ?