1001
C++ Moment (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] Strykker@programming.dev 139 points 4 months ago

Except the C++ "Core dumped" line is telling you it just wrote a file out with the full state of the program at the time of the crash, you can load it up and see where it crashed and then go and look at what every local variable was at the time of the crash.

Pretty sure you can even step backwards in time with a good debugger to find out exactly how you got to the state you're currently in.

[-] neosheo@discuss.tchncs.de 50 points 4 months ago
[-] Agent641@lemmy.world 74 points 4 months ago
[-] unionagainstdhmo@aussie.zone 28 points 4 months ago

Probably the same place as failed sudo reports

[-] flashgnash@lemm.ee 13 points 4 months ago

On a secret FBI server somewhere where they watch your failures and laugh

[-] unionagainstdhmo@aussie.zone 11 points 4 months ago

When you apply for a home loan or a passport:

"Unfortunately we will have to reject your application"

"Why?"

"We have received several reports of failed sudo attempts and segmentation faults"

[-] Plasma@lemmy.ml 22 points 4 months ago

I believe it's /var/lib/apport/coredump on Ubuntu.

[-] Swedneck@discuss.tchncs.de 55 points 4 months ago

imagine if it, like, told you this so you didn't have to find out about it via a post on lemmy

[-] PotatoesFall@discuss.tchncs.de 25 points 4 months ago

imagine if it like, read that file and gave you a stack trace

[-] ysjet@lemmy.world 14 points 4 months ago

gdb gives you waaaaaaaaaaaaaaay more than a stack trace.

[-] inetknght@lemmy.ml 5 points 4 months ago

...unless you build the executable with optimizations that remove the stack frame. Good luck debugging that sucker!

[-] TarantulaFudge@lemmy.ml 5 points 4 months ago

I love gdb! I recently had to do a debug and wow its so cool! On gentoo I can compile everything with symbols and source and can do a complete stack trace.

[-] TangledHyphae@lemmy.world 2 points 4 months ago

Am I the only one in this thread who uses VSCode + GDB together? The inspection panes and ability to breakpoint and hover over variables to drill down in them is just great, seems like everyone should set up their own c_cpp_properties.json && tasks.json files and give it a try.

[-] current@lemmy.ml 0 points 4 months ago

i mean you're expected to know the basic functioning of the compiler when you use it

[-] elxeno@lemm.ee 17 points 4 months ago

you can set it

tl;dw: writes to the path in /proc/sys/kernel/core_pattern

[-] soulsource@discuss.tchncs.de 16 points 4 months ago

If you are using systemd, there's a tool called coredumpctl.

this post was submitted on 28 Feb 2024
1001 points (97.0% liked)

Programmer Humor

31205 readers
1728 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS