Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

81%
+7 −0
Challenges Bytes to Segfault

C, 5 bytes main; This exploits the fact that uninitialised globals live in the .bss section, and that section is not executable. So any attempt to execute code there, regardless of content, wil...

posted 3y ago by Chris Jester-Young‭  ·  edited 3y ago by Chris Jester-Young‭

Answer
#3: Post edited by user avatar Chris Jester-Young‭ · 2020-11-21T05:06:45Z (over 3 years ago)
  • ## C, 9 bytes
  • ```c
  • main;
  • ```
  • This exploits the fact that uninitialised globals live in the `.bss` section, and that section is not executable. So any attempt to execute code there, regardless of content, will cause a segfault.
  • ## C, 5 bytes
  • ```c
  • main;
  • ```
  • This exploits the fact that uninitialised globals live in the `.bss` section, and that section is not executable. So any attempt to execute code there, regardless of content, will cause a segfault.
#2: Post edited by user avatar Chris Jester-Young‭ · 2020-11-21T05:06:35Z (over 3 years ago)
Use implicit `int` type; thanks Sisyphus!
  • ## C, 9 bytes
  • ```c
  • int main;
  • ```
  • This exploits the fact that uninitialised globals live in the `.bss` section, and that section is not executable. So any attempt to execute code there, regardless of content, will cause a segfault.
  • ## C, 9 bytes
  • ```c
  • main;
  • ```
  • This exploits the fact that uninitialised globals live in the `.bss` section, and that section is not executable. So any attempt to execute code there, regardless of content, will cause a segfault.
#1: Initial revision by user avatar Chris Jester-Young‭ · 2020-11-21T00:35:14Z (over 3 years ago)
## C, 9 bytes

```c
int main;
```

This exploits the fact that uninitialised globals live in the `.bss` section, and that section is not executable. So any attempt to execute code there, regardless of content, will cause a segfault.