4 ms·
> It can't be returned from, the exit system call must be issued before execution terminates. So what happens if exit isn't called?
by ebingdom 5y ago
> It can't be returned from, the exit system call must be issued before execution terminates.
So what happens if exit isn't called?
- chrisseaton 5y agoYou keep running whatever ‘instructions’ appear in the data after your last program instruction, so you could most likely have a segmentation fault, or worse run some random data as instructions and so crash, or worse still run some random data that happens to also be real instructions that does something harmful.
- JCWasmx86 5y ago1. If you add a "ret", you just jump to an invalid address. 2. If you add nothing, the CPU will continue to execute the bytes that follow. In both cases it is quite certain you end with a segmentation fault.(Or in case 2., an illegal instruction)
- matheusmoreira 5y agoSegmentation violation. I've seen code with a hlt instruction after main and the exit system call. Not sure what their intentions are, it should be unreachable.