4 ms·
(heavily paraphrasing) > [the core dump is supposed to be in the CWD, and named core, but isn't; what gives?] Followed by, $ find / -name core -type f Is
by deathanatos 2y ago
(heavily paraphrasing)
> [the core dump is supposed to be in the CWD, and named core, but isn't; what gives?]
Followed by,
$ find / -name core -type f
Is a sort of hilarious brute force solution. But it demonstrates a particular kind of problem, where
/-- requires -- evidence
| ^
v |
answer -- requires -/
These are pesky. The brute force search is a good idea, in that it breaks that cycle of almost needing to know the answer in order to discover it. (Unless you can surmise that the CWD is the crate dir, but let's assume that we don't want to depend on having such a moment of sheet "eureka!".)
> But there are also other bits of evidence that this theory doesn’t explain, or even cuts against. (This is what makes post-mortem debugging exciting! There are often contradictory-seeming pieces of information that need to be explained.)
I wish more people appreciated this; too many people are apt to sweet such discrepancies under the rug. This post does a good job on not just following through on them, but also showing how figuring some of them out ("why is our stack weird?") leads to the key insights: "oh we're using stacker and … $the_bug".
I do wonder how the author managed to notice that line in a 1.5k line stack trace, though. The "abrupt" address change would have probably gone unnoticed by me. (The only saving grace being a.) it's close to the bottom b.) most of the rest is repetitive, an artifact of a recursive descent parser recursing, and if we just consider that repetition "one chunk", it gets a lot smaller. I still dunno if I'd've seen it, though.)
- sunshowers 2y agoIt was actually my coworker Joshua who first noticed that, and then that dredged up a long-forgotten memory in me of having seen stacker on crates.io. Many eyes make bugs shallow! Agree about the power of brute force solutions! When you're struggling to get a foothold, those kinds of approaches are extremely helpful. For the cwd thing specifically, it was clear in hindsight, and I should have known about it (having written nextest which has to handle crate cwds carefully). But I don't beat myself up too much over it, and now I know where to look next time this happens.
- inferiorhuman 2y agoIn BSD land you can specify the path and filename pattern for the core dump via a sysctl knob (kern.corefile). quick check of the docs On Solaris or Illumos I'd eye coreadm(8) and maybe chuck something like this in my shell login script: coreadm -p $HOME/coredumps/core.%f.%p That'll put the executable name and PID in the dump filename and leave them all in ~/coredumps/… for all processes that are children of that login shell.
- sunshowers 2y agoTrue, that would have worked as well. Plenty of ways to do it.