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

66%
+2 −0
Challenges Bytes to Segfault

Rust 1.0.0, 58 53 52 37 bytes fn a(){#[no_mangle]static mmap:u8=0;}

posted 3y ago by moony‭  ·  edited 3y ago by moony‭

Answer
#4: Post edited by user avatar moony‭ · 2020-11-21T00:59:21Z (over 3 years ago)
-15 bytes
  • # Rust 1.0.0, <del>58</del> <del>53</del> 52 bytes
  • ```rust
  • #[no_mangle]pub extern fn mmap()->u8{9}
  • fn main(){}
  • ```
  • # Rust 1.0.0, <del>58</del> <del>53</del> <del>52</del> 37 bytes
  • ```rust
  • fn a(){#[no_mangle]static mmap:u8=0;}
  • ```
#3: Post edited by user avatar moony‭ · 2020-11-20T23:24:52Z (over 3 years ago)
there was a space... also doesn't work on TIO, only with rustc 1.0.0 sooo
  • # Rust, <del>58</del> 53 bytes
  • ```rust
  • #[no_mangle]pub extern fn mmap()->u8{9}
  • fn main() {}
  • ```
  • [Try it Online!](https://tio.run/##KyotLvn/Xzk6Lz8@NzEvPSc1tqA0SSG1oiS1KE8hLU8hNzexQENT167UotqylgskkJiZp6GpUF37//9/AA)
  • # Rust 1.0.0, <del>58</del> <del>53</del> 52 bytes
  • ```rust
  • #[no_mangle]pub extern fn mmap()->u8{9}
  • fn main(){}
  • ```
#2: Post edited by user avatar moony‭ · 2020-11-20T23:20:33Z (over 3 years ago)
-5 bytes
  • # Rust, 58 bytes
  • ```rust
  • #[no_mangle]pub extern fn malloc()->usize{1}
  • fn main() {}
  • ```
  • [Try it Online!](https://tio.run/##KyotLvn/Xzk6Lz8@NzEvPSc1tqA0SSG1oiS1KE8hLU8hNzEnJz9ZQ1PXrrQ4syq12rCWCyyamaehqVBd@///fwA)
  • # Rust, <del>58</del> 53 bytes
  • ```rust
  • #[no_mangle]pub extern fn mmap()->u8{9}
  • fn main() {}
  • ```
  • [Try it Online!](https://tio.run/##KyotLvn/Xzk6Lz8@NzEvPSc1tqA0SSG1oiS1KE8hLU8hNzexQENT167UotqylgskkJiZp6GpUF37//9/AA)
#1: Initial revision by user avatar moony‭ · 2020-11-20T23:15:21Z (over 3 years ago)
# Rust, 58 bytes
```rust
#[no_mangle]pub extern fn malloc()->usize{1}
fn main() {}
```
[Try it Online!](https://tio.run/##KyotLvn/Xzk6Lz8@NzEvPSc1tqA0SSG1oiS1KE8hLU8hNzEnJz9ZQ1PXrrQ4syq12rCWCyyamaehqVBd@///fwA)