Created
February 13, 2018 09:45
-
-
Save alepez/a128e8c3e68d23e46fab56a7c6621dd1 to your computer and use it in GitHub Desktop.
Enable Core dump in C/C++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sys/resource.h> | |
int main() { | |
rlimit core_limits; | |
core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY; | |
setrlimit(RLIMIT_CORE, &core_limits); | |
std::cout << "begin\n"; | |
int* x = 0; | |
*x = 1; | |
std::cout << *x << "end\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment