Skip to content

Instantly share code, notes, and snippets.

@kybr
Created October 12, 2020 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kybr/528bd203a474aba20ac4545231f0bc10 to your computer and use it in GitHub Desktop.
Save kybr/528bd203a474aba20ac4545231f0bc10 to your computer and use it in GitHub Desktop.
#include <chrono>
#include <iostream>
#include <thread>
int main() {
std::thread t([]() {
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
char* t = nullptr;
t[-1] = 1; // crash, please
});
getchar();
t.join();
}
// '...' terminated by signal SIGSEGV (Address boundary error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment