sigtstp error

what is error code SIGTSTP means?here is the link for my code. link to my code but it works with sample case.i am not able to found wrong in my code.

4 Likes

You should first see that anything more than 20! cannot be stored in any data type of C++/C . You should either switch to JAVA/python for this Q, or learn how to store huge numbers in C/C++. And then, declare the array of size 101 instead of 100. Due to 0 based indexing, valid memory locations are [0,1,2…99] not [1,2,3…100]. So for n=100 your code can give error.

13 Likes

SIGSTP suspends your process , this signal could be expilcit or due to an invalid operation leading to no output like
unsigned int x = 0 ;
x – ; // invalid operation

or any other such operation

4 Likes

Here it is for my code
int long MOD=10^9+7;
for the above code it dosen’t give the error but for this /int long MOD=1000000007;/
it sort of give this problem.

1 Like

same issue with python.

4 Likes

Where is error in mine? I get SIGTSTP in C++

Link to my Code

That’s a compiler error, not a SIGTSTP :slight_smile:

2 Likes

The SIGTSTP signal is an interactive stop signal. Unlike SIGSTOP , this signal can be handled and ignored. … When any process in a background job tries to read from the terminal, all of the processes in the job are sent a SIGTTIN signal. The default action for this signal is to stop the process.

It results from certain some unimplemented instructions (i.e you are trying to give a instruction which is not implemented in GNU library) which might be emulated in software, or the operating system’s failure to properly emulate them. This Error Can’t be removed . try other compiler, it will surely help you.

2 Likes
1 Like

But on running custom code I get SIGTSTP

Are you trying to “Run” without Providing “Custom Input”?

5 Likes

CodeChef: Practical coding for everyone can anyone help me its showing sigstp

1 Like

If ur using loop then check that loop is running for infinite either ,(due to incrementing or decrementing) .

2 Likes

I got this error in a question when I compiled my code. But when I submitted it, it was successfully submitted. If you get this error at compile time of Codechef, try to submit it.

2 Likes

yes,same happened to me
but before that i removed while loop from my code
i think that was creating problem.

Guys just try to reduce the loops, it worked for me. Especially check whether your loop runs infinitely.

If you not giving input it may give error instead your logic and implementation are well.
In python generally give EOF error.so careful for that.
That’s why on compile time getting error.

1 Like

same thing happened with me, thanks

Im facing similar issue (sigtstp in c++) I have tried using Stl (in order to reduce the code but doesnt seem to work).Can anyone help please.
Here’s my solution