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 .
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.
You can change running command with
timeout
. Read here: Timeout CommandCan you please help me with the command.
It's simply
timeout 2s ./your-binary-file
if you want to exit your program after 2s.I don't think mint 20.2 have this issue anymore. What is your version ?