Timeline for Shortest code that raises a SIGSEGV
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 7, 2018 at 19:18 | comment | added | qwr | I have modified the answer to count bytes instead of characters. | |
Apr 7, 2018 at 19:17 | history | edited | qwr | CC BY-SA 3.0 |
deleted 6 characters in body
|
Dec 31, 2017 at 23:51 | history | edited | anna328p | CC BY-SA 3.0 |
deleted 3 characters in body
|
S Jun 14, 2017 at 11:40 | history | suggested | Alexander | CC BY-SA 3.0 |
Added a platform to the title to stop all the complaining in the comments
|
Jun 14, 2017 at 9:58 | review | Suggested edits | |||
S Jun 14, 2017 at 11:40 | |||||
Mar 21, 2017 at 15:15 | history | edited | Riker | CC BY-SA 3.0 |
deleted 41 characters in body
|
Nov 20, 2016 at 22:59 | comment | added | zwol |
Whether ret by itself crashes depends on whether there's an outer environment to return to. For instance, if this is used as the body of main in a typical C environment, it will not crash (but it will exit with a garbage status), but if it's used as the sole contents of an ELF text segment, it typically will crash because the initial stack frame created by the OS has a null pointer for the return address.
|
|
Nov 20, 2016 at 17:18 | comment | added | Joshua | @celtschk: You can segfault it anyway like so: mov bx, 1000h ; shr ebx, 4 ; mov eax, [ebx] -> CPU raises the underlying SEGV (AFAIK there's nobody to handle it though). | |
Jan 31, 2013 at 1:32 | comment | added | nanofarad | @celtschk IIRC NTVDM will eke out on nonexistent addresses, and those not allocated to MS-DOS. | |
Feb 4, 2012 at 17:25 | comment | added | celtschk | @JB: On MS DOS, no program will ever produce a segmentation fault. That's because MS DOS runs in real mode where memory protection is nonexistent. | |
Jan 20, 2012 at 16:19 | comment | added | Sir_Lagsalot | 'ret' by itself should be a valid program; I suspect that is an error in the emulator. | |
Dec 26, 2011 at 19:56 | comment | added | J B | My point being: just specifying “assembly” isn't enough to make it segfault. | |
Dec 26, 2011 at 19:46 | comment | added | Amol Sharma | see this code http://ideone.com/RMuLf | |
Dec 26, 2011 at 19:10 | comment | added | J B | As an MSDOS .com file, it runs and terminates without error. | |
Dec 26, 2011 at 15:14 | history | answered | Amol Sharma | CC BY-SA 3.0 |