Skip to main content

Timeline for Shortest code that raises a SIGSEGV

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
Dec 10, 2020 at 0:02 comment added Sapphire_Brick @NateEldredge Ok, I've updated this answer.
Dec 10, 2020 at 0:00 history edited Sapphire_Brick CC BY-SA 4.0
added 67 characters in body
Dec 9, 2020 at 23:49 comment added Nate Eldredge Yes, hlt will halt the processor if executed at privilege level 0, but if not then it raises a general protection fault. See for instance felixcloutier.com/x86/hlt. Linux userspace programs are at privilege level 3, and the kernel handles the GPF by delivering SIGSEGV to the process. cli and sti are in a similar boat, though the privilege requirements are more complicated.
Dec 9, 2020 at 23:42 history edited Sapphire_Brick CC BY-SA 4.0
deleted 2 characters in body
Dec 9, 2020 at 23:42 comment added Sapphire_Brick @NateEldredge Isn't hlt the opcode for "halt"? hlt causes the program to segfault, and does not halt the processor, even though the NASM manual (posix.nl/linuxassembly/nasmdochtml/nasmdoca.html#section-A.74) says it does.
Dec 9, 2020 at 19:33 comment added Nate Eldredge Under Linux, cli and sti will segfault all by themselves, because they're privileged, not because of the lack of exit point. You could add hlt to the list for the same reason.
Mar 27, 2020 at 19:13 history edited Sapphire_Brick CC BY-SA 4.0
added 85 characters in body
Feb 21, 2020 at 1:30 history edited Sapphire_Brick CC BY-SA 4.0
added 2 characters in body
Jan 24, 2020 at 3:05 review First posts
Jan 24, 2020 at 3:23
Jan 22, 2020 at 1:54 history answered Sapphire_Brick CC BY-SA 4.0