News for hackers. Stuff that matters.
Re:How did we end up with containers? by gumby on Thursday April 05, 2018 @01:45PM (#16767115)
I have a less charitable explanation, but a container fan on our team convinced me recently to switch to fully static binaries which did indeed simplify many things. So there is something to be said for this in an age of cheap storage.
Re:How did we end up with containers? by jacquesm on Thursday April 05, 2018 @02:19PM (#16767510)
Static linking was the norm until someone figured out that all the copies of glibc were taking up a lot of space in a time when disk space will still expensive. Today it makes much less sense than it did back then but there is one more advantage: updating a library (which is trivial because almost all these systems are online all the time now) will automatically cause all new instances of the rest of the software on the system to use the new library without having to re-link all the binaries.
Re:How did we end up with containers? by maxxxxx on Thursday April 05, 2018 @02:30PM (#16767620)
"there is one more advantage: updating a library (which is trivial because almost all these systems are online all the time now) will automatically cause all new instances of the rest of the software on the system to use the new library without having to re-link all the binaries."

In Windows this is called "DLL hell". Too often the new version will have some subtle incompatibilities breaking a lot of stuff.

I am a fan of static linking or putting DLLs into a dedicated folder so these shared libraries are actually not shared.

Re:How did we end up with containers? by kazinator on Thursday April 05, 2018 @03:42PM (#16768246)
Windows does a good job of versioning the actual system DLL's like user32.dll, kernel32.dll, and so on.

The run-time libraries on top of this aren't part of the system. Each application brings its own and so of course hell will break loose if you mix and match.

Windows has no malloc or printf (not for public use anyway).

In the POSIX world, the user-space C run-time support is part of the platform so it is carefully versioned, just like kernel32.dll on Windows.

User space compiler run-time support isn't part of the platform on Windows; it is not that carefully versioned. Everyone is supposed to provide their own. If you have a compiler from Acme, Inc, you use the Acme C library with Acme malloc and Acme printf.

> putting DLLs into a dedicated folder

Which actually works on Windows, that's the thing.

Searching for shared libs in the same directory as the executable is very nice: like me.c finding its #include "me.h" next to it.

The Unix people didn't pay attention to their own programming language when they designed shared libs.

Re:How did we end up with containers? by marshray on Thursday April 05, 2018 @04:13PM (#16768459)
Most compilers used by app developers don't use this, but...

link /dump /exports c:\windows\system32\msvcrt.dll

    Dump of file c:\windows\system32\msvcrt.dll
    Section contains the following exports for msvcrt.dll

    00000000 characteristics
    57898F96 time date stamp Fri Jul 15 18:36:22 2016
        0.00 version
           1 ordinal base
        1317 number of functions
        1317 number of names

    ordinal hint RVA      name
    ....
       1160  487 00019DE0 malloc
    ....
       1183  49E 00048940 printf
Re:How did we end up with containers? by kazinator on Friday April 06, 2018 @12:52AM (#16770961)
Most compilers used by app developers don't use that for good reason: Microsoft says that it is an unsupported, undocumented library which is off limits to application developers. Programs that are part of Windows itself use it.

https://blogs.msdn.microsoft.com/oldnewthing/20140411-00/?p=...

Re:How did we end up with containers? by jacquesm on Thursday April 05, 2018 @02:34PM (#16767667)
Hm. DLL Hell to me was on Windows to have to upgrade a DLL for which some other dependency had to be downgraded which was the original reason for starting the upgrade in the first place.

But I've seen your trick used in lots of places, in a way that trick is a predecessor to containers, you isolate a functional unit and all dependencies somehow from the rest of the system.

Re:How did we end up with containers? by TimJYoung on Thursday April 05, 2018 @03:30PM (#16768151)
This is essentially what MS did with .NET and assemblies: they made it pretty difficult to install assemblies in the global assembly cache (GAC), and encouraged application developers to simply distribute/load application-specific assemblies in application-specific directories (\Program Files tree). This was all done with the prior experience gained from the system-wide DLL versioning issues that were finally resolved in (I believe) XP/2003.
Re:How did we end up with containers? by jacquesm on Thursday April 05, 2018 @03:35PM (#16768199)
Fortunately by then I'd left the Windows eco system behind.
Re:How did we end up with containers? by maxxxxx on Thursday April 05, 2018 @05:32PM (#16768944)
Lucky you!
Re:How did we end up with containers? by snarfy on Thursday April 05, 2018 @03:32PM (#16768174)
Disk space might be a lot cheaper but RAM is still expensive. If you have a dozen apps running that are statically linked to libc then you have dozen copies of libc in memory. If you have a dozen apps that are dynamically linked to libc, they all get a single copy-on-write version of the same libc. This results in the library code getting shared while library data gets copied.
Re:How did we end up with containers? by jacquesm on Thursday April 05, 2018 @03:40PM (#16768236)
That's true, but there would be 100's or even 1000's of copies of that stuff on your harddrive and with drives being a lot smaller that was a real problem. RAM was always expensive so that's a valid point.

There used to be such a thing as an optimizing linker that would throw out all library code that could not be reached.

Re:How did we end up with containers? by gumby on Thursday April 05, 2018 @02:23PM (#16767539)
> ...Static linking was the norm until someone figured out that all the copies of glibc were taking up a lot of space

Dynamic (with and without relocation) linking far predates the existence of glibc, much less Linux, by decades.

Re:How did we end up with containers? by jacquesm on Thursday April 05, 2018 @02:25PM (#16767568)
Make that libc or the X libraries or any other large chunk of code that was replicated over and over again in every linked binary. The principle remains the same, and yes, it predates Linux by a comfortable margin.

I'm trying to remember if the old mainframe I worked on had it but I'm not 100% sure.

Re:How did we end up with containers? by gumby on Thursday April 05, 2018 @03:02PM (#16767941)
It was core functionality of the design of Multics in the 1960s and Multics adopted it from prior art.
Re:How did we end up with containers? by jacquesm on Thursday April 05, 2018 @03:07PM (#16767989)
Interesting!

I worked with a PDP/11 running Unix in the 80's and it definitely did not have dynamic linking. All the library files were simply linked to the executables and stripped of symbols before shipping to save space.

Anybody here have VAX 11/7XX experience? I wonder how it was on other DEC products.

Re:How did we end up with containers? by eeZah7Ux on Friday April 06, 2018 @11:48AM (#16774140)
The security aspect is critical!

We cannot expect organizations to be ready to rebuild tons of software, in a short time, every time there's a new vulnerability in a popular library like OpenSSL.