Live data from Hacker News

A regression is the kernel not giving the same result with the same user space

lkml.iu.edu

401–408 of 408 posts

Re: A regression is the kernel not giving the same result with the same user space

#401

Earlier quoted context omitted.

This is a thing I've been wondering about. Is dynamic linking (in the way that C/C++ programs use it all the time) not a usecase that Rust wants to cover?

You can do dynamic linking, you just can't do it across compiler versions. This is how all of the Linux distros are doing it, for example. It's a spectrum: Rust: recompile the world when you update the compiler C++: recompile the world when you change ABIs or when the ABI changes (My understanding is that MSVC++ changes the ABI every ~2 years? I could be wrong.) C: never recompile the world It's not that we don't wan…

> C++: recompile the world when you change ABIs or when the ABI changes (My understanding is that MSVC++ changes the ABI every ~2 years? I could be wrong.)

This is only half true: every new release, the ABI of the runtime library changes. But the Visual C++ compiler ABI hasn't changed in decades.

If you design your own library ABIs so they don't pass std::foobars around, you can link C++ libraries built with VC++6 with ones built with the latest version, and the whole thing is going to work fine - the trick is that multiple versions of the runtime DLLs can coexist in the same process.

GCC/libstdc++ hasn't changed its ABI in more than a decade, since release 3.3 or 3.4; they even did incompatible changes to std::string in GCC 5 without breaking ABI:

https://developers.redhat.com/blog/2015/02/05/gcc5-and-the-c...

Re: A regression is the kernel not giving the same result with the same user space

#402

Earlier quoted context omitted.

Conversely, I see an insightful take on communication and hierarchy.

Is this like an alt account to issue apologia for unpopular comments? You literally went through the comment tree and rehashed your personal opinion on the comment over and over again.

No. May I offer proof? I’m not sure what the best way would be. Suggestions?

Re: A regression is the kernel not giving the same result with the same user space

#403
post #394

Earlier quoted context omitted.

Dubious. The maintenance argument is weak. https://www.youtube.com/watch?v=2V1FtfBDsLU&feature=youtu.be...

I'm not sure what you mean. I thought it was self-evident that if your interface is an abstract type then you can change the implementation without breaking consumers. If you don't think it's true then please can you explain how? I thought the Clojure argument is not that types don't provide beneficial encapsulation, but that it's not worth paying the cost for them. Again if you know any different I'd be pleased to h…

Apples and Oranges. We're talking about changing the interface. Did you watch the video segment?

Re: A regression is the kernel not giving the same result with the same user space

#404

Earlier quoted context omitted.

No, a software regression is when you fix a specific problem and re-introduce it later on in a code revision. That's literally the definition of a regression bug. That definition has been around since the 70s and I don't think any of you have the designated rights or privileges to change or modify or append that definition.

Nonsense. You don't have the designated rights or privileges to lock down the meaning of anything. The definition as I gave it was used in the 1975 edition of "The Mythical Man-Month". Is that good enough for you?

Nope. The definition I gave comes from the original hackers from TMRC at MIT. As in, the people who also defined the term 'hack.'

Which predates yours by about 20-ish years.

Re: A regression is the kernel not giving the same result with the same user space

#405

Earlier quoted context omitted.

You can do dynamic linking, you just can't do it across compiler versions. This is how all of the Linux distros are doing it, for example. It's a spectrum: Rust: recompile the world when you update the compiler C++: recompile the world when you change ABIs or when the ABI changes (My understanding is that MSVC++ changes the ABI every ~2 years? I could be wrong.) C: never recompile the world It's not that we don't wan…

> C++: recompile the world when you change ABIs or when the ABI changes (My understanding is that MSVC++ changes the ABI every ~2 years? I could be wrong.) This is only half true: every new release, the ABI of the runtime library changes. But the Visual C++ compiler ABI hasn't changed in decades. If you design your own library ABIs so they don't pass std::foobars around, you can link C++ libraries built with VC++6 wi…

Great, thank you for the clarification.

Re: A regression is the kernel not giving the same result with the same user space

#406
post #394

Earlier quoted context omitted.

I'm not sure what you mean. I thought it was self-evident that if your interface is an abstract type then you can change the implementation without breaking consumers. If you don't think it's true then please can you explain how? I thought the Clojure argument is not that types don't provide beneficial encapsulation, but that it's not worth paying the cost for them. Again if you know any different I'd be pleased to h…

