Linus Rants About C Programming Semantics (iu.edu)
jones_supa writes: "Christ people. This is just sh*t," begins Linus Torvalds in his message on the Linux Kernel Mailing List. Torvalds is grumpy because some new code added to the IPv6 subsystem has created conflicts. "The conflict I get is due to stupid new gcc header file crap," he writes. "But what makes me upset is that the crap is for completely bogus reasons." The new improved code uses fancy stuff that wants magical built-in compiler support and has silly wrapper functions for when it doesn't exist. Linus provides an alternative that contains a single and understandable conditional, which looks cleaner and generates better code.
Film at eleven
SJW's don't eliminate discrimination. They just expropriate it for themselves.
that the patch should be pulled, but geez he rants and rants.
This is someone you wouldn't want to work for.
.
Such code is the result of coders who rely on the compiler too much, and their brains too little.
.
"You and I learned C when it was programmers, not compilers, which had to be intelligent."
- - - Terry Lambert
How will the poor women of open source cope?
Linus Rants.
Pretending this is my office full of bitter coworkers..
But does he have to be such a dick about it?
Having read his rant (I know, I know) and agreeing with the points he is making, what struck me is that many programmers on the receiving side of that would have tried to imply that Linus isn't smart enough to understand their work of art.
Obviously, that doesn't work directed at Linus.
They tend to write unreadable code.
What a twat
How can Go language support such an abusive environment? They should drop Linux support until he agrees to be Nice. /sarcasm
Linus is doing his job, making sure that the Linux kernel code continues to maintain quality and supportability. I read the thread, the code is shit, and Linus called it out. I don't care about his language or the tone of his message. He's right. Linus could stomp kittens flat and I wouldn't care, as long as that kitten-stomping was in the pursuit of making the Linux kernel better. Enough of this fake controversy about Linus and his communication style, already.
I understand his rant and why....
but yet he allowed the crap that is systemd in the house from a programmer that gave us the steaming shit pile that was pulseaudio.
He may have a good reason to rant about xyz but do we really need to read about it?
Fight for your bitcoins!
It is easy to tell why. They both argue about a function, while ignoring that ugly "goto".
So he rants and raves and bitches and moans... It shows that he is passionate and serious about what he does.
Now, if only Bill Gates would learn to rant and rave passionately about the quality of his product - instead of counting his coins and pretending to be a philanthropist.
Political correctness is really just herd psychology pushed by insecure people who desperately seek social conformity.
... all the other people over there could use such a language, even for "legitimate" reasons, and get away with it.
You turn into Steve Jobs when you are hungry.
It's horrible, horrible code.
I'm not a C developer, but I know C and have been developing for 20+ years in various other C like languages. The thing Linus is ranting against is absolutely true. The first example is very clear what it does. Assign a variable. The second (new) code is fucked up, and completely unclear what's going on. Check some kind of boundary condition, then some weird shit going on that I don't understand?
The 3rd example is back to clarity. Check some boundary conditions, then assign the variable. I'd have never guessed the 2nd example does that without reading the 3rd.
I also happen to agree with Linus about not "toning it down". There's other ways to manage the kind of stupid bullshit that goes on in software development, but one effective way is going apeshit over shit like this. Linus's way isn't the ONLY way, but it does work. Developers tend to be filled with prima-donnas that think everything they produce is gods gift to coding. Sometimes the only way to get through is just yelling at the top of your lungs about shitty fucking code.
We live in an increasingly hyper-sensitive society where some people want to control speech in a fascist way. I'm so tired of all this bullshit about how it's "disrespectful to women", or other such crap. That seems to be the garbage dump reason for everything someone doesn't like that doesn't fit somewhere else. Just claim rascism, sexism, etc, even when it totally doesn't fit.
Oh, and please stop with the "The LEFT is trying to silence us.. blah blah blah" nonsense. This isn't "The Left" any more than the westboro babtist church are christians, or the nutjobs that open carry guns into Starbucks is "The Right". All of those are just radical elements of the political divide that have inserted themseves where they get the least criticism for their crazy ideas.
Not that this will surprise much of anyone, but the headline is wrong. Linus did not rant about C programming semantics. He ranted about a specific C function and the style used to perform a sanity check.
See subject: At least he's honest & forthright about things - in my book that goes a long ways as it's better than being a "politically correct" snake...
APK
P.S.=> Keep it up Mr. Torvalds: This person, & I'm sure I'm not alone, respect you for it (and your accomplishments along with it)... apk
Seriously slashdot?
on the planet you have, criticize Linus can you.
"He took a duck in the face at 250 knots." -- William Gibson, Pattern Recognition
I wrote a new language from God:
http://www.templeos.org/Wb/Doc/HolyC.html
This is about my 20,000 line of code x86_64 compiler/assembler/unassembler that works JIT and AOT:
https://www.youtube.com/watch?v=v9yctup6bIw
I have NO IDEA who this Linus guy is, but his microaggressive behavior will not be tolerated in the Open Source community. I doubt he was much of a contributor to Open Source, but we need to ban him as he is creating a toxic environment in my safe space. No big loss.
Seems that overflow_usub() will always be less readable than a condition then a subtraction. It's a pretty obscure function - searching for it reveals most of the discussion is about this specific patch. It will save an instruction or two with appropriate compilers, by using the JC instruction rather than a CMP/JZ and in really performance critical code this will matter, but most code benefits more from readability than that extra instruction.
Are you paid per character ?
Linus Torvalds is angry about something! Also, a strange, glowing sphere of fire was sighted rising in the sky this morning!
apt-get moo /\---/\
(__)
(oo)
/------\/
/ | ||
*
~~ ~~
..."Have you mooed today?"...
Just curious what it looks like in context.
I love Jesus, except for his foreign policy.
Oooh, good! That joke was getting old. Nice way to milk it.
There's nothing like $HOME
And next thing, someone who doesn't know about short circuit evaluation in C will swap the two conditionals.
Endlessly crosslinked ifdef header crap?
It's not ugly if it's used in this context (usually involving breaking out of several levels of loops/conditionals, and/or go to one specific error handling code snippet from several points in the function).
Two points:
a) I agree with him on the code, but I am not a competent coder myself.
b) I disagree with the form of communication and that is an area where I am competent.
As Linus expects others to write proper code, I expect people to conduct proper communication.
Same rules apply: If it does not improve the flow of information, it does not belong in the email. Some swearwords don't bring any points across that could not be covered by "professional english" subset ;-). I think "sh*t" and "crap" may be considered validly applied here. But beyond that, it generates an unnecessary conflict at rc7 time. ï
After creating git, maybe the next step is creating his own programming language?
Let's call it L.
And no, this is no joke. I would really like to see how it would turn out.
My microagressions have been triggered! !!!!!
Force Linus to use github +go for a week!
The new improved code uses fancy stuff that wants magical built-in compiler support
Imagine that. Someone thinking, "Ohhh, shiny! Let's try this because it's new and cool."
Instead of, "I need something to get the job done in the simplest fashion."
There's a reason analog light switches are still around. They just work. No bullshit about having to talk to a computer to decide what to do. Clean and simple. Just like code should be.
We will bankrupt ourselves in the vain search for absolute security. -- Dwight D. Eisenhower
Torvalds is making a simple workmanlike point here, wanting to keep obtuse and overwrought code out of Linux as a general principle. And if he has a bit of a pet peeve over this, it is because he has encountered it so many iterations of this problem over the years.
I'm not sure why this rates a headline of "Linus rants" instead of, say, a headline like "Linus smacks down well-intentioned but incompetent coders obfuscating his clean code base with inferior code".
I guess "Linus rants" is just a more flamebaity title.
Didn't your mom teach you never to use goto statements?
"A shiny function that we have never ever needed anywhere else, and that is just compiler-masturbation."
I fucking agree with him.
So, did he like the code or not?
GCC developers are some of the worst language lawyers you'll ever find. Code that used to work correctly will break (optimizations, yo) if they decide it's undefined or implementation defined behavior. Like overflow. They have to add those shitty builtin "safe" overflow math functions because MAX_INT + 1 is undefined. GCC will never generate code for an architecture where that is undefined, but when give the chance to "do the right thing" or "save a couple cycles and break code", GCC will fuck you over.
Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
Not clever, grouping of two things, an 'if' and a 'subtract'. It hides the subtract from the coder and puts it in the function name ('sub').
He presumably has implement a whole bunch of these functions for ever possible combination of inputs possible in C e.g. (unsigned short, unsigned int, plus), (signed int, unsigned int, plus), (signed int, unsigned int, minus), (signed int, unsigned long, plus),....
(2 (signed/unsigned) * 5) ^3 = 1000 functions?
No? So basically just bad code to group 2 lines of code together in a obtuse way.
It's hard to be smart the way Linus is, in our world of mediocrity. Frankly, I'm sorry for him and I wish he could have a better life, detach his nerves from his own "nerdiness". But his brain needs to be all-time busy at high levels, it's like the lungs needing air and it's common for people of a certain geniality. That can of course be very exhausting for a physical body and can make it in turn very frustrating when one can't connect at his brainwave level with all the others he has to deal with. Think Steve Jobs, too.
Unlike certain genial people, who have been lucky enough to thrive either alone (Leonardo) or within the academia (Einstein), the open source sector (and thank goodness for that) has been thriving because anybody could help. It couldn't happen as a one-man job. There's been a lot of nerds, geniuses and well intended average people in the last decades that have made a brave new world possible.
The truth is, we (=whoever is professionally involved with Linux) owe Linus a big deal: we should just be thankful to him and stop mocking his rants. But nobody can deny that the more the world he contributed to create and is part of grows, the more mediocre and bad-intended people will be part of it. Unfortunately, there's nothing to do about it and there's little to get angry about: whenever anything becomes mainstream, it inevitably will lose its "purity" and will go the way of a slow and painful decadence. Jobs knew that, and that's why he pretended to control and steer everything, as much as Linus goes for a decent programming semantics, but of course no-one can get an hold on everything, forever. And IT and academia are far away nowadays (who can explain the term "programming semantics"?).
On day Linus may decide to let it go even more and we'll sorely miss him and a decently working kernel; Linux and everything revolving around it will start to crumble into anarchy like it's already happening. I watch every day the world I've grown into being tainted (a word I saw originally used in Debian circles) by new startups or big corporates steering technical matters towards sh*t, by going against any well-established standards and rules of educated cooperation set in the 1980s and onwards, for the sake of easy money or just laziness and convenience. Oh those millenials. From big public clouds providers that reinvent the wheel, violating basic network concepts, to containers engines or microservices providers that would deserve oh-my how many rants for the messy way they're coded together with duct tape, to the huge self-referential mess of Android (I don't care how successful it is), to the utterly immature and arrogant way certain bad people pretend to impose "their dictatorial way or no way", literally destroying an entire ecosystem of trust and cooperation just to show how cute they are. Yes, I'm talking about systemd. Pathetic, isn't it.
But who the hell am I to pretend to analyze Linus and the world around him? Just an Anonymous Coward.
In this context what I see for myself is to try to make the best of the remnants of the hopes of a better (open-source, rfc-based) world, until it lasts, trying to dodge the b*llsh*t, the marketing departments and the smarta**es, in at least what I deliver. And never take it personally.
I'm trying to figure out what "overflow_usub" does, but when I google it, all I get are links to this story. Anyone know?
What! he rails against something but not at the GOTO statement!
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
Is his ranting for or against semantics?
See subject: What Linus bitched about is in the source article for this - "RTFA" fisted.
APK
P.S.=> You wouldn't understand it anyway I suspect. Where's your sourcecode for anything you've ever done (that others say is good)? I suspect it doesn't exist. I've never seen it (let alone anyone saying anything good about it which makes sense - as again, it's non-existent)... apk
Hannes seems to have a valid point that boundary checking should be standardized in some way. Rasmus backs him up and mentions the result of the rant is they'll end up discarding his more comprehensive work on the issue: http://lkml.iu.edu/hypermail/l...
Linus seems to be saying all boundary checks should be ad-hoc because the new syntax is to hard to GET OFF OF HIS LAWN. Because it is dog poop.
open source world is getting overrun by high IQ morons, that put in bloat, hyped fads, and needless complexity. they indulge in mental masturbation rather than good design
I wish Linus would have directed his ranting energies against systemd.
He's very protective of the kernel, but I think he should defend the platform as a whole a bit more.
Nothing new, just walk on. He rants because that's his natural state. Can not wait for the fool to disappear.
The cute thing about Linus' rants is that he always censors the swearwords with asterisks. :)
Like Linus, I also write the simpler form of this kind of code when writing in C/C++.
Unlike Linus, I feel bad about it! My colleagues point out places where arithmetic overflows might lead to crashes. Honestly I find it really difficult to think through the overflow issues for *every single* plus, minus and multiply operator in my code. I think it's like cryptography in that sense -- most regular programmers, including good programmers, don't look at arithmetic operators from the perspective of attackers.
In this case, does Linus' code have the exact same behavior on all possible inputs including overflow-causing inputs? If not, which of the two behaviors is the desired one?
Are there places (maybe including this one) where the kernel code doesn't guard properly against arithmetic overflow? Will the newfound attention bring hackers scrutinizing it for overflow flaws?
Linux probably also ranted about unnecessary substitutions of snprintf for sprintf.
Under the new CoC he'd be permabanned in a heatbeat.
Kids these days, they just can't code like we used to. They've never heard of k.i.s.s., they don't think analytically, and they just want to make things flashier or cooler, because they read a blog post from joe cool programmer that they follow on insta-twitter.
Both in the technical sense and in the human sense.
Technical: People at Linus' caliber understand exactly the rules for signed/unsigned integer promotion and where underflow is defined (as wrap) and where it's undefined[1]. Consequently he wrote perfectly-correct code for detecting the underflow and bailing out safely. Programmers at mere mortal levels of skill, however, routinely mess this up, often causing exploitable security bugs (believe me, I do code security audits as part of a real honest living). My advice for everyone (contra Linus!) is always always always use the compiler intrinsics for integer math. Feel free to decline this advice if you are a Linus level wizard (if you were, of course, you would already feel free to decline it) but if you have to wonder if you are, you probably aren't.
Linus seems to think that the kernel should only be written by folks that don't need that kind of help -- and for that I won't argue with him. It's his baby and he can chose whether to have a small number of über-developers or a larger number of mortals. Which goes straight to the second point:
Human: People at Linus' caliber thrive on negative feedback. At their level, positive feedback means nothing because there's nothing he can learn from someone praising his work. He wrote a kernel, he knows he's good. Meanwhile negative feedback is useful (unless trivially discountable): if the complaint is right, he'll correct something he was doing wrong; if the complaint is wrong, he'll be forced to think through why. In any event, he could never imagine why someone would sugar-coat their opinion on any matter.
So it seems like his mode of communication is meant to answer that question for the former: he wants people of his caliber that don't write ugly code using arithmetic crutches and don't care about strongly worded criticism. There's nothing invalid about that either -- maybe it's true that the best model is that Linuses work in the kernel and the rest of us go up into userland where we use crutches like memory protection and higher-level constructs :-)
[1] And when behavior is undefined, a smarter compiler can remove the code-path entirely -- the kernel itself was hit by such a bug where GCC legally removed a NULL check because the pointer was dereferenced before the check. See also this reference. Then there's the sad fact that people still argue against the clear language rules that say that assert( 100 + some_int > some_int ); can always be optimized away.
Linus Rants about Someone Else's C Code
or simply
Linus Rants
Not to mention that sizeof forces hlen+sizeof(struct frag_hdr) into size_t, which very probably is not unsigned int (it is not, on any of the systems I've owned for the last decade at least). Therefore overflow_usub is seriously bogus in and of itself.
"My opinions are my own, and I've got *lots* of them!"
Someone should make a script that goes through the Linux code and checks for all the bad code things that Linus hates, then after going through all of it, will email him a detailed report of where, what and why. Maybe seeing Linus explode is feasible in our lifetime!!
Of course, it's *easier* to blame someone else for the problem, since you don't then have to change, but it's a well substantiated aphorism that a bad workman blames his tools, and it holds with programmers and their language constructs.
Learn more, expect less superior knowledge from yourself, and cut out the fucking swearing you cocksucker.
I never understood why people like you don't understand it. It's like a headline for a newspaper column. Do you know why they exist?
Just in case you don't, they advertise what they want you to understand as the message in the topic. You know, like the subject of the topic. Notice what that text entry bit at the top you complain about having the subject of the post in is called? That's right: the subject.
So someone puts the opener there and intend you to know before reading something about what the content of the post is, so if you think it pointless, you can skip it early, without reading the content.
It can also be used (again, same as with headlines on newspaper print) to sucker you in to reading it.
So I never understood why "Stop putting the post in the starting line".
If for no other reason than you aren't the one writing the fucking thing. If such a minor thing that you don't like makes you not read, WHAT THE FUCK ARE YOU DOING HERE???? The intent of a blog with user submitted content BTL is so you will read what other people think. If you are going to refuse for such petty reasons, what OTHER pettyfogging pissant little niggles will you refuse to read for? So why not just stop reading here at all, saving yourself a huge amount of time.
And what do you think you're doing with the complaint? Why should anyone else care whether you like it or not? Unless they're forcing you to do the same, what the hell does it have to do with you, and why should anyone change? Because you don't like it?
Welcome to the real world, buddy, where it doesn't give a shit about pleasing you at every turn.
So STFU about it and save EVERYONE a pointless effort.
the start of a thread IS the subject line.
No. The subject is a summary, or 'subject' if you will, of the post/email/missive.
That way, you can dismiss a thread based on it's subject, and not have to descend into a thread to see what it's actually about.
Get a clue before ranting, low-id.
And it doesn't cement his primacy as lord of the manor.
So, yeah, he could (and should) have said it much differently.
But this way strokes his ego. Ergo it's the only way he's going to do until someone who can beat him in coding can turn the tables outside his own little fiefdom.
At which point he'll probably huffily point out that he was SOMEWHAT right in what he did, and that it wasn't recognised in the raving against him.
Wish I had some mod points for you today.
Hey, Windows users, there is no such thing as "forward" slash, there is only slash and backslash.
The language's inability to check for overflow is a problem. Putting that sort of obtuse and unreadable compiler-specific code everywhere you want to do arithmetic is a a cure worse than the disease.
Reported-by: Dmitry Vyukov
Cc: Dmitry Vyukov
Signed-off-by: Hannes Frederic Sowa
---
net/ipv6/ip6_output.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 61d403e..00aa538 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -28,6 +28,7 @@
#include #include +#include #include #include #include @@ -584,7 +585,10 @@ int ip6_fragment(struct sock *sk, struct sk_buff *skb, if (np->frag_size) mtu = np->frag_size; } - mtu -= hlen + sizeof(struct frag_hdr); + + if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) || + mtu daddr, &ipv6_hdr(skb)->saddr);
There's zero technical reason why an "undo" function can't be added to almost any software system
I can think of a couple. It's harder to remove elements from some kinds of full-text index, especially a probabilistic index, than it is to add them. And each comment would then need revision history so that moderators can tell to what text each comment was actually replying. Do we want individual revisions to be searchable?
and why does your proclamation make it true?
Does your decision mean you're forced to write against your will and put the message in the subject line?
Or is none of that the case and you're just wasting your time ranting, indicating that you really don't mind the waste of time you put into it, therefore the problem really doesn't make any difference to your day that isn't entirely self inflicted?
Nagging apk on his source repeatedly last week and today too (your post history shows it) you admit he had no obligation to show you and resorting to libel http://slashdot.org/comments.p... and that malwarebytes people have as well as host and recommend for him. A program others say is good and yet you produce nothing of your own we can see. Lot of trolling but no action from fisted the blowhard hahahahahahahaha.
I've debated programming language syntax many times, and have come to the following conclusions:
1. The C-style switch/break syntax is archaic and error prone, and should be replaced by a modern version based on sets rather than "break". We even devised a way to support both the old and new forms for backward compatibility. I'd roughly estimate less than 15% of the debaters agreed to keep (only) the existing style.
2. There's no free lunch. Syntax design creates trade-offs, and not all the trade-offs are immediately recognizable. All languages will probably have warts somewhere under certain conditions or usage patterns. If any language eventually gets it all right, it'll probably be a lucky accident, not pre-planning.
3. Personal preference varies widely. What bothers me may not bother others. Our brains each process syntax very differently. Consensuses are hard to reach.
Table-ized A.I.
go fuck yourself.
Correction,
I should have said "language design", and not (just) "syntax". We generally considered semantics also. What we excluded was compiler design and machine efficiency, unless it became a clear bottleneck.
(A secondary debate then broke out on whether such "chip" bottlenecks are merely a reflection of current chip technology and whether a new language should cater to current chips or "do it right" and not focus on chips. The answer often depended on one's domain perspective, for those who work closer to the hardware, such as embedded, thought tailoring design around common or current chip architecture mattered more.)
Table-ized A.I.
Therefore if the subject is contained IN the subject line and spills over into the comment, it's still the subject.
And in no way, shape, or form, does it cause you any anguish you aren't placing there for yourself to feel.
A very intelligent dude... but at the same time is a pain in the ass son of a bitch
KICC = Keep it Complicated and Crappy
I recently ran into a similar example in Java, where Java 8 has introduce the class java.util.Optional. This is used by certain other Java 8 classes as a return type.
What does Optional do? It provides an object that contains an object. If that inner object is null, the method isPresent() returns fall. So now, instead of:
if (widget != null) { widget.doSomething()) ... }
You can write
if (optional.isPresent()) { widget = optional.get(); widget.doSomething()) ... }
Of course, if you don't quite trust the class giving you the Optional, you get to write
if (optional != null && optional.isPresent()) { widget = optional.get(); widget.doSomething()) ... }
This serves no useful purpose, except to make code more complex. Stupid, stupid, stupid...
The claim, of course, is that this marvelous class is designed to work with lambdas. The thing is, lambdas themselves are an idiocy in Java. Lambda expressions are inherent in purely functional languages, but they are semantically out of place in a declarative language.
Enjoy life! This is not a dress rehearsal.
The biggest problem I see is existence of crap like:
mtu -= hlen + sizeof(struct frag_hdr);
Where such code exists you can expect bugs to not be far behind.
What I especially dislike is Linus's proposal:
if (mtu
Hey lets just do the same exact operation twice... now that provides no opportunity for mistakes and BTW nice magic number.
I've learned the hard way over the years when you write a parser to build or consume packets under no circumstance should code to explicitly count bytes like this be allowed to exist. Write or reuse a higher level function to add or consume structures to centralize constraint checking. MUCH less opportunity to screw something up and less code/easier to read in the long run.
Error, no action moo
Perhaps apt-get install moo?
APK likes to ask for responses to the same things over and over. Maybe he just likes the responses?
I find it weird that Linus is so against the concept of idiot-proofing code, considering he is apparently surrounded by idiots. In C++ land we can use integer wrapper classes that provide checks against overflows in arithmetic operations. And the code just looks the same. For example:
SafeInt c = a + b;
It's a bit slower, so maybe it doesn't belong in some very nested loop structure. I understand Linus wants the code to be fast, but in places where you are doing that overflow check anyway, it seems like having a class or function do it for you rather than writing your own check is probably better from a consistency standpoint.
I'm glad Linus is on our side! :-)
people read the subject? I just get confused when the first sentence of the post is incomplete and downgrade my impression of the poster's ability to write.
See subject: His name's fisted. Want to see additional proof of his stupidity? See here (especially his quote vs. what I put out) http://slashdot.org/comments.p... AND here (for how easy he is to crush with facts after I told him my sourcecode is closed and only malwarebytes has it) http://it.slashdot.org/comment... ...
He nevertheless trolled me endlessly asking the same question ('where is your sourcecode' & kept it up into today -> http://slashdot.org/comments.p... ) since he's 'butthurt' he screwed up.
Then he said "there's NOTHING you can do about DDoS" which I proved is NOT TRUE -> http://tech.slashdot.org/comme... and he outright RAN from it then...
APK
P.S.=> Don't give that "ne'er-do-well" blowhard talker that ends up eating his words every single time ANY of your time of day man - that is, unless you want to amuse yourself with his antics (that's fun, as it's fairly EASY TO MAKE HIM "eat his words" as I showed in the 4 links above)... apk
Why the FUCK we are still bitching about syntax?
My god, it's a FUCKING machine, it doesn't care about syntax, it just wants instructions to follow. We care about syntax because WE have to read AND understand the shit, so STOP fucking making new god damned languages, and settle on a simple, easy to follow SYNTAX for christ's sake.
On a secondary note, STOP storing your date/time variables as STRINGS, it pisses me off.
YOU say "hosts=bad" (but they add security, speed, & reliability) & bitch on admin privelege to UPDATE vs. threats:
"So, have you figured out why privilege escalation is a bad thing yet?" - by Coren22 on Tuesday September 22, 2015 @05:15PM (#50577809)
Hypocrite - You use admin priv admitting it
&
How else can I programmatically update hosts minus it in Windows?
---
"Of course it requires elevation to write to the hosts file" - by Coren22 (1625475) on Wednesday September 23, 2015 @05:35PM (#50585879)
You FINALLY later admit there's no other way!
FACT:
Even MalwareBytes AntiMalware (best one) DEMANDS you use admin privelege (you saying it's "bad" too?) it can't do its job fully otherwise, like many security tools do!
---
Aryeh Goretsky NOD32/ESET says hosts = good security-> http://it.slashdot.org/comment...
Oliver Day (Symantec) does-> http://www.securityfocus.com/c...
MalwareBytes' hpHosts hosts & recommends my APK Hosts File Engine 9.0++ SR-2 32/64-bit-> http://hosts-file.net/?s=Downl...
---
* HOW MANY SECURITY PROS DO I NEED TO KNOCK THE CHOCOLATE OUTTA YOU?
---
Those security pros INCLUDE me: I work w/ guys from malwarebytes' hpHosts on a regular basis!
I've professionally worked for decades as a combined domain-wide network admin & software engineer since 1994 (Even showing you HOW to migrate a hosts across an enterprise-> http://slashdot.org/comments.p... )
I've also been securing computers + WRITING GUIDES using CIS Tool (who took fixes from me http://slashdot.org/comments.p... - bonus) http://www.bing.com/search?q=%...
You told me you learn from guides?
I write good ones that MILLIONS USE & was PAID FOR IT http://pcpitstop.com/news/winn...
+ WARES TO PROTECT USERS that are endorsed & hosted by security pros -> http://hosts-file.net/?s=Downl...
You did all that? No!
(& that's ONLY a SMALL part of what I could put out)
APK
P.S.=> You're all TALK -> http://slashdot.org/comments.p... & a "ne'er-do-well" as far as security...apk
Really, a goto? That's the best solution to this issue? I can actually read the crap code and while I don't particularly like it since it is assigning the values inside the if statement, that isn't the problem for me. It is the goto. I haven't used a goto in 35 years since I first discovered structured programming and I've been a C programmer for 25 years and while the statement exists in C there's just no need to use it (I never have), especially in this case. The fail_toobig should be a routine that is called rather than a label and there should be an if then else in there too. Linus' code is ugly too. Better than the first one, but still ugly.
"I have the attention span of a strobe lit goldfish, please get to the point quickly!"
If you do not know what usub is, is difficult to determine what is is doing. In that, Linus is right. But look inside the Parenthesis:
" (mtu, hlen + sizeof(struct frag_hdr), &mtu) || mtu = 7) "
Here is a very Clear OR. The guys are checking for the MTU Being to big OR too small...
Linus offers this code:
"if (mtu hlen + sizeof(struct frag_hdr) + 8)"
Which obfuscates the OR comparison...
And Both Call the label "fail_toobig" intead of a more readable "fail_MTU_outofbounds"
Or am I missing Something?
*** Suerte a todos y Feliz dia!
"APK doesn't think that DNS servers are worth running and seems to believe that somehow Microsoft Active Directory can run without DNS." - by Coren22 (1625475) on Tuesday October 27, 2015 @12:58PM (#50811615)
Where'd I say AD will run minus DNS Coren22? I've said AD = internal network DNS dependent back in 2007 http://forums.tweaktown.com/wi...
(Searching this in BOLD "To warn users who have ActiveDirectory/AD LAN-WAN setups to NOT use external DNS servers!" referring to OpenDNS suggestions for those using AD stupid in the POST BEFORE IT in my security guides for users (geared to stand alone single machines no less), & right there on that page proves it stupid - so even if you posted as myself someplace here on /. "impersonating me", I have your ass NOW, shithead!)
I've also stated MANY TIMES I use remote DNS in OpenDNS @ home (but not @ work on AD networks since the free model does NOT work with AD specifically you lying little imbecile).
I also don't hardcode in "every site there is under the sun" is why, so I have to use DNS, but OpenDNS & rarely.
I also RARELY MISS A LOOKUP since I put where I spend a good 95++% of my time online in my favorite sites into hosts @ the TOP of hosts for utmost LOCAL FASTER RESOLUTION SPEEDS and more reliability vs. Open DNS (not OpenDNS) resolvers being abused, Kaminsky redirect poisoned DNS servers (of which 99.999% of ISP DNS are not proofed against to this very day even though a patch exists which OpenDNS uses), rogue DNS servers, and yes ROUTERS with bushwhacked by malware DNS settings (happening a LOT lately).
Hardcodes in hosts are faster than remote DNS, waste less resources than local dns in power, cpu cycles, RAM, & other I/O by FAR considering ALL THE PARTS of such a setup in programs, data, I/O, & power (especially if setup as a separate machine). Most people out there don't run a home LAN. They have single systems.
APK
"APK doesn't think that DNS servers are worth running and seems to believe that somehow Microsoft Active Directory can run without DNS." - by Coren22 (1625475) on Tuesday October 27, 2015 @12:58PM (#50811615)
Where'd I say AD will run minus DNS Coren22? I've said AD = internal network DNS dependent as far back as 2007 http://forums.tweaktown.com/wi...
(Searching this in BOLD "To warn users who have ActiveDirectory/AD LAN-WAN setups to NOT use external DNS servers!" referring to OpenDNS suggestions for those using AD stupid in the POST BEFORE IT in my security guides for users (geared to stand alone single machines no less), & right there on that page proves it stupid - so even if you posted as myself someplace here on /. "impersonating me", I have your ass NOW, shithead!)
I've also stated MANY TIMES I use remote DNS in OpenDNS @ home (but not @ work on AD networks since the free model does NOT work with AD specifically you lying little imbecile).
I also don't hardcode in "every site there is under the sun" is why, so I have to use DNS, but OpenDNS & rarely.
I also RARELY MISS A LOOKUP since I put where I spend a good 95++% of my time online in my favorite sites into hosts @ the TOP of hosts for utmost LOCAL FASTER RESOLUTION SPEEDS and more reliability vs. Open DNS (not OpenDNS) resolvers being abused, Kaminsky redirect poisoned DNS servers (of which 99.999% of ISP DNS are not proofed against to this very day even though a patch exists which OpenDNS uses), rogue DNS servers, and yes ROUTERS with bushwhacked by malware DNS settings (happening a LOT lately).
Hardcodes in hosts are faster than remote DNS, waste less resources than local dns in power, cpu cycles, RAM, & other I/O by FAR considering ALL THE PARTS of such a setup in programs, data, I/O, & power (especially if setup as a separate machine). Most people out there don't run a home LAN. They have single systems.
APK
http://systemexplorer.net/file...
I guess we should avoid your crap, it looks like it is marked as malware. Good luck getting that removed.
APK likes to ask for responses to the same things over and over. Maybe he just likes the responses?
How do you choose variable types if you don't think about the operations you use on the variables? Do you just guess, or habitually use int until something breaks?
three
comments
together.
I've written 'em long ago & no response vs. what this below that fries you again Coren22 from 60++ REPUTABLE sources (not those shitbrain nobodies!)
Is that YOUR fake site for MORE LIES Coren?
Lying again about me LIKE YOU DID HERE punk -> http://slashdot.org/comments.p... ??
Quite possibly considering you're already caught as a damn liar.
MalwareBytes' hpHosts Admin (MalwareBytes employee) hosts & recommends it -> http://hosts-file.net/?s=Downl... & MalwareBytes = BEST antivirus per this VERY recent testing of them all http://www.av-test.org/en/news...
&
It's safe proven by 57 antivirus programs recently in BOTH its 64-bit model https://www.virustotal.com/en/...
+
In its 32-bit model too https://www.virustotal.com/en/...
For more "SALT IN YOUR WOUNDS"? Another -> http://f.virscan.org/APKHostsF...
APK
P.S.=> Then there's slashdotters saying my work is good too:
"his hosts program is actually pretty good" - by xenotransplant (4179011) on Monday August 10, 2015 @03:34PM (#50287195)
"I like your host file system." - by Karmashock (2415832) on Wednesday September 09, 2015 @03:57PM (#50489401)
"APK is kinda right... I've given up on JS based adblocking and gone to blackholing in /etc/hosts, just like it was back in the 90s. The computational load has gotten intolerable for any ad-blocking using JS. I've tried his hosts file generating software. It works." - by bmo (77928) on Thursday October 15, 2015 @11:30AM (#50736071)
"Actually, APK is totally right on this count. Adblock Plus on Firefox mobile is a dog on older, or lower end, phones. A hostfile based adblocker makes for a much better experience in this context. Of course, your phone has to be rooted" - by chihowa (366380) on Saturday May 16, 2015 @11:40AM (#49705641)
"his hosts tool is actually useful for those cases in which one does indeed want to locally block stuff outright while consuming minimum system resources" by alexgieg (948359) on Friday September 25, 2015 @09:57AM (#50596461)
"People at Linus' caliber understand exactly the rules for signed/unsigned integer promotion and where underflow is defined (as wrap) and where it's undefined[1]. "
Well, the specific behavior in this types of cases will/may depend on the hardware. Linux targets lots more systems than just x86-64. And in any case using a gnu version-specific intrinsic is probably not the best thing to do in general.
And what's with the magic number?
Coren22 the desperate proven liar fails again against apk http://slashdot.org/comments.p...
A his strong voice is one of the reasons Linux is so popular. I fear for the day a committee makes thedecisions
I support that code should be readable if possible and such self-purposed constructs avoided. However much ranting over nothing.
I would still prefer "sizeof dest" (yes, without parens!) instead of "sizeof(dest's type)", if only because if the declaration of the destination was somehow changed to a different type, the code would be wrong. I prefer to keep as few separate copies as I can of such information, and let the compiler take it from the symbol table, sort of like the new C++ "auto foo = something".
#naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
"I guess we should avoid your crap, it looks like it is marked as malware. Good luck getting that removed." - by Coren22 (1625475) on Monday November 02, 2015 @03:52PM (#50850445)
False positive: I've wrote 'em long ago, no response vs. 60++ REPUTABLE sources (not nobodies) below that fries you Coren22!
Is that YOUR fake site for MORE LIES Coren22?
Lying about me LIKE YOU DID HERE punk? -> http://slashdot.org/comments.p... ??
---
MalwareBytes' hpHosts Admin (MalwareBytes employee) hosts & recommends it -> http://hosts-file.net/?s=Downl... & MalwareBytes = BEST antivirus per this VERY recent testing of them all http://www.av-test.org/en/news...
&
It's safe proven by 57 antivirus programs recently in BOTH its 64-bit model https://www.virustotal.com/en/...
+
Its 32-bit model too https://www.virustotal.com/en/...
More "SALT IN YOUR WOUNDS" -> http://f.virscan.org/APKHostsF...
APK
P.S.=> /.'ers say my work is good too:
"his hosts program is actually pretty good" - by xenotransplant (4179011) on Monday August 10, 2015 @03:34PM (#50287195)
"I like your host file system." - by Karmashock (2415832) on Wednesday September 09, 2015 @03:57PM (#50489401)
"APK is kinda right... I've given up on JS based adblocking and gone to blackholing in /etc/hosts, just like it was back in the 90s. The computational load has gotten intolerable for any ad-blocking using JS. I've tried his hosts file generating software. It works." - by bmo (77928) on Thursday October 15, 2015 @11:30AM (#50736071)
"his hosts tool is actually useful for those cases in which one does indeed want to locally block stuff outright while consuming minimum system resources" by alexgieg (948359) on Friday September 25, 2015 @09:57AM (#50596461)
Yep, "People at Linus' caliber" also understand that gcc is not the only compiler in the world. gcc-centrism is the vaxocentrism of the 21st century.
#naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
Errrr... except that I now see that this is validating an IP header, so it's not really the same situation.
#naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
"I guess we should avoid your crap, it looks like it is marked as malware. Good luck getting that removed." - by Coren22 (1625475) on Monday November 02, 2015 @03:52PM (#50850445)
False positive: I've wrote 'em long ago, no response vs. 60++ REPUTABLE sources (not nobodies) below that fries you Coren22!
Is that your fake site for more lies Coren22?
Lying about me LIKE YOU DID HERE punk? -> http://slashdot.org/comments.p... ??
---
MalwareBytes' hpHosts Admin (MalwareBytes employee) hosts & recommends it -> http://hosts-file.net/?s=Downl... & MalwareBytes = BEST antivirus per this VERY recent testing of them all http://www.av-test.org/en/news...
&
It's safe proven by 57 antivirus programs recently in BOTH its 64-bit model https://www.virustotal.com/en/...
+
Its 32-bit model too https://www.virustotal.com/en/...
More "SALT IN YOUR WOUNDS" -> http://f.virscan.org/APKHostsF...
APK
P.S.=> /.'ers say my work is good too:
"his hosts program is actually pretty good" - by xenotransplant (4179011) on Monday August 10, 2015 @03:34PM (#50287195)
"I like your host file system." - by Karmashock (2415832) on Wednesday September 09, 2015 @03:57PM (#50489401)
"APK is kinda right... I've given up on JS based adblocking and gone to blackholing in /etc/hosts, just like it was back in the 90s. The computational load has gotten intolerable for any ad-blocking using JS. I've tried his hosts file generating software. It works." - by bmo (77928) on Thursday October 15, 2015 @11:30AM (#50736071)
"his hosts tool is actually useful for those cases in which one does indeed want to locally block stuff outright while consuming minimum system resources" by alexgieg (948359) on Friday September 25, 2015 @09:57AM (#50596461)
If anything, he was too friendly. People submitting stuff like that should be banned from contributing until they have learned how to write readable code.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Looking at some comments here and in similar stories, it seems there are quite a few people that would indeed try this.
Relevant quote: "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan
That one is very, very true.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Well, the specific behavior in this types of cases will/may depend on the hardware.
Which is exactly why you should use a compiler intrinsic since it's their job to keep track of machine details.
And in any case using a gnu version-specific intrinsic is probably not the best thing to do in general.
They didn't use the gnu intrinsic, they macro'd it out into to resolve to an intrinsic where available. That's the best way to do it until all compilers get their act together and provide some form of "perform arithmetic and tell me if it overflows".
This is the same way that all extensions are handled. Have AES_NI, you get some intrinsic, otherwise you go down a generic code path.
Nothing wrong with discussing Linus' "management" style, but perhaps there is a reason there is not a kernel fork called "The Mother Fucking Kernel Fork For Assholes".
Well, I want to write my own hobby OS, I never found linux source code readable, no reusable also.
Loonix rants about everything because he's a petulant child.
Fuck yourself
First, I am NOT a huge Linus fan - I think he is a pretentious jerk ... but I am going to defend him here.
Linus shares a bunch of traits with Steve Jobs, who I always thought was also a jerk. That's both bad (both men had a boorish habit of trashing people with a lower position in their respective pecking orders, i.e. they're not "good people" ) and good (by being so particular, they forced the creation of superior products).
I do not think of either Jobs or Torvalds as a superior coder, or even a superior intellect - just as a couple of guys who know what they want and are merciless in driving the process to provide it with QUALITY. The world has lots of people in it, and they are happily all different. Guys like these two are probably beastly to know, but they drive excellence and they have a place (probably not around children, kittens, and puppies).
Would it be nice if Linus was less abusive? Yup. I particularly grow weary of all the anti-Christ rantings. If you are not going to abuse Mohammed or Buddah, etc knock off the Christ references - it's not bold or brave it's just an attack that you know is safe (there are no Christian Jihadi's, and Christ is not associated with any particular ethnicity). There IS a difference though between being offensive (insulting somebody or some belief system) and simply loudly criticizing a bad decision (like this coding issue). It's a little tiring when people who cannot defend their work on a technical basis, latch on to the unpleasant aspects of a Jobs or Torvalds rant and complain about it being "personal" as a distraction for the content of the actual criticism.
and you're a grotesquely ugly freak.
PCC
Plz do!
Plz do not require includes to be included all the time
even when it was included already.
iki beer
good
Practically the code can only overflow in the one case covered in Linus fix. The hlen value is returned by a method using u16 internally adding the frag_hdr size + 8 wont be enough to make this overflow a 32 bit int and afaik the Linux kernel does not support 16 bit processors. Since the u16 size for hlen is based on the size of a value in the IPv6 header the code is also unlikely to break in the future.
Basically the original patch is overly defensive and shows a general lack of understanding of the code it fixed by protecting against impossible issues. There have been occasions in the past where such patches introduced new bugs, people "fixed" code following suggestions made by static code analysis tools without knowing what they fixed.
Seriously, who cares?
If you gave me a choice between a printer and a giraffe with explosive diarrhoea, i'll get my ladder and my raincoat
TBH Linus too falls in the camp of people who isn't happy with GCC being so aggressive with regard to assume-no-UB in optimization.
Which is a bit of a double standard IMO. I can see why the GCC default for "ordinary" application programmers should default to safe over fast, but for the Linux kernel the default should be fast. If you're smart enough to work on the Linux kernel, you shouldn't fall for such fairly simple pitfalls. You're already capable of overwriting entire harddisks at that point. Quick&dirty is not appropriate. Check your overflows and underflows, make sure your pointers can be trusted. etc.
The code submitted IS CRAP. You could argue LT's crap has problems as well but at least it's readable and that's more important. So is portability.
And anyone who's ever managed people knows that often you can't treat people with kit gloves and get changes in behavior that are required to get the job done. This is especially true with remote workers (IOW all open source developers) because NONE of the standard social cues or pressures are present so there is even less incentive for them to listen/obey/change. It sucks that we are all irresponsible monkeys that don't lock-step in on our own but that's precisely what we are. Often you must be an Alpha Male about these things and that means getting angry (for real or for effect) and tear people a new asshole.
Sadly I actually understand that many women won't get this. This is NOT how female social groups play. But female social groups generally do not build things like code, buildings, ships, computers, etc. that lives depend on and that must be error free and operate to spec despite how much those creating them tend to rebel or just fuck up things. Men have evolved a system for this kind of project that works. Cooperative, nicey-nicey usually results in substandard compromises that do not work as planned or needed or on schedule. Social harmony is preserved but the project fails. In a traditional woman's world, that's OK (I guess) but in the REAL WORLD, it's NOT OK. The Real World is far more complex than the "home and hearth" where female sensibilities were developed, evolved and are ideal.
If this offends, well, then reality offends, and if you cross reality, often you die and your people die. That's why being reality-base trumps male or females wishes, biases and desires. Even men have to submit to it and men who don't typically get kill in accidents, in crimes and in poverty. Women want a place doing "the fun stuff men do"? Well, first, it's not always fun - getting torn a new asshole is standard operating procedure and it's necessary to OUR WORLD which has far more history in harsh realities. I have no problem with women "learning the hard way" and even getting killed, imprisoned or socially shunned like we would for fucking up - nothing teaches like that or having examples of "your kind" in your face. But they want it both ways: the privileges of their old world but the privileges of the new as well. Fuck me but men don't even get both - often we don't even get the privilege OUR MALE WORLD!! So fuck you to all those want things "dainty and nice" in the real world.
I looked at the code in question, and Linus was 110% correct. If one of my engineers wrote that, they would be defecating out of a new asshole which I would happily rip open for them...
... or even worst: double speak (gniffle)
The subject of this post pretty much sums it up.
There used to be a comment you'd hear around the web many moons ago, "Windows isn't done until Lotus won't run". Sorry for my skepticism but I don't trust anything that's window friendly but gives everyone else grief. I haven't heard if MS i complaining so perhaps I'm just a little paranoid.