Why am I getting Segmentation fault error when submitting in stl challenges but not in https://ide.codingblocks.com/?

I am getting segmentation fault error as below.

/bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe

Stl challenges

Problem: Hostel Visit


Same code runs fine in https://ide.codingblocks.com/s/355542

Kindly help.

Hey @thirumeni.m07 I am not able to understand your problem , is it that you can’t submit your code for this question?

I am able to submit.
But the problem is I am getting below error when I submit
/bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe




But it runs fine and gives correct output when I run same code on ide.codingblocks.com/s/355542 as below <br >



are you getting my problem?

Hey @thirumeni.m07 I totally understand what you are trying to say.
Do one thing try to submit this code


If it gets accepted then there’s an issue in the approach you are using, if not then do let me know.

Hey @thirumeni.m07 I totally understand what you are trying to say.
Do one thing try to submit this code


If it gets accepted then there’s an issue in the approach you are using, if not then there must be an issue in the backend.

Compilation is successful. Thanks.

I am just trying to understand why my code was not failing with segmentation error on ide.codingblocks.com?

You mean to ask that why your code wasn’t getting accepted, for the problem statement right?

No. I am talking about the segmentation error.
If something is wrong with my code it should fail on both the places(check the above screenshots) right?
In one place, it is failing with segmentation error but on other(ide.codingblocks.com), it is running without error.

Do you have any idea why the behaviour is different for the same code? Thanks!!

Oh I got it, see sometimes there’s an issue in the backend. Which is least expected. In your case, I feel it’s an backend issue as segmentation fault was not expected from your code.

1 Like