Apples and Oranges. We're talking about changing the interface. Did you watch the video segment?

> We're talking about changing the interface.

Who's "we"? I'm talking about changing the implementation.

> Did you watch the video segment?

I watched the bit where he said if you add a constructor to a sum type you have to change everywhere it's pattern matched. True. I'd love to see Clojure's solution where you don't have to change any existing code!

EDIT: Oh wait, I think it's even worse than that. I think he's talking about product types. In which case you should use projection functions and indeed you need to make no changes to old code!

Re: A regression is the kernel not giving the same result with the same user space

#407

Earlier quoted context omitted.

The bug they fix is the bug that keeps the API contract intact. The first application gets its bug fixed, and the second application breaks because it was relying on a bug that didn't match the API contract. You program to an API, not to an implementation. The second application did the latter, and will therefore pay the price.

That's not Linus' position. The "API contract" for the kernel is "we don't break userspace code," not "we don't break userspace code that follows the specs." He would bounce (and flame) the fix you're suggesting.

That sounds insane. Is it written somewhere besides a sporadic Linus rant? (e.g. somewhere here https://www.kernel.org/doc/html/latest/ etc.)

Re: A regression is the kernel not giving the same result with the same user space

#408
That's bonkers.

This sounds like a reasonable definition, but quickly it turns out to be completely insane.

Lets start somewhere far away from Linux, as far away as possible.

Windows XP SP2 blocked access to raw sockets for non-administrators. It also blocked access to \Device\PhysicalMemory to all user-mode code, regardless of the user running it. Linus would say this is a regression.

Fine, lets try something else.

I wrote some C++ code that violated the strict aliasing rule. It worked for me 15 years ago when compilers weren't optimizing so aggressively. I tried to compile it using the latest GCC and got strange results. Should I file a bug with GCC? Sounds like a bug according to Linus's definition. It used to work and now it doesn't. Who cares that I violated the rules in the first place?

"Now, hold on" I head you say. "We were talking about kernel and user, not compiling C++ code. That completely different!"

Well, sure, it's different. But it's also similar. I maintain that the point is the same, but lets go back to Windows for a second.

Lets say we have a program that used to parse the PEB.Ldr structs for whatever reason. In Windows 8 they went through a major change. This program no longer works. Is this a regression?

Raymond Chen has had to deal with this nonsense enough. For example: https://blogs.msdn.microsoft.com/oldnewthing/20031223-00/?p=... And his blog is full of example of dumb programmers counting on internal, undocumented, subject to change and actually changing structs.

If you, the reader, think you're very clever and say it's dissimilar because the LDR structs are user- rather than kernel-owned and -managed structs I give you the same example with EPROCESS. Take a look: http://terminus.rewolf.pl/terminus/structures/ntdll/_EPROCES...

The point is that "breaking" code that does things it wasn't supposed to to should be - and can reasonably be - considered a regression.

The very first example - with raw sockets - may be considered a regression, though I prefer the term "breaking change", since "regression" is a form of a bug, and this is not a bug, even if you think it's a bad policy.

The other examples don't even fall under the "Breaking change" the category. Nothing THAT WAS GUARANTEED was changed. If you counted on things that nobody promised you that would remain the same to actually remain the same that's your problem.

And back to Windows for a moment. Lets say someone uses the UpdateProcThreadAttribute API to set the mitigation policy on a child process it creates. Instead of only setting the bits he want (like PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_ON to force ASLR on all modules, PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON to block win32k calls and PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_ALWAYS_ON to prevent injection by the system of a couple sorts of plugins) he goes on to pass 0xFFFFFFFFFFFFFFFF. He wants all the possible mitigations! He's that smart!

Then comes along Windows 10 with its binary signature policy mitigation and (0x00000003ui64 From what I understand the situation is very similar to this. I'm quoting from John Johansen message on the thread:

It is entirely possible to use the 4.14 kernel on suse without having to modify policy if the policy version/feature set is pinned. However this is not a feature that suse seems to be using. Instead suse policy is tracking and enforcing all kernel supported features when they become available, regardless of whether the policy has been updated.

The clever folks at SUSE decided to enable all the protections/mitigations/features/whatever of AppArmor, including those that didn't even exist when they wrote this stupid policy. It's completely reasonable to think that a program restriction infrastructure's new feature won't restrict programs more. Sure. If it does that's a regression.

Post reply on HN