this post was submitted on 28 Feb 2024
913 points (96.9% liked)

Programmer Humor

32410 readers
1 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] Strykker@programming.dev 125 points 1 year ago (1 children)

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 43 points 1 year ago (4 children)

Where does it write the file

[–] Agent641@lemmy.world 65 points 1 year ago (1 children)
[–] unionagainstdhmo@aussie.zone 25 points 1 year ago (1 children)

Probably the same place as failed sudo reports

[–] flashgnash@lemm.ee 12 points 1 year ago (1 children)

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

[–] unionagainstdhmo@aussie.zone 10 points 1 year 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 21 points 1 year ago (1 children)

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

[–] Swedneck@discuss.tchncs.de 51 points 1 year ago (7 children)

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 23 points 1 year ago (1 children)

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

[–] ysjet@lemmy.world 14 points 1 year ago (3 children)

gdb gives you waaaaaaaaaaaaaaay more than a stack trace.

load more comments (3 replies)
load more comments (6 replies)
[–] elxeno@lemm.ee 17 points 1 year ago

you can set it

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

[–] soulsource@discuss.tchncs.de 15 points 1 year ago

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

[–] lowleveldata@programming.dev 88 points 1 year ago (5 children)

let's not act like Java's error log is useful

load more comments (4 replies)
[–] FlatFootFox@lemmy.world 73 points 1 year ago (1 children)

My favorite compile error happened while I was taking a Haskell class.

ghc: panic! (the 'impossible' happened)

The issue is plainly stated, and it provides clear next steps to the developer.

[–] ignotum@lemmy.world 46 points 1 year ago

I had a similar error, though not from the compiler
Error message just read this should never happen

[–] Dirk@lemmy.ml 70 points 1 year ago (4 children)

Python: So you used spaces and tabs for indentation? NOW DIE!

[–] WhiteHawk@lemmy.world 43 points 1 year ago (3 children)

Mixing spaces and tabs should be a warcrime.

load more comments (3 replies)
[–] xigoi@lemmy.sdf.org 21 points 1 year ago (3 children)

Good. Spaces and tabs for indentation should never be mixed in any language other than Whitespace.

load more comments (3 replies)
load more comments (2 replies)
[–] ElCanut@jlai.lu 63 points 1 year ago* (last edited 1 year ago) (1 children)

Rust developer: I'd like to compile some code

Rust compiler: the fuck you are

[–] malle_yeno@pawb.social 38 points 1 year ago (6 children)

The rust compiler holds your hand, wraps you in blankets, makes you hot chocolate, kisses you on the forehead before it gently and politely points out what you did wrong and how you can solve it step-by-step. It would never think of something as heinous as swearing at you, shame on you for insulting my wife's honour like this.

[–] ElCanut@jlai.lu 24 points 1 year ago

Rust compiler is passive agressive, like:

"There's an error at line 286 because you still don't know how to use the borrow checker after all this time ♥️"

I need a rust compiler in my life 😍

load more comments (4 replies)
[–] crispy_kilt@feddit.de 54 points 1 year ago (1 children)
[–] henfredemars 33 points 1 year ago* (last edited 1 year ago) (2 children)

Yes. It's a surprisingly bad debugger the more you think about it. I use it largely in assembly and it loves to spit out random errors about memory it tried to access based on the current register state. The shortcuts are kind of dumb.

It certainly works but I wouldn't call it a pleasure to use.

Ex: try disp x/1i $eip often just doesn't work.

load more comments (2 replies)
[–] elxeno@lemm.ee 46 points 1 year ago (2 children)
[–] TheDudeV2@lemmy.ca 13 points 1 year ago* (last edited 1 year ago) (3 children)

https://www.youtube.com/@TsodingDaily

If you're a programmer, or think you might want to be one, I highly recommend this channel. He's a savant at all sorts of low level things, quite funny and entertaining, and does a fantastic job of explaining what's going on.

load more comments (3 replies)
load more comments (1 replies)
[–] ScreamingFirehawk@feddit.uk 44 points 1 year ago (1 children)

Embedded C entered the chat

[–] flubba86@lemmy.world 42 points 1 year ago (1 children)

Your loop had a race condition, so we let the smoke out for you.

load more comments (1 replies)
[–] Flxibit@lemmy.world 34 points 1 year ago (1 children)

This C++ message has an urgency vibes to it:

"Segmentation fault!! Drop the Nuclear Reactor quick!!"

[–] FiskFisk33@startrek.website 28 points 1 year ago* (last edited 1 year ago)

Average C++ error

Average C++ error

[–] vox@sopuli.xyz 25 points 1 year ago* (last edited 1 year ago)
gdb ./fuck
r
where

you should get a complete stack trace (complete with values of some function arguments)

[–] ooterness@lemmy.world 21 points 1 year ago (6 children)

No bounds checking, only fast.

[–] tunetardis@lemmy.ca 14 points 1 year ago

There is bounds checking, but it's opt-in. I often enable it on debug builds.

load more comments (5 replies)
[–] Subverb@lemmy.world 19 points 1 year ago (5 children)

Nevermind that the C++ program is two orders of magnitude faster when completed.

I would love to learn and use Rust but I'm a embedded systems guy. Everything of consequence is C and C++.

[–] T156@lemmy.world 11 points 1 year ago

If the embedded system is old or poorly-maintained enough, there might be more Rust than you'd think.

load more comments (4 replies)
[–] repungnant_canary@lemmy.world 18 points 1 year ago (1 children)

Joke on you until the python program segfaults

load more comments (1 replies)
[–] kbal@fedia.io 18 points 1 year ago
[–] AMDIsOurLord@lemmy.ml 18 points 1 year ago (4 children)

The developer must either provide the logging and attach a debugger or go get fucked when a runtime error happens

[–] Faresh@lemmy.ml 10 points 1 year ago* (last edited 1 year ago) (1 children)

That's not true though. You can get the backtrace and other useful information from the coredump mentioned by the error message by loading it with gdb. Not as good as attaching it to a living process, since you can't see step-by-step what happens leading up to the error, but still quite useful.

load more comments (1 replies)
load more comments (3 replies)
[–] Amaltheamannen@lemmy.ml 11 points 1 year ago (1 children)

More like 100 lines of template errors

load more comments (1 replies)
[–] Asudox@lemmy.world 9 points 1 year ago (3 children)
[–] marcos@lemmy.world 27 points 1 year ago (4 children)

Rust required you to fix all the errors before running the code.

load more comments (4 replies)
load more comments (2 replies)
load more comments
view more: next ›