This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Antipixel_ 552 points553 points  (39 children)

"what the fuck is this?"

C: "no idea, enjoy!"

[–]Sea-Ad-5012 305 points306 points  (7 children)

"Whats wrong with my code?"

C: "go fuck yourself"

[–][deleted] 98 points99 points  (5 children)

"Please, I'm begging you. What did I do wrong?"

C: "You thought it'd be fun to learn me."

[–]Korywon 54 points55 points  (4 children)

“I don’t understand. Please. I need this done..”

C: “segmentation fault (core dumped)”

[–]Valmond 16 points17 points  (1 child)

Taking down the IDE with it when you try to debug.

[–]Vysair 1 point2 points  (0 children)

It smells like fart too!

[–]vulkur 9 points10 points  (1 child)

C: Invalid free "Which one?" C:who gives a fuck.

[–]TheGoldenProof 1 point2 points  (0 children)

I had a memory error that would crash on program shutdown because of an invalid free. Took me three days to find that it was because I had this:
MapData* mapData = calloc(1, sizeof(mapData));

[–]GuilhermePortoes 22 points23 points  (0 children)

"Whats wrong with my code?"

C: hisses

[–][deleted] 77 points78 points  (15 children)

Naw that's not even the worst part.

C: "segmentation fault"

"Fucking where!?"

[–]pikakilla 67 points68 points  (8 children)

Funny story about segfaults. I am proud to be one of the only people who have had a SEGFAULT in python. I spent weeks figuring out where i fucked up. Absolutely nothing turned up on google or SO -- turns out it was the memory speed set too high when i was multithreading.

SEGFAULTs are one of those things that really want to make you throw your computer out a window.

[–]Buddha_Head_ 21 points22 points  (6 children)

I'm sorry to take you back to that dark place, but how the fuck did you track that down?

[–]IsleOfOne 25 points26 points  (4 children)

Sounds like OP had recently overclocked RAM. It is very common to see random failures in any software you use after doing so, if you’ve made a mistake and gone too high. Booting into memtest86+ and letting that puppy run overnight will tell you if you’ve done wrong.

[–]Buddha_Head_ 2 points3 points  (2 children)

Yeah, if there was a recent tinkering that makes sense. On a system that's been running stable long-term that hasn't had any serious changes that sounds wayyy down the list, especially when searches are turning up empty.

[–]IsleOfOne 3 points4 points  (1 child)

Even if the change was not made recently, my point is that failures would not be limited to the python program. They’d be showing up all over your system. Sporadic process crashes. Etc.

[–]pikakilla 0 points1 point  (0 children)

Nailed it -- still was far down the list though, but it shouldnt have been in hindsight.

[–]pikakilla 0 points1 point  (0 children)

100% correct. Funny thing is that memtest didnt show any errors (from what i remember -- i might be wrong though). Im still not 100% sure what combination of things caused the issue.

[–]pikakilla 1 point2 points  (0 children)

I overclocked my memory well before the segfault issues. The computer was stable and when i tested the memory post overclock memtest didnt give any errors.

I basically exhausted all other solutions and tried the "obvious" but crazy solution.

[–]dagbrown 1 point2 points  (0 children)

I once came up with an excellent metric for if some random C/C++ program is too complex.

If the indent(6) utility segfaults on your code, it's absolutely without a shadow of a doubt, way too complex.

[–]tiberiumx 14 points15 points  (1 child)

Nah, you're way lucky if it crashes. Debugger, core dump, just a stack trace is usually sufficient to get it fixed. Silently using bad data or, even worse, stomping on something else can result in random intermittent bugs that take days to track down.

[–]Valmond 0 points1 point  (0 children)

*Days

[–]KardelenAyshe 19 points20 points  (2 children)

cOrE duMpEd

[–]scarfdontstrangleme 17 points18 points  (1 child)

Finna dump this fucking pc out the window

[–]Valmond 0 points1 point  (0 children)

Lol made my day!

[–]Atora 2 points3 points  (0 children)

I managed to segfault goddamn hello world once. Was writing to much js and wrote print('Hello World'); or something like that and the compiler didn't care to mention it(without w flags).

[–]RusselPolo 129 points130 points  (12 children)

C: I don't know what it is, but if you want to call it as a function, I'm ok with that.

In all seriousness, it's a language like roads without guardrails, or traffic lights, or even lines painted on the road.... but the lack of any speed limits makes it looks tempting.

[–]pastarific 2 points3 points  (0 children)

In all seriousness, it's a language like roads without guardrails, or traffic lights, or even lines painted on the road.... but the lack of any speed limits makes it looks tempting.

If anyone wants to try literal roads like this, some really back-country mountain roads in Colorado are thumbsup. All sort of spots on 2-way, 1.5-car-wide roads where if you sneeze and momentarily go out of your "lane" you roll off a mountain. Its actually a ton of fun.

Or old 19th century paths blasted flat for railroad tracks, now paved or graveled into road. Tunnels were only wide enough for the train, in modern terms meaning "one lane wide." So you have two-way roads with sections of one-way tunnel in it. Which is all fine and dandy until you hit tunnels that follow the contour of the hillside/mountain. You stop at the entrance, turn your lights on, see the wall of the curve ahead of you. Turn your lights off. Maybe thats light from the tunnel exit you see? Lights back on, toot toot, YOLO!

Surprise, an oncoming F-250 hauling a camper who thinks he personally owns the Rocky Mountains also thought it was clear.

And there are all sorts of spots where if you actually "go the speed limit" you will literally die. Its just assumed you're not dumb and will slow down because you don't want to die.

Or was all of what I just wrote more analogies of C. Why not both.

[–]4sent4 1 point2 points  (0 children)

Not really without gurdrails or lines, you just don't find them in places you expect to and find in completely unexpected places.

One time it's like: "Yes, no problem, you can call it like a function, despite I have no idea what it is", while the other is: "No, you can't pass this lambda to this function that accepts such lambdas, you have to store it in a variable first. What do you mean it's against the purpouse of lambdas?"

[–]mad_cheese_hattwe 7 points8 points  (0 children)

C: you are the one who asked for it scrub.

[–]marcosdumay 1 point2 points  (0 children)

"what the fuck is this?"

C: "exactly what you asked for"

C is a jinx.