Where did my segfault go?
39 points by rmpr
39 points by rmpr
The other thing that really trips me up is that modern Linux distros default to core dumps off. There's a command to set it back on with ulimit -c unlimited but even then the core file is not likely to be in the same directory as the executable (I feel like systemd moves them somewhere but I'm not sure). This is one thing that I really like about OpenBSD (core dumps on by default, same directory as executable) and wish this was the default in Linux distros. Because of these changes, now when a crash happens I usually just have to rerun the executable inside gdb.
The location of the executable? That seems like a really odd choice. I would never look in /usr/bin or whatever for coredumps. And worse, those are often locations on small and/or read-only filesystems. Wouldn't the working directory be a much better default?
My feeling is that core files are disabled by default because 1) security experts don't feel that you (the general you, not you specifically) don't know how to safely run Linux and that core files laying about are an exploit just waiting to be found, and 2) security experts still don't feel that you know what you are doing if you enable core files, so of course, they have to be hidden away where root can't find them.
Also, without a collection mechanism like systemd-coredumpd or minicoredumper, one may just acquire litter across their system with no easy way of even knowing there's something to debug.