|
|
Log in / Subscribe / Register

A GNU C library update

By Jonathan Corbet
April 2, 2014

Collaboration Summit
The GNU C library (glibc) is a fundamental component of many Linux systems. But, for many, the project sits under the radar, attracting relatively little attention. At the 2014 Linux Foundation Collaboration Summit, glibc maintainer Roland McGrath, accompanied by Carlos O'Donell via a remote voice link, updated the audience on what the project has been up to and where things are going.

Glibc 2.18

The glibc 2.18 release came out in August 2013; David Miller served as the release manager. Some 66 developers contributed to this release, fixing 132 user-visible bugs and three security-related problems with CVE numbers.

This release included a number of new features. There is now priority-inheritance-aware mutex support for condition variables on non-x86 architectures. A new POSIX threads API allows programs to set attributes for all new threads; it can, for example, be used to decrease the default stack size in applications that create large numbers of threads or to allow changing attributes of threads created in libraries. The pt_chown helper program was removed by default in response to CVE-2013-2207; it had so many problems that the developers concluded that [Roland McGrath] they should just get rid of it instead of trying to make it secure. The clock() function now uses clock_gettime(), giving it better precision.

Since it was 2013, Roland said, it was naturally time for 2011 standards to come into effect. So the glibc developers added support for C++11 thread_local destructors in 2.18. There is now support for version 3 of the tzdata file format — something which should become useful sometime around 2038. The worst-case performance of a number of math library functions has been improved.

This release also included a new microbenchmark framework, though testing and benchmarking are still far from where the project would like them to be. The glibc project gets a number of performance-related patches, but it has no real way to judge them to see if they work as advertised and are worth the complexity they might add. The microbenchmark framework will eventually give them an objective way to evaluate these patches. If anybody wants to work with glibc, he said, help in this area would be much appreciated.

Also in 2.18 is a new macro in <math.h> called issignaling(); it can be used to check for sNaN (signaling NaN) behavior as described in ts18661. Support for lock elision using Intel's TSX transactional memory extensions was added, though only part of that patch set went in; see this article for details. Lock elision is still not enabled by default; Roland was unsure whether any distributors were turning it on or not. There is also support for the Power8 architecture and the Xilinx Microblaze processor. The ARM architecture got optimized string routines, and the math library was optimized for the SPARC architecture.

Glibc 2.19

The 2.19 release, under the management of Allan McRae, came out in February 2014. It had contributions from 78 developers and fixed 180 user-visible bugs, six of which were security issues. One of the headline features in this release was much-improved documentation of the thread- and signal-safety properties for each function. The feature test macro system saw the beginning of a long-term cleanup; it was noted that the release notes for the upcoming 2.20 release include a table to guide developers in working with this transition.

2.19 adds support for a number of new locales. There is also better support for binary locale data files; the localdef utility can now cross-compile files for other architectures and (in particular) endianness. A number of new SystemTap probes have been added to malloc() and the math library. 64-bit, little-endian PowerPC support was added as well.

Looking forward

The 2.20 release is to be expected sometime around July or so; it has 28 user-visible bugs fixed so far. In this release, the long-unmaintained am33 port will be removed. There will be improvements to the test suite, including the addition of useful XPASS/XFAIL annotations. The math library will have complete testing for all rounding modes in this release.

The feature test macro transition will continue in 2.20. The _BSD_SOURCE and _SVID_SOURCE macros will be deprecated; developers should use _DEFAULT_SOURCE instead. Keith Packard, from the audience, noted that he was able to remove _BSD_SOURCE from the X library builds with no ill effect. The glibc developers are working toward a goal of having zero build warnings across the library source. The getaddrinfo() function, which has a long history of bugs, is seeing an extensive cleanup at last.

One change that may or may not make it into 2.20 is signal-safe thread-local storage. The current thread-local storage implementation was designed around minimal memory use; to get there, it uses a lazy allocation mechanism that does not actually allocate a thread-local variable until a thread uses that variable. This approach is indeed memory-efficient, but the cost is that allocation must be done while taking locks and doing other things that are not supposed to be done in signal handlers. So signal handlers cannot safely use thread-local storage.

A new implementation almost made it into 2.19, but, in the end, the potential for problems was judged to be too high. So now the plan is to simply preallocate thread-local variables; the lazy allocation mechanism does not really seem to be necessary in most situations. There is agreement on this approach, but nobody has stepped up to actually do the work. Unless that happens in the very near future, this work will not be ready in time for the 2.20 release.

Also possibly coming for 2.20 is the removal of the "ports" directory, which no longer serves its purpose. There are a couple of Google Summer of Code projects in the works; one of those is concerned with better testing for the math library, while the other is focused on an ISO C11 threads implementation. ISO threading is different from POSIX threads, of course; it is hoped that the student working on this project can come up with a useful prototype implementation that can eventually be evolved into something that can be merged into the library.

As Roland ran out of time, he appealed to the audience for help. There is a long list of things needing work. In addition, the developers could use help with bug triage, and, unsurprisingly, documentation. The GNU C Library project has changed a lot in the last few years, and is far more open to changes than it once was. If enough developers respond to that openness, perhaps that "todo" list might just begin to shrink.

[ Your editor would like to thank the Linux Foundation for sponsoring his travel to the Collaboration Summit. ]

Index entries for this article
ConferenceCollaboration Summit/2014


to post comments

A GNU C library update

Posted Apr 3, 2014 16:26 UTC (Thu) by smoogen (subscriber, #97) [Link] (6 responses)

Hi... which David Miller served as the release manager? Was it one of the kernel devs? Have they finally figured out how they git clone them ?

A GNU C library update

Posted Apr 3, 2014 16:29 UTC (Thu) by smoogen (subscriber, #97) [Link] (4 responses)

Also, who is the photo of? [Yes I have failed my basic who's who in FLOSS these days.]

A GNU C library update

Posted Apr 3, 2014 16:32 UTC (Thu) by smoogen (subscriber, #97) [Link] (3 responses)

And I failed basic reading comprehension... must need more coffee. The photo must be of Roland McGrath. Off to get some coffee.

A GNU C library update

Posted Apr 3, 2014 19:33 UTC (Thu) by khim (subscriber, #9252) [Link] (2 responses)

If you'll click on said photo you'll get to the page titled “Roland McGrath at the 2014 Collaboration Summit” which kind of answers your question, LOL.

A GNU C library update

Posted Apr 3, 2014 23:22 UTC (Thu) by corbet (editor, #1) [Link] (1 responses)

Yeah but, in truth, people would like to know who is in the picture without having to click through on it, and that seems like a reasonable request to me. I bet we can add a hover text if nothing else.

A GNU C library update

Posted Apr 8, 2014 18:18 UTC (Tue) by knobunc (guest, #4678) [Link]

You already (politely) set the alt text on the image. However firefox uses the title text for hover. So either set both when generating, or write some javascript to add title to any img with alt set, but no title. (A little harder because you aren't including any libraries other than the google tracker)

A GNU C library update

Posted Apr 7, 2014 2:05 UTC (Mon) by siddhesh (guest, #64914) [Link]

Yes, David Miller the kernel hacker.

A GNU C library update

Posted Apr 4, 2014 11:20 UTC (Fri) by mgedmin (guest, #34497) [Link] (1 responses)

Did glibc get an strlcpy() yet?

A GNU C library update

Posted Apr 4, 2014 15:52 UTC (Fri) by rahulsundaram (subscriber, #21946) [Link]


Copyright © 2014, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds