Slashdot Mirror


GNU C Library Alternative Musl Libc Hits 1.0 Milestone

New submitter dalias (1978986) writes "The musl libc project has released version 1.0, the result of three years of development and testing. Musl is a lightweight, fast, simple, MIT-licensed, correctness-oriented alternative to the GNU C library (glibc), uClibc, or Android's Bionic. At this point musl provides all mandatory C99 and POSIX interfaces (plus a lot of widely-used extensions), and well over 5000 packages are known to build successfully against musl.

Several options are available for trying musl. Compiler toolchains are available from the musl-cross project, and several new musl-based Linux distributions are already available (Sabotage and Snowflake, among others). Some well-established distributions including OpenWRT and Gentoo are in the process of adding musl-based variants, and others (Aboriginal, Alpine, Bedrock, Dragora) are adopting musl as their default libc."
The What's New file contains release notes (you have to scroll to the bottom). There's also a handy chart comparing muscl to other libc implementations: it looks like musl is a better bet than dietlibc and uclibc for embedded use.

134 comments

  1. Either gnu libc is hideously slow and bloated... by Viol8 · · Score: 1

    ... which I don't believe because the guys at gnu know a thing or 2 about compilers and libraries - or this library has cut some corners and/or missed out some functionality.

  2. pkgsrc test results by staalmannen · · Score: 4, Informative

    For those curious about which "5000 packages" that build with musl, there is the awesome automated pkgsrc tests published: http://wiki.musl-libc.org/wiki...

    1. Re:pkgsrc test results by jandrese · · Score: 1

      % ./configure checking for C compiler... gcc checking whether compiler is gcc... yes checking whether to build musl-gcc wrapper... yes checking target system type... amd64-undermydesk-freebsd ./configure: unknown or unsupported target "amd64-undermydesk-freebsd"

      :(

      I thought this might be helpful in those cases where something doesn't like llvm libc, but no such luck. It also appears to lack c++ support, which is a pretty big caveat in this day and age.

      --

      I read the internet for the articles.
    2. Re:pkgsrc test results by dalias · · Score: 1

      The problem appears to be that "x86_64" is identified by your compiler as "amd64" in the machine tuple. This is easily fixed by adding --target=x86_64 (the name musl knows it by) on the configure command line. I don't see any reason we can't add "amd64" to the detection logic in configure too, so this should work better for you in a future release.

    3. Re:pkgsrc test results by jandrese · · Score: 1
      Hmm, well that got it built, but it still doesn't work.

      % /usr/local/musl/bin/musl-gcc hello.c
      /usr/local/musl/lib/libc.so: undefined reference to `isinf'

      I didn't see any obvious errors while it was building, but there were like a million lines of buildscroll to go through, and it would have been so easy to miss one. There's probably just enough issues with this to make it not worth it sadly.

      --

      I read the internet for the articles.
    4. Re:pkgsrc test results by dalias · · Score: 1

      There is no isinf symbol or reference to one in musl, so I think this is something to do with your toolchain (a BSD-packaged version of LLVM that tries to make itself look like gcc?). Pretty much all of your concerns (including "lack of C++") could be solved by building a toolchain to target musl (note: uClibc and glibc make you do this anyway; musl is fairly unique in providing a way, albeit sometimes clunky, to use the new libc without a new compiler toolchain). If you want to do that or proceed trying to get the wrapper to work on your system, you'll find people who can help in Freenode #musl or on the mailing list. On the other hand I understand if you don't want to go to the trouble, but keep in mind you're using a non-native setup that's probably never been tested.

    5. Re:pkgsrc test results by Anonymous Coward · · Score: 0

      That you have to build a new toolchain for each libc is most definitely a GCC bug and not an intrinsic property of compilers. I don't have to build a new toolchain to use pcc or tcc with different libc, it's just that GCC is very poorly engineered with no understanding of modularity.

    6. Re:pkgsrc test results by Anonymous Coward · · Score: 0

      Why the fuck would you care if a C library doesn't support C++?

      If you are using the C standard library in C++, you are doing it wrong.

  3. Re:Either gnu libc is hideously slow and bloated.. by staalmannen · · Score: 3, Insightful

    It might be easier to add than to remove, leading to bloat over time and glibc has been around for a while. Also, building on old code might mean that you are limited in what you can change. For example, the modular design of LLVM has been a pretty big success and is considered easier to work with/develop than gcc. For musl, I think they have decided to remove all legacy stuff + non-standard extensions.

  4. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    libc is just old and not developed very much...

  5. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    I'm guessing that it only targets x86, amd64, ARM, and MIPS. That sounds comprehensive until one considers sparc, HPPA, PPC, POWER, and various "embedded but not ARM or MIPS" architectures like Blackfin or CRIS.

  6. Real benefit? by Jizzbug · · Score: 0

    What is the real benefit besides license? Is it correctness?

    --

    -=/\- Jizzbug -/\=-
    1. RE: Real benefit? by Anonymous Coward · · Score: 0

      For me the license is an anti-benefit. Without it, you get closed operating systems built on open source that aren't copy left, such as the various operating systems built on FreeBSD.

    2. Re: RE: Real benefit? by Anonymous Coward · · Score: 0

      Good. Makes it freetard free.

    3. Re:Real benefit? by savuporo · · Score: 1

      Maybe size, too. Minimal statically linked GLIBC based executable was about 100K or more on ARM last time i checked, pulling in crap related to io, locales etc, that were never even referenced from the code. Bionic was much better.

      --
      http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
    4. Re: RE: Real benefit? by Anonymous Coward · · Score: 0

      Bad. Makes it freeloader full.

  7. define _GNU_SOURCE by cyberthanasis12 · · Score: 2, Interesting

    I downloaded the library to see some random code. Here is the very first file I (randomly) chose (putw.c):

    #define _GNU_SOURCE
    #include
    int putw(int x, FILE *f)
    {
    return (int)fwrite(&x, sizeof x, 1, f)-1;
    }

    Cheers.

    1. Re:define _GNU_SOURCE by kthreadd · · Score: 1

      Sounds reasonable since this library is mostly focused on GNU/Linux and not just POSIX compliance.

    2. Re:define _GNU_SOURCE by dalias · · Score: 1

      putw is a nonstandard functions and used by basically nothing, so a simple, obviously does-what-the-man-page-says solution in terms of another well-tested function is preferable to repeating the locking, buffer manipulation, etc. logic in a place that's unlikely to ever get tested.

    3. Re:define _GNU_SOURCE by QuietLagoon · · Score: 2

      and the problem with that code is...?

    4. Re:define _GNU_SOURCE by fph+il+quozientatore · · Score: 1

      Clearly, it should've been _GNU_LINUX_SOURCE.

      --
      My first program:

      Hell Segmentation fault

    5. Re:define _GNU_SOURCE by uhmmmm · · Score: 2

      putw is a non-standard function that musl's headers only expose to programs when they define _GNU_SOURCE.or _BSD_SOURCE. The file that actually implements it, therefore, needs to define one of these in order for the header to expose the declaration, which allows the compiler to verify that the type signatures of the declaration and the definition match.

    6. Re:define _GNU_SOURCE by flargleblarg · · Score: 1

      Having knowledge that EOF == -1 is disgusting. And using it in a formulas? Even more disgusting. IMHO, that code makes me sick. I would write it instead as:

      return (fwrite(&x, sizeof x, 1, f) == 1)? 0 : EOF;

      which to me is much clearer.

    7. Re:define _GNU_SOURCE by flargleblarg · · Score: 1

      Actually, I would write it like this:

      int putw(int x, FILE *f)
      {
      bool success = (fwrite(&x, sizeof x, 1, f) == 1);
      return success? 0 : EOF;
      }

    8. Re:define _GNU_SOURCE by Anonymous Coward · · Score: 0

      And this is why you are not a libc implementer.

    9. Re:define _GNU_SOURCE by Anonymous Coward · · Score: 0

      Why?

      it is more verbose adds a little bit of overhead, and doesn't make it any clearer.

      Lose/lose

  8. Why is libm.a empty? by Sponge+Bath · · Score: 2, Funny

    From the FAQ:

    On musl, the entire standard library is included in a single library file — libc.a for static linking, and libc.so for dynamic linking. This significantly improves the efficiency of dynamic linking, and avoids all sorts of symbol interposition bugs that arise when you split the libraries up — bugs which have plagued glibc for more than a decade.

    Bringing it all together? That's why they call it the love musl.

  9. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 3, Insightful

    the guys at gnu know a thing or 2 about compilers and libraries

    You obviously never worked on or looked at their source code.

  10. glibc is horribly bloated by uhmmmm · · Score: 4, Informative

    The first priority on musl is correctness, and they will take a hit to size and speed if that's what's necessary to achieve it. But thus far, they've been doing a good job of achieving correctness without introducing too much bloat.

    Take a look at their page on bugs found while developing musl, and you'll find that they've found and reported quite a few bugs in glibc where glibc had been "cutting corners".

    1. Re:glibc is horribly bloated by Just+Some+Guy · · Score: 3

      LOL Drepper. He had a free pass to be an abrasive jerk for years because of his supposed dedication to perfection and uncompromising quality. In retrospect, maybe he was just a jerk to shut down people who wanted to examine his work more closely than he liked.

      --
      Dewey, what part of this looks like authorities should be involved?
    2. Re:glibc is horribly bloated by dalias · · Score: 4, Interesting

      I've submitted at least two bugfix patches to glibc where the diff was 100% "-" lines for things Drepper added. I believe they were all eventually committed. And thankfully this is the one type of glibc patch submission that doesn't require having a copyright assignment on file with the FSF. ;-)

    3. Re:glibc is horribly bloated by Just+Some+Guy · · Score: 5, Funny

      You're doing God's work, son.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:glibc is horribly bloated by Anonymous Coward · · Score: 0

      That was my thought when I saw this headline: did people get sick of Drepper?

    5. Re:glibc is horribly bloated by Samantha+Wright · · Score: 1

      You know it's a problem when...

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    6. Re:glibc is horribly bloated by Raenex · · Score: 1

      Wait, it says "RESOLVED FIXED", does that mean Red Hat fired him and revoked his commit access?

    7. Re:glibc is horribly bloated by Tough+Love · · Score: 1

      He became a vp at Goldman Sachs. Where I suppose he fits in well.

      --
      When all you have is a hammer, every problem starts to look like a thumb.
  11. Re:Either gnu libc is hideously slow and bloated.. by Improv · · Score: 5, Insightful

    Steps to a useless comment:
    1) Speculate on the features of something
    2) Note that that speculated feature set doesn't include something you want
    3) Criticise based on your speculation

    --
    For every problem, there is at least one solution that is simple, neat, and wrong.
  12. Musl's supported architectures by uhmmmm · · Score: 3, Informative

    You're right that musl doesn't support the same breadth of architectures that glibc does. They currently support x86, amd64, ARM, MIPS, PPC, microblaze, and they have experimental support for superh and x32.

    One big advantage they do have is that it's much simpler to add support for a new architecture to musl than it is to add it to glibc. They are interested in supporting more architectures, so I'd expect their list of supported architectures to grow fairly quickly if there are people interested in that support.

    1. Re:Musl's supported architectures by dalias · · Score: 3, Insightful

      We have people working on aarch64, someone interested in doing a sparc port, and interest from the OpenRISC folks in musl too (and I've offered to help them with a port). There's also someone who wants to port to LM32-mmu (which, as I understand it, doesn't have any userspace infrastructure yet and only a very experimental kernel port).

    2. Re:Musl's supported architectures by Anonymous Coward · · Score: 0

      What is involved in a port?

      In my mind, there is the assembler macros for making syscalls, some assembler for returning from signals, optionally a bunch of hand optimised routines for performance operations like memcpy, and what else, ldopen?

      What other details am I missing. I'm most familiar with the Plan9/9front libc, which is entirely written in C, but for a macro that makes syscalls, but the Plan9 ABI is much more regular across architectures than Linux. The Plan9 libc is also nearly 4x slower than glibc for functions like memcpy, strstr, etc.

    3. Re:Musl's supported architectures by uhmmmm · · Score: 1

      What is involved in a port?

      This list is probably not absolutely 100% complete, but it should be pretty close:

      • A number of header files defining system call numbers, and structures for interfacing with the kernel. Musl does not require or use the linux kernel headers, so these definitions must be provided by the port itself.
      • Assembly code for making system calls. There's an inline function version, an implementation of the variadic syscall(2) function, and a version for system calls that made as part of functions defined to be cancellation points
      • The main _start entry point, which just needs to align the stack as appropriate for the target ABI and call __libc_start_main
      • A few atomic primitives, probably written in assembly, but some architectures require calling into a kernel helper to implement these
      • Assembly implementations of setjmp/longjmp
      • Assembly to query/poke at the floating point state, for fenv support
      • Assembly for returning from a signal
      • Assembly for a couple threading things (getting/setting the thread pointer, terminating the calling thread)
      • A couple specific system calls. Clone requires an assembly version. A couple architectures return the result of the pipe syscall via registers, which also requires an assembly implementation on those architectures.
      • A little code to handle the few dynamic relocation types particular to the architecture (which are likely to be identical to those used by other architectures, just with different numbers)
      • Optionally, optimized assembly versions for some math functions, memcpy, and such

      You can find links to more information on the musl wiki.

  13. buffer overflow in printf ... great for security!! by Jizzbug · · Score: 0

    bugs fixed:
    - buffer overflow in printf when printing smallest denormal exactly

    --

    -=/\- Jizzbug -/\=-
  14. Is it all about the license? by jimwelch · · Score: 1

    The first thing I saw was MIT vs GPL. What is the difference between the two?

    --
    Never trust a man wearing a coat and tie!
    1. Re:Is it all about the license? by Githaron · · Score: 1

      GPL requires you make your chances available under the GPL license while MIT makes almost no requirements.

    2. Re:Is it all about the license? by Archangel+Michael · · Score: 2

      http://stackoverflow.com/quest...

      Of course Google it your self next time.

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    3. Re:Is it all about the license? by jimwelch · · Score: 1

      My sarcasm tag did not get passed on!

      --
      Never trust a man wearing a coat and tie!
    4. Re:Is it all about the license? by swv3752 · · Score: 1

      MIT allows one to take your code and do what they will, including wrapping it up in a proprietary license. GPL requires that if one takes code, makes changes and distributes, they need to make the sourceof thsoe changes available to those they distribute the compiled or source code to. An example of taking MIT licensed code is what Microsoft did with BSD networking code and kerberos. The changes Microsoft did to BSd to make it work in Windows are lost to the community, including any potential bug fixes and security improvements. MS took kerberos and made it incompatible with the Open Source offerings.

      The other issue is that if you mix GPL and MIT licensed code, the whole thing becomes GPL.

      --
      Just a Tuna in the Sea of Life
    5. Re:Is it all about the license? by unixisc · · Score: 1

      What is the essential difference(s) b/w MITL and BSDL?

    6. Re:Is it all about the license? by Anonymous Coward · · Score: 0

      If you license under MIT or BSD you don't have to deal with the FSF children harassing you to rename it GNU+Project.

    7. Re:Is it all about the license? by dalias · · Score: 1

      If you're talking about modern BSD licenses, basically there's no difference but the wording. Some older BSD licenses were mildly more restrictive, most notably the ones with the advertising clause that technically conflicts with the GPL.

    8. Re:Is it all about the license? by vilanye · · Score: 1

      glibc is LGPL, so you can dynamically link to it if you don't want your app to be GPL'd.

  15. Re:Either gnu libc is hideously slow and bloated.. by Dr.Dubious+DDQ · · Score: 1

    The chart shows a few things, though I notice they don't include comparison to the full glibc itself.

  16. Reinventing GPL wheels by Anonymous Coward · · Score: 0

    Such a trend to reinvent wheels. Hidden intention seems to be to allow more "Mixed source" BS through the push for permitive licenses. And devs are falling all over it by providing free code to these projects. A shame.

    1. Re:Reinventing GPL wheels by LDAPMAN · · Score: 1

      That Devs are "falling all over it to provide code" is the point. Permissive licenses are desirable to a lot of people.

    2. Re:Reinventing GPL wheels by thevirtualcat · · Score: 2, Insightful

      If you're a developer working for a company and you have your choice between an MIT|BSD library and a GPL library that, on a technical level, work equally well, it's a hard sell to choose the GPL library.

      Consider...

      "Well boss, if we use libfoo, we'll have to disclose our source code since it's GPL. There are ways around it by doing things like writing LGPL wrappers and dynamically linking it, but we'll have to distribute THAT source code, instead. Plus, you may want to run this by legal, since the developer has outright refused to sell non-GPL licenses..."

      Versus...

      "Well boss, if we use libbar, we can just use it since it's MIT. If we make changes to it, we should contribute them back, but we're not obligated to do anything except keep their copyright notice."

      With that in mind, is it any wonder projects like llvm and musl are popping up and gaining the support of large companies that use them?

    3. Re: Reinventing GPL wheels by Anonymous Coward · · Score: 0

      You do know that glibc is lgpl?

    4. Re: Reinventing GPL wheels by Anonymous Coward · · Score: 0

      Permissive licenses are only desireable to people who want to prevent end users from having the same freedom that developers have. Similar to how governments want to prevent citizens from having the same power that government agencies have.

    5. Re: Reinventing GPL wheels by thevirtualcat · · Score: 1

      Ah, so it saves them the trouble of writing the LGPL wrapper around it. Good to know.

    6. Re:Reinventing GPL wheels by dalias · · Score: 3, Insightful

      The main effect of glibc being LGPL is not that companies don't use it, rather it's that nobody making non-free software is willing to static-link it, so you end up with versioning hell. glibc partially solves this problem with symbol versioning, but the solution actually makes the problem worse in other cases: for example, in order to provide a binary that runs on systems with older glibc, people making binaries intentionally link against an older glibc, using the outdated/bug-compatible symbol versions instead of the up-to-date ones.

      Of course if your goal is to make sure non-free software is always breaking and giving people problems, that's a potential benefit of the LGPL.

      With musl, all you have to do to make a binary that works with older versions of the shared libc is avoid using functionality that was introduced in later versions. Or you can just static link and have it work everywhere.

    7. Re:Reinventing GPL wheels by Anonymous Coward · · Score: 0

      Yes, doing something new and improving on the status quo is a horrible thing. Well, ill just go back to reboot my win3.0 box, Trumphet winsock is acting up again, brb.

      And indeed the license does matter. Maybe not to you, but to many other people (and for many different reason). It is a shame you feel the need to tell people what is worthwhile to work on or that you are actually berating developers for adding code to open source projects in the first place. You shoes must be damn tight.

    8. Re:Reinventing GPL wheels by dalias · · Score: 1

      BTW, in case anyone thinks I'm making up the thing about intentionally linking to ancient glibc, see this: http://www.crankuptheamps.com/...

    9. Re:Reinventing GPL wheels by marcello_dl · · Score: 0

      Yes, people who want to avoid the requirements of the GPL, which asks simply for letting people get advantage of the code you distribute as you got advantage of the code you modify. "Freely you have received, freely give" (Matthew 10). Therefore if you love Jesus you follow the GPL, if you don't believe in god you follow the atheist Richard M. Stallman's license. Else you are obviously wicked.

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    10. Re:Reinventing GPL wheels by epyT-R · · Score: 1

      Except that you're wrong. If you change the library itself you'd have to release the patches. If you're just dynamically linking to it, you don't. A more appropriate question your boss might ask is "Why the hell are you putting our 'secrets' into the libc?"

    11. Re:Reinventing GPL wheels by Anonymous Coward · · Score: 0

      Just ship with an updated glibc.so file. drrr

  17. Link to comparison chart by paulpach · · Score: 4, Informative

    Here is a link to the comparison chart mentioned in the description.

    1. Re:Link to comparison chart by Anonymous Coward · · Score: 0

      That seems to be from 2011 ...

  18. Re:Brain damaged project by pe1rxq · · Score: 3, Insightful

    Have you ever looked at static linking in detail?
    A .a file is basicly a collection of .o files. The linker only links those that are needed.
    So they have a single .a file instead of two or more .a files. This allows them to prevent difficult interdepencies between those .a files.
    The end result might still be a very small subset of the complete library.

    --
    Secure messaging: http://quickmsg.vreeken.net/
  19. re: Brain damaged project by uhmmmm · · Score: 3, Informative

    Where does it say you have to link the whole thing into your application? Musl supports dynamic linking just fine. The musl developers do have a preference for static linking, so they have better support for it than glibc (see their size comparisons of static linked programs on musl and glibc, for instance). But that doesn't mean you have to use it.

    The bit about aiming for correctness is correctness of musl itself. Of course they can't, in general, guarantee that you will write your own code correctly. In theory, they could split the math library out and force you to link against it correctly. But what would be the point? To arbitrarily break broken programs, while having no impact on correct programs? It would also have several downsides.

    Musl is the only C library I'm aware of which allows the entire C library ecosystem (C library, math library, threading library, dynamic linker, and some others probably) to be upgraded atomically, which eliminates a small window during upgrade where you might start a new program and have it break because it gets conflicting versions of these components.

    There is also code within the main C library (for example, the code to format floating point numbers in printf) which benefits from being able to call functions that are part of the math library.

  20. Why should I drop glibc? by peppepz · · Score: 1

    Forking the Linux userland yet again should have some serious motivations behind it. I can't find them neither in the benchmarks nor in the feature comparisons provided here.

    1. Re:Why should I drop glibc? by dalias · · Score: 4, Insightful

      If you don't want to switch, that's fine. You're still getting the benefits of musl, because competition has driven the glibc developers to fix, or at least study how to fix, a number of longstanding bugs in glibc.

    2. Re:Why should I drop glibc? by peppepz · · Score: 2

      The libc is not a library like all the others. Proposing a binary- and source- incompatible replacement for glibc, as is being done here, means to partition the Linux userspace, both binaries and source code, into two isolated subsystems. Something that we are already suffering with Android. This is not a benefit, this is a damage for the Linux community as a whole, and it will hurt me even if I don't want to switch. Casual PC users already run into enough problems when switching to Linux; asking them to check which libc is required before installing a program is the kind of nuisance that makes them run away. I don't contest musl developers' freedom to code whatever they want, and I welcome their efforts. I do contest the stance to replace glibc with an incompatible library, whomever it comes from.

    3. Re:Why should I drop glibc? by Anonymous Coward · · Score: 1

      You get your binaries from distributions anyway and with musl your closed source bits can just statically link safely libc and live happy and isolated.

    4. Re:Why should I drop glibc? by Anonymous Coward · · Score: 0

      The libc is not a library like all the others. Proposing a binary- and source- incompatible replacement for glibc, as is being done here, means to partition the Linux userspace, both binaries and source code, into two isolated subsystems.

      Actually it is. The only library that is not like all the others is linux-vdso.so.1 (and it's equivalent on other kernels), because it doesn't actually exist on disk and is a kernel resident object.

      I have both musl and glibc on my systems, and they have different filenames, so I can have both installed without conflicts. Programs interoperate through IPC and the filesystem, so having programs built against different libc on the same system is not a problem. The one thing I haven't tried is linking libraries from different libc, that might cause problems.

      And musl and glibc are both source-code compatible in that they both implement a POSIX and ISO compatible libc. The only place where you would get source incompatibilities is in non-conformant programs that take advantage of defects or non-standard APIs of one of the libc, and the real solution here is to have developers fix their code so that it conforms to the standard.

      I am in favor of replacing glibc, as the bugs in glibc, and the headaches around trying to get Gnu's arcane and defective build system to work, including the bugs in GCC that require a libc specific toolchain, and the bugs in GCC that make the built toolchain dependent on the building toolchain, have caused me enough pain and suffering that anything is better than glibc at this point.

    5. Re:Why should I drop glibc? by peppepz · · Score: 1

      You get your binaries from distributions anyway

      No, I get binaries from wherever I want and it works.

      and with musl your closed source bits can just statically link safely libc and live happy and isolated.

      I can't live happily without shared libraries. They were invented for good reasons tens of years ago and have been used extensively ever since. Think about the "bloat" of statically linked executables and the fact that they don't get updates of the linked-in library code (including security fixes).

    6. Re:Why should I drop glibc? by peppepz · · Score: 1

      Actually it is.

      It's linked by any executable on your system and it has the role of loading every single dynamic binary that you have installed, including init. It's special.

      I have both musl and glibc on my systems, and they have different filenames, so I can have both installed without conflicts.

      Of course you can have both installed, but not without conflicts, you must be very careful to avoid the sea of conflicts that arise when you have two incompatible libraries with the same name.

      Programs interoperate through IPC and the filesystem, so having programs built against different libc on the same system is not a problem.

      You'll have to:
      - duplicate every single binary and library to have libc and musl versions;
      - ensure that the version of each binary is the same for its libc and musl image (otherwise IPC and filesystem communication will fail);
      - ensure that the libc and musl versions of the binary are installed in two different paths and don't interfere (otherwise a libc program dlopening a musl plugin will fail), and rewrite all the software which uses hardcoded paths (e.g. Python);
      - ensure that libc and musl types are binary-compatible (otherwise IPC and filesystem communication will fail);
      - ensure that every package you compile finds the correct version of both libc and musl when you compile it;
      - have your machine withstand the memory pressure of two different and unshareable userspace images running simultaneously (so much for fixing "bloat");
      - ...

      And musl and glibc are both source-code compatible in that they both implement a POSIX and ISO compatible libc.

      Even Microsoft Visual C++ is ISO C compliant. So you can write programs that will compile on both GLIBC and Visual C++. As long as you don't use non-standard stuff such as 64-bit integers.

      The only place where you would get source incompatibilities is in non-conformant programs that take advantage of defects or non-standard APIs of one of the libc, and the real solution here is to have developers fix their code so that it conforms to the standard.

      If I am a user, I want my binaries to run and that's it. I don't have the option to ask whoever coded the programs that I use to rewrite them because I don't like their choice of API usage.
      Furthermore, any library that is actually deployed and used will get bugs fixed, which can cause incompatible changes, and standards will be amended in ways that can break compatibility (for instance, the addition of getline() to the C library). What do you do then? Ask users to rewrite all the programs that they use every time such a thing happens?

      the headaches around trying to get Gnu's arcane and defective build system to work

      I've heard millions of times that autotools suck. That's true. The problem is that everybody else (and I mean scons, cmake, waf, ...) sucks even more. Autotools give me, as a user, and have done so since the 90s:
      - cross compiling support;
      - ability to change any installation path;
      - ability to have a temporary installation path for packaging;
      - ability to apply a transformation to program names;
      - a standardized way to change any of the tools to be used during compilation;
      - support for building shared and static libraries simultaneously using the best compiler options for each case;
      and probably something else that I'm forgetting.

    7. Re:Why should I drop glibc? by Anonymous Coward · · Score: 0

      It's linked by any executable on your system and it has the role of loading every single dynamic binary that you have installed, including init. It's special.

      Except statically linked binaries. Those were linked at build time, but they don't invoke the linker when they are executed. Guess what I use musl for? Building static binaries.

      Of course you can have both installed, but not without conflicts, you must be very careful to avoid the sea of conflicts that arise when you have two incompatible libraries with the same name.

      But musl libc does not have the same name as glibc. It uses non-colliding filenames. Further I build all my other libraries linked to musl into /usr/musl/lib, so those names don't collide either.

      You'll have to:
      - duplicate every single binary and library to have libc and musl versions;

      Nope. Binaries I only need one or the other, not both. Libraries only when I need a musl version of a library.

      - ensure that the version of each binary is the same for its libc and musl image (otherwise IPC and filesystem communication will fail);

      No. Only for shit software that doesn't have any kind of protocol.

      - ensure that the libc and musl versions of the binary are installed in two different paths and don't interfere (otherwise a libc program dlopening a musl plugin will fail), and rewrite all the software which uses hardcoded paths (e.g. Python);

      Yes, ok, sure, but I have that covered. As for Python, I only have glibc Python on my glibc/musl system.

      - ensure that libc and musl types are binary-compatible (otherwise IPC and filesystem communication will fail);

      What? No. musl and glibc both use the same sysv-ABI.

      - ensure that every package you compile finds the correct version of both libc and musl when you compile it;

      Much less of a problem without autoconf trying to break things.

      - have your machine withstand the memory pressure of two different and unshareable userspace images running simultaneously (so much for fixing "bloat");

      Wrong. It's right in theory, except musl statically linked binaries still use less memory than glibc dynamically linked programs. Glibc is bloat in carnate.

      Even Microsoft Visual C++ is ISO C compliant. So you can write programs that will compile on both GLIBC and Visual C++. As long as you don't use non-standard stuff such as 64-bit integers.

      Wrong. ISO C specifies stdint.h, int64_t is a standard way to get a 64-bit signed integer, and uint64_t is standard for 64-bit unsigned integers. The fact that you don't know ISO C is illuminating.

      If I am a user, I want my binaries to run and that's it. I don't have the option to ask whoever coded the programs that I use to rewrite them because I don't like their choice of API usage.

      Funny, I want the same thing. Musl gives me that in a way glibc can't. With musl, a developer can build a statically linked binary that will work anywhere. With glibc they have to include the kitchen sink, copying every library that the program uses, and every library those libraries link against whether it uses them or not.

      Furthermore, any library that is actually deployed and used will get bugs fixed, which can cause incompatible changes, and standards will be amended in ways that can break compatibility (for instance, the addition of getline() to the C library). What do you do then? Ask users to rewrite all the programs that they use every time such a thing happens?

      Never works in practice. If the prototype for a library function is the same, and the calling semantics is the same, then it can be relinked without recompilation whether it was statically (unless it was stripped) or dynamically linked, and if either

    8. Re:Why should I drop glibc? by Anonymous Coward · · Score: 0

      Virtually all binary software is distributed in enormous tarballs containing their own libc, and every other library they use, and a bunch they don't simply because static linking doesn't work against glibc properly (and violates the license for non-free software).

      Take Firefox for example, from Firefox.org, not the version shipped with your distro. Every Firefox tarball includes their own build of GTK, GDK, glibc, libnspr, etc. Because dynamic linking is so horribly broken on Linux that is the only way it could possibly work on more than one distro.

      This pretty much entirely invalidates your argument about bloat, and secruity fixes.

      SORRY.

    9. Re:Why should I drop glibc? by peppepz · · Score: 2

      Virtually all binary software is distributed in enormous tarballs containing their own libc, and every other library they use, and a bunch they don't simply because static linking doesn't work against glibc properly (and violates the license for non-free software).

      Please don't spread false information this way.

      Take Firefox for example, from Firefox.org, not the version shipped with your distro. Every Firefox tarball includes their own build of GTK, GDK, glibc, libnspr, etc.

      Yes, let's take the version from firefox.org that I'm using right now.

      $ ldd /opt/firefox/firefox-bin
      linux-gate.so.1 (0xb77bb000)
      libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb776b000)
      libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7765000)
      librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb775c000)
      libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7675000)
      libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb762f000)
      libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb7614000)
      libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb746a000)
      /lib/ld-linux.so.2 (0xb77bc000)

      See? It's using my libc, so what you said is completely incorrect. Shall we see if it uses its own GTK library as you've said? I'll past the ldd result here: http://pastebin.com/UsP0MHUe , so you can see for yourself that firefox uses the system libraries instead.

      Because dynamic linking is so horribly broken on Linux that is the only way it could possibly work on more than one distro.

      Dynamic linking on Linux is state-of-the-art. If it doesn't work for you, look for responsibilities somewhere else than the operating system. If anything, it's static linking which is badly supported (by glibc, not by Linux).

      SORRY.

      ...

    10. Re:Why should I drop glibc? by peppepz · · Score: 1

      Except statically linked binaries. Those were linked at build time, but they don't invoke the linker when they are executed. Guess what I use musl for? Building static binaries.

      But you're changing the goalpost now. What I said was troublesome was using musl (or anything else, if glibc-incompatible) as a replacement for glibc. Using it for selected static binaries that you build yourself is another thing.

      Nope. Binaries I only need one or the other, not both. Libraries only when I need a musl version of a library.

      That's because I was talking about replacing glibc with musl, and be able to run binaries, over which you have no control, written for any of the two libraries. Which is the only scenario that would makes final users happy, should glibc coexist with musl.

      No. Only for shit software that doesn't have any kind of protocol.

      Again, that's stuff that is out of our control. Engineers have to design their systems for the worst case, not for the best.

      Wrong. ISO C specifies stdint.h, int64_t is a standard way to get a 64-bit signed integer, and uint64_t is standard for 64-bit unsigned integers. The fact that you don't know ISO C is illuminating.

      Microsoft's stuff is compatible with ISO C90. uint64_t was unsigned __int64 in their world until very recently.

      Never works in practice. If the prototype for a library function is the same, and the calling semantics is the same, then it can be relinked without recompilation whether it was statically (unless it was stripped) or dynamically linked, and if either has changed, the code needs to be reviewed, rewritten and recompiled in either case.

      With versioned symbols (glibc) you haven't this problem. But if you add support for them in your library, then you add "bloat". So you have to decide whether you want to add "bloat", or to make your users unhappy.

      I don't know what adding getline has to do with existing programs. If they are not already making use of getline, then even if they are recompiled, they will still not make use of getline, and will not require it's symbol for linking. The Austin group (POSIX) are careful to not break stuff when revising standards, though I'm sure you can still point to some breakage; in general they tend to revise things by adding new symbols, or assuming the greatest common behavior between implementations.

      They added getline() to the standard, and doing so they broke all the software that, perfectly standard-compliant until then, used the getline() name for their own stuff. This is to say that imagining to resolve binary compatibility with standard compliance simply doesn't work. They're two different problems.

      Autotools gives me, as a user, and have done so since the 90s: - cross compiling support;

      Never works.

      I've bootstrapped my entire 64-bit Linux installation from a 32-bit host using it. It has almost always worked for me, even for packages whose developer hadn't ever thought about the possibility of cross-compilation. I have no doubt that packages using autotools were the ones that gave me fewer problems.

      However plain old Makefiles, I just set CC, CFLAGS, LD, LDFLAGS and LIBDIR and things just work (also CXX and CXFLAGS for C++).

      Only for the simplest cases. When things get more complex, you'll have to handle the difference between the host C compiler (which can be used to compile stuff which will run on the build host, such as code generators) and the target C compiler (which can only be used to produce binaries that won't run on the build host).

      - ability to change any installation path;

      I can do that with "PREFIX=/foo/bar make install" with any well written makefile.

      That's the difference, with autotools y

  21. Re:To infinity and beyond! by Anonymous Coward · · Score: 0

    But did you use Bitcoins and Apple when building it? Then it would be 2^256 times more newsworthy.

  22. Re:Either gnu libc is hideously slow and bloated.. by dalias · · Score: 4, Informative

    At the time the comparison was made, glibc was essentially unmaintained and Debian-based distributions were using the eglibc fork. Now that glibc is under new leadership, eglibc is being discontinued and the important changes have been merged back to glibc upstream. So when I update the chart's quantitative comparisons, it will be for glibc rather than eglibc. The main things that will change when I do are significant increases in size (especially since I seem to have under-measured eglibc's totals) and possibly some improvements in performance. In terms of all the other qualitative comparisons, glibc remains about the same place it was before.

  23. This is good by Anonymous Coward · · Score: 0

    I am glad to see an alternative to GNU's C library. I have run into a number of bugs with the GNU C library, or more specifically, incompatibilities which crop up between versions. Sometimes behaviour changes between one version of the library and another, causing end-user applications to stop working properly. If someone provides a more consistent library with similar performance, I would be happy to see it adopted.

  24. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    ... which I don't believe because the guys at gnu know a thing or 2 about compilers and libraries - or this library has cut some corners and/or missed out some functionality.

    NSA has not had a chance to sneak their stuff in yet?

  25. Re:buffer overflow in printf ... great for securit by dalias · · Score: 4, Insightful

    Unlike some projects, we fully disclose bugs that might be relevant to security. In this instance, the bug could only be triggered by explicitly requesting sufficiently many decimal places (16445 for ld80) and printing a denormal long double with the lowest bit set, as in:

    printf("%.16445Lf", 0x1p-16445);

    In addition, even when triggered, it only wrote past the end of the buffer by one slot, and we were unable to get it to overwrite anything important like a return address (of course, what it overwrites depends on the compiler, so in principle it could).

  26. Re:To infinity and beyond! by DrPBacon · · Score: 0

    Flagellum and all?

    --
    Spent All My Mod Points
  27. Re:To infinity and beyond! by DrPBacon · · Score: 0

    Oh. my. god. I didn't see the picture... http://en.wikipedia.org/wiki/F...

    --
    Spent All My Mod Points
  28. Re:Either gnu libc is hideously slow and bloated.. by jandrese · · Score: 1

    Debugging features: no no no yes

    WTF does this mean? I'm sure as hell not developing against a libc that doesn't have debugging hooks. This can't be what it means.

    --

    I read the internet for the articles.
  29. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    Yeah, the guys at gnu must know a lot, it's thanks to them that we have autoconf hell and myriads of projects trying to save us from it. Or why others started LLVM, or why others start a libc.

    Don't measure the knowledge of the gnu guys based on your own lack of it.

  30. Re: Brain damaged project by serviscope_minor · · Score: 1

    Musl is the only C library I'm aware of which allows the entire C library ecosystem (C library, math library, threading library, dynamic linker, and some others probably) to be upgraded atomically,

    GLIBC allows this. You can definitely bring in new versions of all of those.

    --
    SJW n. One who posts facts.
  31. Re:Either gnu libc is hideously slow and bloated.. by dalias · · Score: 3, Informative

    It doesn't mean you can't use gdb, just that libc itself does not try to double as a debugging tool. This is actually a security consideration. For example, glibc prints debugging information if it detects corruption in malloc. But if there's already memory corruption, you have to assume the whole program state is inconsistent; the corruption may be intentional due to the actions of an attacker, and various function pointers, etc. may have been overwritten. Continuing execution, even to print debug output, risks expanding the attacker's opportunity to take control of the program.

    FWIW, musl does detect heap corruption. The difference is that it immediately executes an instruction that will crash the program rather than trying to continue execution, make additional function calls that go though indirection (the PLT) and access complex data structures, etc.

  32. Re:Either gnu libc is hideously slow and bloated.. by FatdogHaiku · · Score: 1

    Don't measure the knowledge of the gnu guys based on your own lack of it.

    Why not? It's exactly how we operate our political... oh, wait...

    --
    You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
  33. Re:Brain damaged project by dam.capsule.org · · Score: 1

    As far as I know, the whole .a file gets linked in each time unless you use -fdata-sections when compiling and -Wl,--gc-sections when linking.

    --
    What sig ?
  34. Re: Brain damaged project by dalias · · Score: 1

    There is a way to upgrade glibc atomically, but it's a big hack, and even still it doesn't achieve the goal. The way it would work is to have /lib be a symlink to a versioned directory, and atomically replace (via rename()) the symlink with a symlink to the new directory. However, even if the replacement is made atomically, you still have the situation that the dynamic linker can load libc.so before the replacement is made and libpthread.so after it's made, resulting in mismatching versions.

  35. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    Thanks for the update. I used to hear about the drama around drepper, but I didn't understand what happened after he left.

  36. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    argument by status quo? surely you're not serious that
    since gnu has been at it a while it follows that they are good?

    what's this a remix of the old hungarian mathematics joke?

  37. Missing the only useful comparison. by Anonymous Coward · · Score: 1

    The compare page is missing the only other entry I wanted to see.... and that is, BSD libc. This is widely used by QNX (Blackberry) and probably all kinds of other vendors. I image Apple has their own fork.

    The others aren't comparable because they're copylefted, so cannot be used everywhere like musl and BSD libc can.

    1. Re:Missing the only useful comparison. by epyT-R · · Score: 1

      Well they can, but if the vendor distributes a modified version of glibc, they have to release the patches they made to it. I really don't see what the big deal is as there's no reason to hide secret bits in the libc. The proprietary magic is all in the custom programs running on top of it.

    2. Re:Missing the only useful comparison. by psmears · · Score: 1

      The compare page is missing the only other entry I wanted to see.... and that is, BSD libc. This is widely used by QNX

      No, QNX has its own libc - the microkernel architecture means the system call interactions work substantially differently from traditional Unix/Linux/etc.

  38. Re:Brain damaged project by Anonymous Coward · · Score: 0

    If that were true, there would be no difference in size in static linking regardless of how many functions you used from the .a file. It's the entire original .o file that gets linked in, normally. This is why musl is split up into many .c files which are compiled into many .o files.

  39. Re:Brain damaged project by porges · · Score: 2

    No. You're thinking of the fact that once the linker marks a .o as required, it brings in all of that .o file unless you provide those flags you mention. But the point is definitely that only the .o files that are needed get linked into the final object model. Just do a gcc of a simple "hello world" program and then look at the a.out's size; it won't be anywhere near as big as libc.a. Also, nm a.out will show you the relatively few symbols in the a.out file.

  40. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    Let me fix that for you:

    Steps to a typical Slashdot comment:
    1) Speculate on the features of something
    2) Note that that speculated feature set doesn't include something you want
    3) Criticise based on your speculation

  41. Re:Brain damaged project by Qzukk · · Score: 1

    The .a file is an archive of the individual .o files, only the individual .o files that are actually referenced get linked into the final executable. See also:

    ar t libc.a

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  42. Re:Brain damaged project by Anonymous Coward · · Score: 0

    You are brain damaged and are commenting without knowing anything about linkers.

  43. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  44. Re:Either gnu libc is hideously slow and bloated.. by Darinbob · · Score: 1

    Just look at typical GNU code though. It's well written but it's not small, and often not efficient. Much of this is due to accretion over time, however there also is a certain style that the programs follow. Thus the parodied GNU HelloWorld program. Glibc makes an implicit assumption that it is being used on a fast computer with lots of memory (ie, a PC or minicomputer). This is perfectly normal, however it leads to a different sort of optimization than you would find for embedded systems or small computers for example, thus the popularity of alternative standard C libraries or lots of roll-your-own.

    Yes some functionality may be missing, but is that necessarily required or standard functionality?

  45. Compared to Bionic by SDPost · · Score: 1

    I wonder how small Musl is in comparison to Bionic which is really, really small.

    1. Re:Compared to Bionic by dalias · · Score: 1

      I really want to add a Bionic comparison, but in order to be comparing apples with apples (or non-apples with non-apples, pardon the pun) we need an x86 build of Bionic, or need to re-do all the other libcs' figures for arm. I've been looking for a way to build Bionic outside of the Android build system and use it on non-Android systems, and the gentoobionic repository at https://github.com/gentoobioni... looked promising, but I couldn't get it to work. It also may be much larger than the official Bionic.

      If anyone is willing to help us figure out how to setup x86 Bionic for testing, please stop by the IRC channel (#musl on Freenode) or send a message to the mailing list.

    2. Re:Compared to Bionic by staalmannen · · Score: 1

      also klibc and newlib could be interesting. Newlib especially since it is used for its portability and to make experimental OSes, klibc for being extremely small and minimal

  46. As far as I know by Anonymous Coward · · Score: 0

    You don't know much.

  47. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    Some parts of glibc are definitely broken. For example, snprintf(3) does a ton of dynamic memory allocation, which means printing a formatted string to a static buffer could still fail with ENOMEM! That's because snprintf is a wrapper around fprintf() using a dynamic file object, among other niceties! Sane implementations like on OpenBSD are async-signal-safe for all the basic formatting specifiers.

    The problem with glibc is they do too much dynamic memory allocation in general. Several functions you would think should never fail on a sane implementation could fail. Then you have just plain stupid stuff, like NL_TEXT being INT_MAX, because apparently the GNU folks expect that some time in the future strerror_r() may return system error messages gigabytes in length. It's really because they took too literally the GNU Coding Style requirement of using dynamic memory as much as possible to avoid arbitrary limitations. But sometimes arbitrary limitations are really nice, making simpler code which is more secure. Imagine dealing with DNS names of arbitrary length!

    It's ridiculous. When you're boxed into a corner because of various _other_ failures (I/O, authentication failure, w'ever), the last thing you want to worry about in your failure path is having to deal with crap like OOM conditions.

  48. Re:Either gnu libc is hideously slow and bloated.. by dalias · · Score: 1

    Someone with mod points, please mod up the parent post. Even if you disagree with it, it's informative about one of the big issues in glibc that musl does differently: musl's snprintf and dprintf, for example, are async-signal-safe. Roland McGrath, who holds claim to being the "inventor" of dprintf and author of the original implementation in glibc, has stated that he intended for the function to be async-signal-safe or at least close to it, and that later introduction of dynamic allocation is a bug (which I later filed as #16060) that glibc should fix.

  49. Re:Brain damaged project by Anonymous Coward · · Score: 0

    good lord. it has *never* been this way. even in the 70s.

  50. Re:Won't be any true open source left soon by epyT-R · · Score: 1

    I'm not sure why this was voted down, but there is a point here. If the future of OSS belongs to licenses that don't protect the continued openness of source, OSS authors are effectively working for free and competing with those who take their code and wrap it up in proprietary licenses.

    It's ok to charge cash for binaries and/or source. So why is it so terrible to 'charge' source for source?

  51. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    No, glibc is just garbage, like so much other Gnu code. And no, I disagree with your unwarranted assertion that Gnu code is typically well written. Counter examples galore: Gnu Emacs, Autoconf, Automake, guile, GCC.

    It's just Gnu has fame from blowing the Free Software horn so hard and for so long, that people naturally and incorrectly assume that they must be technically competent.

  52. Re:Won't be any true open source left soon by Anonymous Coward · · Score: 0

    I wouldn't work for one of these projects and be exploited like this. If Apple wants to use part of the toolchain that makes them billions, they can pay for it.

    Well I would, and have. I build embedded Linux systems, and the code I write for a living isn't usually open source. I have contributed back patches to musl and a bunch of other MIT/BSD licensed projects, because I use them in my work.

    What being GPL/LGPL really means is that I'm less likely, as a proprietary software developer, to use (and therefore to contribute to) software when it's license makes including it in my work more difficult/impossible. The end result is that I can earn a living and contribute to free software if it is BSD/MIT license, but I cannot if it is GPL.

    My paymaster is not going to just turn around and say to me, well that's GPL, so I guess we'll just release all our software as GPL too.

    The most only time I use GPL software at work, is either where the license allows, like running on Linux, and distributing the source for the kernel but keeping our secret sauce secret; or parallel invention, where I build something using a GPL library as a prototype, and then I or someone else has to go and reinvent the GPL parts we used as a prototype. For an actual example, I often use FFTW as a prototype in signal processing applications, but then we yank that bit out and use IPP because it's cheaper than a commercial FFTW license. I'm looking at using FFTS, which is MIT licensed and supposedly faster than FFTW and IPP, but I'm currently banging my head against their wack autoconf build system, and it also appears to not support x86 (it supports x86_64, but the docs wrongly suggest x86).

  53. Re:buffer overflow in printf ... great for securit by strikethree · · Score: 1

    Unlike some projects, we fully disclose bugs that might be relevant to security.

    Thank you. As a security guy, knowing that the disinfectant of sunlight is illuminating your project, I am willing to spend more time examining and using your project. I hope your project becomes the default libc everywhere.

    --
    "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
  54. Re:Won't be any true open source left soon by Anonymous Coward · · Score: 1

    Thats not true.

    Nearly every time I used a BSD licensed program for some project that left my computer I contributed bugfixes and sometimes features back (if I added features, often just used unmodified).

    The alternative with GPL (in the embedded world at least) is that most companies say f*ck off and license some proprietary system. The value of the source to some product (unless it's some disposable thing such as a home router) is much much higher than the cost of licensing some components. The community then gets nothing.

    For a libc that is LGPL there is not really an issue, but getting a license vetted by legal can in some companies also be a very large cost, often als much higher than buying something from a company they already verified. A big (technical) advantage of musl is that it properly supports static linking. This allows making binaries that work almost anywhere.

    BTW: Some marketting people for proprietary embedded solutions (cannot say which products) refer to Stallman as a way to spread FUD for open source. Some management people seems to get really scared of him.

  55. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    But if there's already memory corruption, you have to assume the whole program state is inconsistent; the corruption may be intentional due to the actions of an attacker, and various function pointers, etc. may have been overwritten. Continuing execution, even to print debug output, risks expanding the attacker's opportunity to take control of the program.

    I'm sorry, this sounds like a poor rationalization for lack of useful functionality. By this logic, you should crash the program without warning whenever invalid input is detected - it could be an attack since no program should ever provide invalid input to a function. In real life, programs have tons of bugs and diagnostic messages are hugely useful in identifying and then fixing them. Especially since the vast majority of programs are not used in a context where an attack can occur.

    A 'paranoid' mode with this behavior may make sense for some people. Most people, especially those in the process of developing the software, would prefer diagnostics when things go wrong.

  56. Re:Either gnu libc is hideously slow and bloated.. by uhmmmm · · Score: 1

    I'm sorry, this sounds like a poor rationalization for lack of useful functionality. By this logic, you should crash the program without warning whenever invalid input is detected - it could be an attack since no program should ever provide invalid input to a function. In real life, programs have tons of bugs and diagnostic messages are hugely useful in identifying and then fixing them. Especially since the vast majority of programs are not used in a context where an attack can occur.

    A 'paranoid' mode with this behavior may make sense for some people. Most people, especially those in the process of developing the software, would prefer diagnostics when things go wrong.

    I disagree. There is a big difference between invalid input to a function (eg trying to convert "abc" to an integer) and a memory corruption bug. In the former case, you can return an error to the caller, and if they were written with enough attention to detail, they can fix the problem and move on, or ask the user for actually valid input, or whatever followup action may be appropriate.

    In the case of a memory corruption bug, there is no way to correct the problem and move on. By the time you detect the problem, you're already hosed. You can't even rely on the fact that the program accurately knows what it was in the middle of trying to do. I think crashing is absolutely appropriate here. And if you want to debug it, then attach a debugging to the program or the resulting core dump -- all the same information you would have gotten from printed diagnostics can be found (albeit with more effort). But trying to diagnose a memory corruption bug after the fact like this is the hard way to do it anyway. You really want to catch the corruption as it happens, and the are much better tools for this (valgrind, etc).

  57. Re:Either gnu libc is hideously slow and bloated.. by dalias · · Score: 1

    Perhaps you should read this: https://twitter.com/solardiz/s...

  58. Re:Either gnu libc is hideously slow and bloated.. by Anonymous Coward · · Score: 0

    What is wrong with old code?

    It is well-tested.

  59. Re:Brain damaged project by Anonymous Coward · · Score: 0

    Even if you were correct, and you are not, you could just take the source code that you need from musl.

    But you are wrong, and very brain-damaged.

  60. Re:Won't be any true open source left soon by Anonymous Coward · · Score: 0

    To be fair Apple contributes a lot to OSS.

    Printing support wouldn't be first-rate in Linux if not for Apple.