Search Results: "ema"

1 December 2010

Josselin Mouette: Getting user switching to not suck

We ve come a long way since the times when you needed to configure 2 X servers in XDM just to be able to use 2 X sessions at once. However there was still some way to go until recently. A number of bugs that could be wrongly attributed to bugs in the X server or in the desktop environment were actually caused by the display manager doing crap. GDM up to 2.20 Since the introduction of the flexible X servers feature, GDM hadn t evolved much on the matter of user switching. What it used to do was pretty straightforward: It is interesting to note that VT (console) switching is purely handled by the X server. When starting, the new server switches the current VT to where it is. When exiting, it automatically switches back to the VT from which it was launched. While very simple, this idea fails to work correctly every time you try to do something more complicated than starting a temporary session for a guest and exiting it. For example, if you start two of them, there is a chance that, when the X server switches back to the console it was run from, there is nothing left running in this console, leaving you with the funny Control-Alt-Fn shortcuts to find your way back to a X server. You will also meet interesting race conditions when trying to switch back to an existing session from the login window. GDM 2.28 and above In the process of rewriting the code entirely, the GDM developers tried to address a number of those shortcomings, making use of D-Bus and ConsoleKit. The new design is slightly more complicated, however. Not killing the X server in some cases partly addresses the problems caused by letting it switch back to the original VT when exiting. However in several ways the cure is worse than the disease. Getting it to work The modular architecture of GDM makes it possible to improve the situation. (Possible but not easy because of the millefeuille of classes.) However, it is merely a band-aid unless you fix the root issue: the X server knowing better than you which VT it should switch to when exiting. Fortunately Xorg now features an option to avoid that behavior: -novtswitch. So the first step is to enable it, and let the GDM daemon (or slave) handle VT switching through ConsoleKit. With that, the following changes are possible. The result With all these changes the behavior of the display manager is finally completely consistent. Interestingly enough, this is very similar to what user switching looks like on Vista or MacOS X. So what now? These changes are stabilized for Debian squeeze, but of course it has been long overdue to get them accepted upstream, along with the very large number of Debian-specific changes that still lie in our packages.

30 November 2010

Sergio Talens-Oliag: The FreakyWall (Part 3: Packages)

In this post I'll describe the changes made to the kernel and some of the Squeeze packages for the Freaky Wall. The plan is to submit whishlist bugs to the BTS on the hope of having all what is needed for this project available on Debian after the Squeeze release, as my feeling is that a freeze is not the right time to push this changes... ;) I'm giving access here to all the changes made to the source packages, but if anyone wants the binary packages (amd64 only) send me an email and I'll give you the URL of an apt repository that contains all the modified packages (it's the one at work, that contains other modified packages) or, if there is interest, I can put them on people.debian.org. Kernel To be able to build the firewall we need a kFreeBSD kernel with some options not compiled on the version distributed with Debian. To compile the kernel I've followed the procedure described on the following debian-bsd mailing list post: http://lists.debian.org/debian-bsd/2010/09/msg00023.html Basically I've done the following:
    apt-get build-dep kfreebsd-8
    apt-get source kfreebsd-8
    cd kfreebsd-8-8.1
    cat >> debian/arch/amd64/amd64.config << EOF
    # Add pflog, pfsync, ALTQ and CARP support
    # ----------------------------------------
    # http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-pf.html
    device      pf
    device      pflog
    device      pfsync
    options         ALTQ
    options         ALTQ_CBQ        # Class Bases Queuing (CBQ)
    options         ALTQ_RED        # Random Early Detection (RED)
    options         ALTQ_RIO        # RED In/Out
    options         ALTQ_HFSC       # Hierarchical Packet Scheduler (HFSC)
    options         ALTQ_PRIQ       # Priority Queuing (PRIQ)
    options         ALTQ_NOPCC      # Required for SMP build
    # http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/carp.html
    device      carp
    EOF
    vi debian/changelog 
    dpkg-buildpackage -B -uc
Once the package was built I installed the new kernel package and rebooted the machine. Utilities To be able to use some utilities related to pf I have built patched versions of three packages: On the next post I'll describe how I've configured the system, the network interfaces and the different utilities patched and compiled on this post.

29 November 2010

Axel Beckert: Useful but Unknown Unix Tools: colored cal(endar)

Another thing I regard as useful on the commandline are colors. (Others commonly refer to my color preferences as eye cancer, but that s not relevant here. ;-) Colors help to easily distinguish between relevant and non-relevant things or to separate different things. One colored command line program I use nearly everyday is the colored fork of bsdmainutils s well know (or at least better known) cal program whose output looks like this:
$ cal
    November 2010    
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
$ 
Since the colored fork calls itself still cal (as the Debian source package is called), to avoid conflicts with bsdmainutils s cal, the binary package and the binary itself are called ccal (short for colored cal) and its output looks like this:
$ ccal
    November 2010     
 Mo Tu We Th Fr Sa Su 
  1  2  3  4  5  6  7 
  8  9 10 11 12 13 14 
 15 16 17 18 19 20 21 
 22 23 24 25 26 27 28 
 29<30>               
                      
$ 
ccal also use the locale definitions (LC_TIME), if available, that s why the one screenshot is Sun-Sat and the other one is Mon-Sun. According to the man page, ccal has some more improvements over the classic cal: If displaying the single-month format, ccal will look for a date file (the default file or whatever you specify with the -d option). If found, ccal will read the file, looking for special date descriptions for that month which will be displayed to the right of the calendar. By default, up to 24 appointments (number may be changed with -m) may be displayed per month. If the current date happens to fall on one of these special dates, it will be flagged by an asterisk. If there is room, appointments for the next month may also be displayed (next month s dates having definitions like 2nd Thursday will be skipped). But I must admit, I don t use that feature. I just use it as on-demand calendar sheet. The colored screenshot above is btw. generated with Adam Borowski s ansi2html which popped up after I published my Intent to package aha (for Ansi HTML Adapter), the first ANSI colors to HTML converter I found on the net. (And yes I searched for it because of this and some yet to come blog postings. No spoilers here though. ;-) While capturing colored output of ls and some other tools was easy, it needed a little hack to capture ccal s output, because if you pipe ccal output to anything, it drops its colors. Always. The solution was to run it in GNU Screen, log the output and then pipe the log file through aha or ansi2html :
$ screen -c /dev/null -L ccal; cat screenlog.0   ansi2html > ccal.html
Probably the output of every program which drops colors when writing to a pipe instead of a terminal can be fetched that way. Update, 2:04 CET: As Adam Borowski points out in message 62 of #605380, script is the better tool for making tools believe they talk to a terminal:
$ script -q /dev/null -c "ccal"   ansi2html
Catching the output of a whole year s calender ( ccal 2011 ) failed with GNU screen though, as it was truncated on the 24th of September by GNU screen (as it was already truncated in the screenlog.0), so no screenshot of that for the moment. And with script, I d get the whole output, but would have to manually fix the styles so they don t get posted literally to Planet Debian. So look for yourself how the output of ccal 2011 looks like by installing ccal. ;-)

Theodore Ts'o: Google has a problem retaining great engineers? Bullcrap.

Once again, there s been another story about how Google is having trouble retaining talent. Despite all Eric Schmidt s attempts to tell folks that Google s regretted attrition rate has not changed in seven years, this story just doesn t want to seem to die. (And those stories about Google paying $3.5 million and $7 million to keep an engineer from defecting to Facebook? As far as I know, total bull. I bet it s something made up by some Facebook recruiter who needed to explain how she let a live prospect get away. :-) At least for me, the complete opposite is true. There are very few companies where I can do the work that I want to do, and Google is one of them. A startup is totally the wrong place for me. Why? Because if you talk to any venture capitalist, a startup has one and only one reason to exist: to prove that it has a scalable, viable business model. Take diapers.com for example. As Business Week described, while they were proving that they had a business model that worked, they purchased their diapers at the local BJ s and shipped them via Fedex. Another startup, Chegg, proved its business model by using Amazon.com to drop ship text books to their first customers. (The venture capitalist Mark Maples talked about this in a brilliant talk at the Founders Showcase; the Chegg example starts around 20:50 minutes in, but I d recommend listening to the whole thing, since it s such a great talk.) You don t negotiate volume discounts with textbook publishers, or build huge warehouses to hold all of the diapers that you re going to buy until you prove that you have a business model that works. Similarly, you don t work on great technology at a startup. Startups, by and large, aren t about technology at least, not the Web 2.0 startups like Facebook, Foursquare, Twitter, Groupon, etc. They are about business model discovery. So if you are fundamentally a technologist at heart, whose heart sings when you re making a better file system, or fixing a kernel bug, you re not going to be happy at a startup. At least, not if the startup is run competently. If you have the heart of an entrepreneur, and you are willing to roll the dice (since 9 out of 10 startups go belly up; those are the ones that failed to find a viable business model), then sure, go for a startup. And understand that your job will be to make something that works well at a small scale, quick, dirty, and cheap. If that means using some proprietary software, then that s what you should do. Hopefully you ll get lucky and win the IPO lottery. But if your primary interest is to doing great engineering work, then you want go to company that has a proven business model. Google has enough scale that I can sleep well knowing that improvements I am making to Linux and the ext4 file system are saving enough money for the company that Google is making a profit on me. That is, the value Google is getting out of my work is worth many multiples of my total compensation. And that s a position that every engineer should strive for, since that s how you can be confident that you will remain gainfully employed. The fact that I can do what I love, and go to conferences, and all of my work is open source that s just total icing on the cake. :-) No related posts.

Rapha&#235;l Hertzog: How to find the right Debian packages: high-level search interface

The Debian archive is known to be one of the largest software collections available in the free software world. With more than 16,000 source packages and 30,000 binary packages, users sometimes have trouble finding packages that are relevant to them. Debian developer Enrico Zini has been working on infrastructure to solve this problem. During the recent mini-debconf Paris, Enrico gave a talk presenting what he has been working on in the last few years, which hasn t gotten yet the attention it deserves . Enrico is known in the Debian community for the introduction of debtags, a system used to classify all packages using facets. Each facet describes a specific kind of property: type of user-interface, programming language it s written in, type of document manipulated, purpose of the software, etc. His most recent work builds on that. It is available in Debian and Ubuntu in the apt-xapian-index package. Its purpose is to allow advanced queries over the database of available packages. Users of apt-xapian-index He started by presenting some early users of the infrastructure. The most widely know is Ubuntu s software center. Its search feature provides results almost instantly thanks to apt-xapian-index. But it is a very simple interface that doesn t exploit many of the advanced features provided by the apt-xapian-index. Another early adopter, making use of some more advanced features, is GoPlay!. It s a graphical user interface to find games. It makes use of debtags to classify games so that you can browse, for example, all 3D action/arcade games related to cars. GoPlay has even been extended to be a more generic debtags based package browser and the package now also provides GoLearn!, GoAdmin!, GoNet!, GoOffice!, GoSafe!, and GoWeb!. Fuss-launcher is an application launcher and not a package browser, but by using apt-xapian-index, it s able to reuse information provided at the package level to make it easier to find installed applications. Package descriptions tend to be more verbose than those embedded in .desktop files. Enrico also showed another nice feature to the audience: if you drag a document onto its window, it will show you a list of applications that can open it. Last but not least, apt-xapian-index provides a command line search tool that is vastly superior to the traditional apt-cache search: it s axi-cache search (axi stands for apt-xapian-index). Enrico compared the output of a search on the letter r . While apt-cache spits out an infinite list of packages containing this letter somewhere in the description, axi-cache only listed packages related to GNU R. He also demonstrated the contextual tab completion. It makes it easy to use debtags and to refine your search. Once you have typed a first keyword, the tab-completion for the second one only contains keywords or debtags that are actually able to provide more restrictive results. Advanced queries with logical operations (AND, OR, NOT, XOR) are also supported. Features of the backend Enrico then dived into the internals. Xapian s search engine is at the root of this infrastructure. He likes it because it s a simple library (i.e. no daemon) and it has nice Python bindings. While apt-xapian-index s core work is to index the descriptions of all the packages, it actually stores much more and can be easily extended with plugins (written in Python). For instance, the information stored encompasses: He already has plans to store more: adding popularity contest data (see wishlist bugs #602180 and #602182) will make it possible to sort query results in a useful way. The most widely used applications are good choices when it comes to community support, and they are likely of better quality due to the larger user base. Adding timestamps of the last installation/upgrade/removal, will make it easier to pin-point a regression to a specific package update. The generated index is world-readable and can be used from any application provided it can use the Xapian library which is written in C++ but has bindings for Perl, Python, PHP, Java, Tcl, C#, and Ruby. Call for experimentation Enrico believes that many useful applications have yet to be invented on top of apt-xapian-index s features. He s calling for experimentation and asking for new ideas. The only practical limit that he has encountered is the size of the index: currently it varies between 50 Mb (Debian unstable without translation) and 70 Mb (Debian stable/testing/unstable with one translation). He would like it to not grow over 100 Mb since it s installed by default (due to aptitude recommending it) and he s not comfortable with the idea of using more than 20% of the disk footprint of a basic install just for this service. That s why the index was configured to not store the position of the terms: it s thus not possible to find out packages whose description contains the word statistical immediately followed by the word computing . You can however find those which have both terms somewhere in their description. Enrico wondered if apt-xapian-index offers too much freedom. That could explain why few people experimented with it despite his numerous blog posts with code samples and information on how to get started using it. But it s not difficult to imagine use cases for this data. It could be used to extend tools like rc-alert or wnpp-alert, for example. They provide a long list of Debian packages that are looking for some help and are installed on the machine. With apt-xapian-index, it would be possible to restrict the results to the set of packages written in a specific programming language or for a particular desktop environment. The more likely explanation is that too few people know about the tool. There are many more itches to scratch where apt-xapian-index s features could be very useful, and my guess is that Enrico s wishes will eventually come true.
This article was first published in Linux Weekly News. Click here to subscribe to my newsletter and keep up with the Debian/Ubuntu news thanks to my monthly digest.

No comment Liked this article? Click here. My blog is Flattr-enabled.

Keith Packard: Altos0.8

AltOS 0.8 New Software and Firmware for Altus Metrum Devices Bdale and I are pleased to announce the release of AltOS version 0.8. AltOS is the core of the software for all of the Altus Metrum products. It consists of cc1111-based microcontroller firmware and Java-based ground station software. AltosUI New Features in the AltusMetrum Ground Station AltOS version 0.8 contains significant upgrades to the ground station software, AltosUI: Continuing Features AltOS version 0.8 continues to provide the following features: AltOS Firmware Update AltOS version 0.8 contains a minor firmware update for TeleMetrum to resolve an issue with main deployment. A mis-feature in the igniter firing code would delay main deployment by 2 seconds in some cases. Thanks to our contributors! We had a lot of help with this release: Future Plans A number of features are implemented or in process in the sources available in our publicly visible repository that are not part of the current stable release. There are any number of additions that could be made to this list; feel free to send along ideas that you ve got. Of course, all of this software is licensed under the GNU General Public License, so you can get the source and hack on it in the comfort of your own home.

28 November 2010

Biella Coleman: The Existential Philsophy of Procrastination

out of cous The New Yorker has a very nice piece about the follies and foibles of procrastination. I really identified with it, especially the ruminations of multiple/divided selves (I do feel more like Biella s instead of Biella especially during moments of extreme procrastination). The heart of the piece has to do with the existential face of procrastination, which the author nails with this quote by Mark Kingwell:
Procrastination most often arises from a sense that there is too much to do, and hence no single aspect of the to-do worth doing. . . . Underneath this rather antic form of action-as-inaction is the much more unsettling question whether anything is worth doing at all
This reminds me of another one of my favorite (and kinda distributing but also kinda liberating) quotes by Henry Miller:
Life has to be given a meaning because of the obvious fact that it has no meaning
Finally, the most humorous bit in the article had to do with Victor Hugo, who apparently, to stave off distraction, would write in the nude and then make what sounds like his man servant hide his clothes so he could not go outside. Reminds me that prior to the Internet, there were certainly other ways to squander time. For now, I encourage some procrastination: read it and you might get some insight as to this habit, which seems to afflict so many.

Martin Meredith: New VPS & Shameless Plug

Due to the fact that my previous VPS was well out of date (Ubuntu Intrepid!!!) I m currently in the process of moving everything to a new server. I ve had lots of fun re-setting up my email and it s now very shiny and easy for me to use :) (I ll be writing a tutorial at some point in the near future) Other than that I d like to give a quick shameless plug to my VPS provider, Bitfolk. They re awesome, and have a great policy for Migrating to a new VPS. flattr this!

26 November 2010

Iustin Pop: No gaming: one week left

Today there's one week left on my self-imposed no-gaming exercise . I like to make this kind of exercise for various things (not eating $foo for this amount of time, not doing $bar, etc.), so by itself the exercise was not a special event. But computer gaming is one of my favourite activities, so it was rather interesting. There were to goals to this: gaming is addictive (can I stop playing for three entire months?) and gaming eats time (how much time do I gain?). Last time I tried such an exercise (for a month), it ended early by me accidentally playing, of all things, nethack: someone told me at work hey, you know we have a nethack server? and before I realised what I was doing I was already playing nethack for half an hour. In an xterm. With no graphics, no sound, but with coloured ASCII chars. In truth, I started the new attempt rather accidentally. I travelled a lot this summer, and so I was already a month without playing games. Realising this, I said to myself: I already didn't play for a month, and it goes fine, let's see if I can make it a three months official no-gaming exercise. So, my Windows partition went away, my save games were put aside, my few Android games were uninstalled, and I was ready. How did it go? Very interesting. After two weeks, I was having lots of free time. Long-delayed tasks were finally taken care of, unread books were getting attention, and in general I had time on my hands. A month into the exercise, somehow my free time was creeping away. I took on some new (periodic) tasks, I was reading more, and by one and a half months I was back to zero on free time advantage. Lesson 1: people expand their schedule until it eats all their free time. After about two months, I was still doing fine, but I had a few times the classical addiction dreams: you dream you visit someone, and they're playing a new game, and ask you Don't you want to play? , or someone tells you about a nethack server, and without realising, you ruined your exercise. I had this kind of dreams while giving up other things, so it was definitely a withdrawal symptom. Lesson 2: you might have given something up, but your brain didn't (yet). With three weeks left, I said: it's time for me to start building a new gaming machine, so that when I'm done with the exercise, I can start playing right away. And this is where the problems started. For until then, I was not thinking about games at all. But once you install your new Win7, the graphics drivers, you start to wonder what new games were launched, what new expansions were released, and suddenly you realise you skipped many games, and how can you not play them? A week later, my Steam and GOG wish lists have increased greatly, and another week later I was already with many newly-bought games. Lesson 3: giving up computer games for a just few months is only partially a time saver: while the backlog of non-played games doesn't contain all games that you skipped, it's still a significant backlog. Such an exercise is rather more useful to shift free time around, than an absolute time saver. At this point, I was talking with colleagues about all the new games, the expected launches during the holiday season, etc. like I didn't stop playing games. The funny part was that in the second half of November, Slashdot had not one but two articles about people not being so much interested in games anymore. Believe me, if you cannot play games for a period while your friends very much talk about how awesome hot new game X is after a while you won't have this lack of interest problem anymore (of course, I'm extrapolating from my experience, etc. etc.). On top of that, on Planet Debian was another blog post about what game to play . All these were like a general reminder about playing games :) This moment (two weeks left) was also the hardest moment, with the sweetest temptations: machine installed, games installed, all set, just need to press New game. Lesson 4: abstaining from a thing is much harder if said thing is readily available, or in your face . Quite obvious in hindsight So here I am, with just one week left. It was an interesting thing to do, and it was definitely worth the effort, if not for time gained but for learning about oneself. Only one question remains: next week, which game shall I play first? ;-)

Axel Beckert: Useful but Unknown Unix Tools: awsetbg

Have you ever wondered which tool you should use to set the background of your X11 desktop? There are tons of it and every single one does need different command line options. And if you picked one, you could be sure, you ll once come to a machine or operating system, where that one isn t available. When I started to play around with the tiling window manager awesome, I also noticed that the awesome Debian package contains awesome s own desktop background image setting tool named awsetbg . Yet another one! I thought. But I was wrong: Today I noticed the word wrapper in awsetbg s man page. I became curious and had a peek into its source code. And indeed, it s an awesome desktop background image setting POSIX bourne shell compatible shell-script: It knows about not less than 15 other desktop background image setting tools and can be used as frontend wrapper for those who don t want to remember each tool s command line syntax: Needless to say that most of them are also available in Debian. :-) You may wonder what s useful with it. Well, it does something you no more need to do yourself or in one of your own scripts: Checking which desktop background image setting tools are available on the machine you re currently working and using the appropriate command line options for tiling, fullscreen, whatever. Only drawback I found so far: In Debian, you need the awesome window manager package to be installed, if you want to get the script via APT. But on the other hand, it s just a shell script. You can easily put it into your $HOME/bin or so. :-)

Alexander Reichle-Schmehl: Release Critical Bug report for Week 47

The bug webinterface of the Universal Debian Database currently knows about the following release critical bugs:
In Total:713
Affecting Squeeze:283
Squeeze only:74
Remaining to be fixed in Squeeze:209
Of these 209 bugs, the following tags are set:
Pending in Squeeze:18
Patched in Squeeze:50
Duplicates in Squeeze:18
Can be fixed in a security Update:16
Contrib or non-free in Squeeze:6
Otherwise fixed in Squeeze:26
Ignoring all the above (multiple tags possible), 127 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 170 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

25 November 2010

Russell Coker: Victorian State Election

Election TomorrowOn Saturday we will have a Victorian state election. As usual for state elections most people will vote on issues related to the federal government, the mainstream media has little coverage of state politics and people seem to vote on what they see on TV. Presumably that means we have a good chance of having a similar situation to the last Federal Election where the Labor and Liberal parties each won 72 seats in the lower house and Labor formed a coalition with the Greens MP and three independents.The independent MPs didn t give much explanation of the reasons for their choices. But it seems that a large motivating factor was the Greens success in the senate, as Labor was more willing to work with the Greens that meant that if a Liberal based coalition had won in the lower house there was a good chance of a Double Dissolution.The Liberal party can t make dealsIn a world where sanity prevailed the result of this would be the Liberal party firstly adjusting their policies to appeal to Greens voters and secondly trying to make some deals with the Greens at a high level to allow the possibility of a Liberal/Green coalition government. While there are substantial policy conflicts between the Liberal and Green parties it does seem possible to get a coalition working if both sides accept that they won t get everything that they want. Forming government and getting only some of your policy implemented seems like a better option than being in the opposition and getting almost none of your policy implemented. Also there is no reason why we couldn t have a Liberal/Labor coalition government in the next decade it seems unlikely that any election will deliver a result that doesn t have Liberal + Labor comprising more than 50% of the seats in both houses.But it seems that sanity doesn t prevail. The Liberal party have put the Greens below Labor on their preferences for the upper house and on their How To Vote cards for the lower house [1]. This greatly increases the probability of Labor scoring an outright win. It also seems likely to drive a wedge against the conservative voters who want to conserve the environment.The Sad State of the Liberal PartyKevin Andrews (Liberal MP and former minister) wrote a strange and amusing diatribe titled The ideological drive behind the Greens [2]. Here is what I regard as the best part:First, those who vote Green as their primary vote: This is the Don s Party group that used to be in the ALP in the 60s and 70s: young university students or graduates, frequently working or still studying in academia, no kids, often gay, arts and drama type degrees or architecture where they specialise is designing environmentally friendly suburbs, agnostic or atheist, often US or Canadian refugees from capitalism, but well paid in professional consulting or media jobs. According to the CIA World Factbook [3] the median age of Australians is 37.5, the majority of the population were born in 1972 or later. The film Don's_Party was released in 1976 and was about the 1969 election. While Kevin Andrews was old enough to remember the 1969 election clearly the majority of the Australian population weren t even born before that election and isn t old enough to have watched the movie when it was in the cinemas. Kevin is making it quite clear that he and his party represent a time that is past. The rest of that paragraph is filled with strangeness that is a good sample of the rest of his article.The sad thing is that he seems to think that this appeal to the minority of people who are old enough to remember the 1969 election, bigoted enough to appreciate the discrimination against homosexuals (which is a long standing Liberal policy), and politically clueless enough to support McCarthyist policies against alleged communists.We need a decent and sane conservative party to represent the decent and sane Australian citizens who are politically conservative. I am beginning to doubt that the Liberal party could ever be reformed enough to become such a party.

Rapha&#235;l Hertzog: People behind Debian: Colin Watson, the tireless man-db maintainer and a debian-installer developer

Colin Watson is not a high-profile Debian figure, you rarely see him on mailing lists but he cares a lot about Debian and you will see him on Debconf videos sharing many thoughtful comments. I have the pleasure to work with him on dpkg as he maintains the package in Ubuntu, but he does a lot of more interesting things. I also took the opportunity to ask some Ubuntu specific questions since he s worked for Canonical since the start. Read on. My questions are in bold, the rest is by Colin. Who are you? Hi. I m 32 years old, grew up in Belfast in Northern Ireland, but have been living in Cambridge, England, since I was 18. I m married with a stepson and a daughter. I became interested in Debian due to the critical mass of Debian work happening in Cambridge at the time (and perhaps more immediately because my roommate was running Debian: hey, what s that? ), started doing random bits of development in 2000, and joined as a developer in 2001 (a really exciting time, with lots of new people joining who became integral parts of the project). I d only really been intending to do QA work and various bits of packaging around the edges, and maybe some work on the BTS, but then Fabrizio Polacco died and I took over man-db from him, and it sort of snowballed from there. I graduated from university shortly before becoming a Debian developer. I worked for a web server company (Zeus), then a hardware cryptography company (nCipher), before moving to work for Canonical in 2004, since when I ve been working full-time on Ubuntu. By this point, I suspect that going back to work in an office every day would be pretty tough. What s your biggest achievement within Debian or Ubuntu? One thing I should say: I rarely start projects. Firstly I don t think I m very good at it, and secondly I much prefer coming on to an existing project and worrying away at all the broken bits, often after other people have got bored and wandered off to the next new and shiny thing. That s probably why I ended up in the GNU/Linux distribution world in the first place, rather than doing lots of upstream development from the start I like being able to polish things into a finished product that we can give to end users. So, I ve had my fingers in a lot of pies over the years, doing ongoing maintenance and fixing lots of bugs. I think the single project I m most proud of would have to be my work on the Debian installer. I joined that team in early 2004 (a few months before Canonical started up) partly because I was a release assistant at the time and it was an obvious hot-spot, and partly because I thought it d be a good idea to make sure it worked well on the shiny new G4 PowerBook I d just treated myself to. I ended up as one of the powerpc d-i port maintainers for a while (no longer, as that machine is dead), but I ve done a lot of core work as well: much of the work to put progress bars in front of absolutely everything that used to have piles of text output, rescue mode, the current kernel selection framework, a good deal of udev support, several significant debconf extensions, lots of os-prober work, and I think I can claim to be one of the few people who understands the partitioner almost top to bottom. :-) d-i is the very first thing many of our users see, and has a huge range of uses, from simple desktop installs to massive corporate deployments; it s unspeakably important that it works well, and it s a testament to its design that it s been able to trundle along without actually very much serious refactoring for the best part of five years now. I have a soft spot for man-db too. It was my first major project in Debian, starting out from an embarrassingly broken state, and is now nice and stable to the point where I recently had time to spawn a useful generic library out of it (libpipeline). What are your plans for Debian Wheezy? d-i has a lot of code to deal with disks and partitions. Of course a lot of it is in the partitioner, and for that we use libparted so we don t have to worry very much about the minutiae of device naming. But there are several other cases where we do need to care about naming, mainly before the partitioner when detecting disks, and after the partitioner when installing the boot loader. Back in etch, we introduced list-devices , which abstracted away the disk naming assumptions involved in hardware detection. In wheezy, I would like to take all the messy, duplicated, and error-prone code that handles disk naming in the boot loader installers, and design a simple interface to cover all of them. This has only got more important following the addition of the kFreeBSD and Hurd d-i ports in squeeze, but it bites us every time we notice that, say, CCISS arrays aren t handled consistently, and it s a pain to test all that duplicated code. I d also like to spread the use of libpipeline through C programs in the archive, which I think has potential to eliminate a class of security vulnerabilities in a much simpler way than was previously available. If you could spend all your time on Debian, what would you work on? I would love to systematically reduce the need for the current mass of boot loaders. There s a significant cost to having so much variation across architectures here: it s work that needs to be done in N different places, the wildly differing configuration means that d-i has to have huge piles of code to manage them all differently, and there are a bunch of strange arbitrary limitations on what you can do. The reason I m working on GRUB 2 is that, in my view, it s the project with the best chance of centralising all this duplicated work into a single place, and making it easier to bring up new hardware in future (in a way that doesn t compromise software freedom, as many proprietary boot loaders of the kind often found on phones do). Of course, with flexibility tends to come complexity, and some people have a natural objection to that and prefer something simpler. The things I don t quite have time to do here are to figure out a coherent way to address the specific over-complexity problems people have with the configuration framework while still keeping the flexibility we need, and to do enough QA and porting work to be able to roll out GRUB 2 at installation time to all the Debian architectures it theoretically supports. What s the biggest problem of Debian? Backbiting, and too much playing the man rather than the ball. With one or two honourable exceptions, I ve largely stopped reading most Debian mailing lists since it just never seems a productive way to spend time compared to writing code and fixing bugs; and yet I m conscious that they re one of the primary means of communication for the project and I m derelict in not taking part in them. I do find it a bit frustrating that people are seen primarily in terms of their affiliations. I suppose it s natural for people to see me as an Ubuntu guy , but I don t really see myself that way: I ve been working on Debian for nearly twice as long as I ve been working on Ubuntu, and, while I care a great deal about both projects, I ve put far more of my own personal time into Debian and I try to make sure that a decent number of the things I m involved with there aren t to do with work. Work/life separation is a good thing, not that I m very good at it. Generally speaking, when I m working on Debian, I m doing so as a Debian developer, because I want Debian to be better. When that s not the case, if it matters, I try to indicate it explicitly. You re working for Canonical since Ubuntu s inception. If you were Mark Shuttleworth, is there something that you would have done differently? We had many good intentions when we founded Ubuntu. We also had a huge amount of work to deliver, to the point where it wasn t at all clear whether it would be possible (the warty release was named based on the expectations of it, after all, and came out much more usable than we d dared to hope). In hindsight, it might have helped to be quieter about our good intentions, so that we could exceed expectations rather than in some cases failing to meet them. That might have set a very different tone early on. (Personally, I m happy I m not Mark. The decisions in my office are much easier to take.) It seems to me that the community part of Ubuntu is much more eager to cooperate with Debian than the corporate part. It s probably just that more and more Canonical employees are not former Debian contributors. Do you also have this feeling? Are there processes in place to ensure everybody at Canonical is trying to do the right thing towards Debian cooperation? Just to be clear, I m wearing my own hat here which, ironically, is a fedora rather than a company hat. It makes sense for Canonical to be taking on more non-Debian folks; after all, we can t simply hire from the Debian community forever, and a variety of backgrounds is healthy. As you say, it may well be natural that Ubuntu developers who don t work for Canonical are more likely to have a Debianish background, as it tends to take something significant to get people to switch to a very different family of GNU/Linux distributions, and changing jobs is one of the most obvious of those things. Certainly, there was a definite sense among the early developers that we were all part of the Debian family and cared about the success of Debian as well. As Ubuntu has developed its own identity, people involved in it now tend to care primarily about the success of Ubuntu. At the same time, pragmatically, it s still true that getting code changes into Debian is one of the most economical ways to land them; changes made in Debian or upstream land once and tend to stay in place, while changes made only in Ubuntu incur an ongoing merge overhead, which is not at all trivial. In many ways it s human nature to try to fulfil your immediate goals in the most direct way possible. If your goal is to deliver changes to Ubuntu users, then it s natural to concentrate on that rather than looking at the bigger picture (which takes experience). Debian developers often fail to send changes upstream for much the same reason, although there s more variation there because they re normally working on Debian of their own volition and thus tend to have wider goals; the economics are more or less parallel though. Thus, I think the best way to improve things is to make it the path of least resistance for Ubuntu developers to send changes to Debian. We re already seeing how this works with the Ubuntu MOTU group; if you send a patch for review, or work on merging a package from Debian, very often the response includes have you sent these changes to Debian? . We re working on both streamlining our code review through a regular patch pilot programme and requiring more code review for changes in general, so I think this will be a good opportunity to ask more people to work with Debian when they propose changes to Ubuntu. For myself, this may be obvious, but I notice that I m much better at getting changes into Debian when I already have commit access to the Debian package in question. All the work on improving collaborative maintenance in Debian can only help, for Ubuntu as well as for everyone else. It doesn t make so much difference for large changes that require extensive discussion, but there are lots of small changes too. Canonical is upstream of many software projects (unity, indicators infrastructure, etc.). Why aren t those software immediately packaged in Debian? Do you think we can get this to change? I m not sure what the right approach is here, particularly as I haven t been involved with much of that on the Ubuntu side. I suspect it would be helpful to look at this in a similar way to Ubuntu changes in general. It s understandable that those developers have getting changes into Ubuntu as their first goal. And yet, having code in Debian offers a wider, and often technically adept, audience, and most developers like having their code reach a wider audience even if it s not their first priority, particularly if that audience is likely to be able to help with finding problems and fixing bugs. It should be seen as something beneficial to both distributions. The hardest problems will be with things that aren t merely optional add-ons (which should generally be fairly non-controversial in Debian, given the breadth of the archive in general the existence of things like bzr and germinate as Debian packages was never a hard question), but which require changes in established packages. For example, gnome-power-manager in Ubuntu is built with application indicator support, and that s an important part of having a good indicator-based panel: a lot of the point of indicators is consistency. Since I do very little desktop work myself, I don t know exactly what would be involved in making it possible to choose this system based on a Debian desktop, but I think it s probably a bit more complicated than just making sure all the new packages exist in Debian too. Obviously you have to start somewhere. Is there someone in Debian that you admire for his contributions? Christian Perrier is absolutely tireless and has done superb things for the state of translations in Debian. And Russ Allbery, even aside from his fine ongoing work on policy, Lintian, and Kerberos, is a constant voice of sanity and calmness. Release management is incredibly hard work, as I know from my own experience, and anyone who can sustain involvement in it for a long period is somebody pretty special. Steve Langasek and I got involved at about the same time but he outlasted me by quite a few years. He deserves some kind of medal for everything he s done there.
Thank you to Colin for the time spent answering my questions. I hope you enjoyed reading his answers as I did. Subscribe to my newsletter to get my monthly summary of the Debian/Ubuntu news and to not miss further interviews. You can also follow along on Identi.ca, Twitter and Facebook.

11 comments Liked this article? Click here. My blog is Flattr-enabled.

24 November 2010

Jonathan Wiltshire: Shibboleet

Boy, I wish that word worked. Today I had cause to email O2, the local Telefonica outpost, to have them disassociate my phone from the Cloud hotspot network, to which I get a subscription with my contract. This is so that I can associate my new Desire Z instead. I explained that I can connect to the AP, but when I enter my phone number to associate it is refused. Their considered response to this request was as follows:
As you re using a Palm Pre, I d request you to switch on Palm Pre by following the steps provided below
Of course, I m so silly I forgot to switch the phone on! Any suggestions for a UK SIM-only provider with a clue (and optionally including free use of Cloud hotspots)?
Comments flattr this!

23 November 2010

Russell Coker: Links November 2010

Guy Deutscher wrote an interesting article for the New York Times about how language shapes how we think [1]. The example of people who have no language construct for self-sentered directions and how they describe things is particularly interesting.TED published an interesting interview with Shaffi Mather the founder of India s first organised ambulance service (with differential pricing based on ability to pay) [2]. He also talks about founding schools in small towns and his BribeBusters.com company.World Changing has an interesting article about a legislative change in California that allows car-sharing of personal vehicles [3]. The concept is that if you own a car that you don t use most of the time (as is usually the case) then you can contract with a car-share company to share it to others when you don t need it. This saves the car share company from the capital expense of owning cars and thus allows them to place cars in remote locations that wouldn t otherwise be financially viable (IE the street in front of random people who sign up). The person who owns the car may get about $2 per hour for the time when it s rented. The car owner gets to specify when the car may be available.Charles Stross wrote an entertaining and informative rant about Steam-Punk [4]. He cites Michael Moorcock s informative essay about Starship Troopers and other right-wing apologist themes in sci-fi [5] as well as China Mieville s essay about politics and The Lord of the Rings [6].Glenn Greenwald wrote an informative article about the New York Times defending torture by the US military [7]. I have unsubscrubed from the @Times mailout and will avoid citing NYT articles wherever possible. I sent the URL for Glenn s article to the NYT feedback address but I don t expect them to take any notice.Fate Of the World is a new computer game that s in beta where you have a simulation of the next 200 years of climate change [8]. It s currently in beta for Windows only, they hope to have a Mac version in March and have no stated plans for Linux support.Cory Doctorow wrote an interesting article for Locus about Sci-Fi fans and cosmopolitanism taking the best option after consideration rather than doing what s locally fashionable [9]. He uses the term Martian to refer to some of the viewpoints, but it seems to me that Vulcan would be more appropriate.The Wall St Journal has an interesting article about people who manufacture drugs that aren t yet illegal, every time one drug gets banned they market a new one [10]. This is yet another example of the War on Drugs doing more harm than good, instead of taking drugs which have well known effects (that can be treated by hospitals) people are taking weird new drugs and no-one knows what will happen to them.Mieke Meijer in the Netherlands has invented a new product known as newspaper wood [11], it involves gluing paper together to create a form of chip-board that keeps the layers of paper distinct to give a result like wood grain. The World Changing commentary suggests that this could give a heirloom quality to objects made with it, while I m dubious about that I think that the surface would be pleasing to look at in a kitchen or office environment.Ze Frank gave an interesting TED talk about unusual social projects that he s run on the Internet [12]. This includes an attempt to reconcile Red and Blue voters after the 2008 US presidential election, the creation of inspirational songs, and remixing the Whip Somebody s Ass song. This is really worth watching!The Chronicle Review has an interesting article by someone who is paid to complete academic assignments for other people [13]. The scope of cheating that is claimed is profound. Naturally we have to take claims by someone who admits acting unethically with a grain of salt, but if there is any truth to this then it s a serious matter. I m surprised that no-one has made a serious attempt to catch the customers of such people.David Brin (the famous sci-fi author) gave an interesting short lecture about the future of humanity [14]. He promotes the Lifeboat Foundation (of which he is a director) and describes his concern about the Fermi Paradox.Shimon Schocken gave an inspiring TED talk about his work rehabilitating juvenile prisoners through taking them mountain-bike riding [15]. This shows that anyone can do great things to help other people, he got this idea when riding past a prison, convinced the prison governor that it was a good idea and then started doing it.Conrad Wolfram gave an insightful TED talk about math education [16]. His claim is that the entire mathematical education system is wrong in it s focus on hand calculation, instead the aim should be to teach children how to use computers to solve problems which is what is mostly done in the real world.

Julien Danjou: Color contrast correction

I finally took some time to finish my color contrast corrector. It's now able to compare two colors and to tell if they are readable when used as foreground and background color for text rendering. If they are too close, the code corrects both colors so to they'll become distant enough to be readable. To do that, it uses color coordinates in the CIE L*a*b* colorspace. This allows to determine the luminance difference between 2 colors very easily by comparing the L component of the coordinates. The default threshold used to determine readability based on luminance difference is 40 (on 100), which seems to give pretty good results so far. Then it uses the CIE Delta E 2000 formula to obtain the distance between colors. A distance of 6 is considered to be enough for the colors to be distinctive in our case, but that can be adjusted anyway. That depends on reader's eyes. If both the color and luminance distances are big enough, the color pair is considered readable when used upon each other. If these criteria are not satisfied, the code simply tries to correct the color by adjusting the L (luminance) component of the colors so their difference is 40. Optionally, the background color can be fixed so only the foreground color would be adjusted; this is especially handy when the color background is not provided by any external style, but it the screen one (like the Emacs frame background in my case). Here is an example result generated over 10 pairs of random colors. Left colors are randomly generated, and right colors are the corrected one. <style type="text/css"> </style>

bg: DarkSeaGreen4 fg: gray67 ->                             fg: #4a6b4b bg: #cccccc
bg: SlateGray4 fg: forest green ->                          fg: #9faec0 bg: #005700
bg: grey13 fg: grey36 ->                                    fg: #131313 bg: #6c6c6c
bg: MediumPurple2 fg: honeydew ->                           fg: #9e78ed bg: #f0fff0
bg: grey43 fg: chartreuse3 ->                               fg: #5e5e5e bg: #79de25
bg: linen fg: DeepPink2 ->                                  fg: linen bg: DeepPink2
bg: CadetBlue4 fg: blue1 ->                                 fg: #6c9fa4 bg: #0000e1
bg: gray33 fg: NavajoWhite3 ->                              fg: #525252 bg: #cfb58c
bg: chartreuse1 fg: RosyBrown3 ->                           fg: #9cff38 bg: #b28282
bg: medium violet red fg: DeepPink1 ->                      fg: #9c0060 bg: #ff55b9
All this has been written in Emacs Lisp. The code is now available in Gnus (and therefore in Emacs 24) in the packages color-lab and shr-color. A future work would be to add support for colour blindness. As a side note, several people pointed me at the WCAG formulas to determine luminance and contrast ratio. These are probably good criteria to choose your color when designing a user interface. However, they are not enough to determine if displayed color will be readable. This means you can use them if you are a designer, but IMHO they are pretty weak for detecting and correcting colors you did not choose. Flattr this

Mike Hommey: Improving libxul startup I/O by hacking the ELF format

If you have been following this blog during the past months, you might have gathered that I ve been focusing on I/O patterns on library initialization, more specifically libxul.so. The very patterns there s not much to do about, except enduring them, or hacking ld.so and/or the toolchain. The latter is not necessarily easy, and won t benefit everyone until all linux distros use an improved glibc and/or toolchain. This could take years before any actual result would reach end users. But with a little creativity, one can overcome these limitations and improve the situation today. Here is a summary of my recent hacks. Backwards static initializers As Taras showed in the past, static initializers are executed in reverse order. It turns out it is an unfortunate design choice in gcc, and it also turns out not to impact all ELF binary files. As far as I know there are currently two different implementations of the static initializers call loop, one provided by gcc, and one provided by ld.so. In the gcc case, the compiler creates a .ctors section, starting with 0xffffffff, ending with 0x00000000, and filled with pointers to the various static initializer functions, in ascending order. The compiler also injects an initializer function, called from .init, going through this .ctors section, starting from the end (__do_global_ctors_aux in crtend.o). A similar .dtors section is created for functions to run when the library is unloaded, and the pointers in it are called in ascending order. There is actually no importance in the order in which .ctors and .dtors are executed. All that matters is that they are executed in reverse order from each other, because that limits the risks of bad ordering. It is only unfortunate that .ctors was chosen to be the one backwards. In the ld.so case, the compiler creates a .init_array section, filled with pointers to the various static initializer functions, in ascending order. It also stores the location and the size of this section in the PT_DYNAMIC ELF header. At runtime, ld.so itself reads this information and executes the static initializers in ascending orders. A similar .fini_array section is created for functions to run when the library in unloaded, and ld.so goes through it in descending order. The .init_array section is newer, and for backwards compatibility reasons, is not used on systems that have been using the .ctors approach forever. On the other hand, some newer ABIs, such as arm EABI, uses the new facility, which means they are not victim of backwards static initialization. I however wonder if backwards compatibility is still needed, considering how long .init_array support has been around (more than 11 years, according to glibc git repository). While we could obviously bug the gcc maintainers to revert their .ctors execution order, or ditch .ctors support on glibc systems, which means we wouldn t get any immediate global benefit, we can also just revert the .ctors section content. Please note the source code out there doesn t take care of reverting the .dtors section accordingly, because it is currently empty in libxul.so. Relocations As I mentioned in an earlier post, relocations are what make it possible to load libraries at arbitrary locations. Unfortunately, a great number of relocations means awful I/O patterns: ld.so reads and applies them one by one, and while the kernel reads ahead by 128 KB chunks, when your relocation section exceeds that amount by more than an order of magnitude, it means I/O goes back and forth a lot between the relocation section and where the relocations take place. There are two classes of relocations: REL and RELA. In both cases, there are several types of relocations, some of which require an addend. The difference between both classes is in REL relocations, the addend is stored at the offset the relocation takes place, and in RELA relocations, the addend is stored in the relocation entry. It means that RELA relocations effectively waste space, as the addend ends up actually being stored twice: it is also stored at the offset the relocation takes place, like with REL relocations, though it could technically be nulled out, there ; in any case, the space is wasted. REL relocations thus take 2 words of storage, and RELA relocations, 3. On x86, the ELF ABI only uses REL relocations, and words are 32 bits, making each relocation take 8 bytes ; on x86-64, the ELF ABI only uses RELA relocations, and words are 64 bits, thus making each relocation take 24 bytes, 3 times that of x86 relocations. On ARM, both may be used, but apparently the compiler and the linker only use REL relocations. These words of storage are used to store 3 or 4 bits of informations: The linker splits relocations in two main categories: those for dynamic linking at startup and those for procedure linkage table (PLT) resolution at runtime. Here is what the repartition look like on libxul.so (taken from the mozilla-central nightly from Nov, the 22nd):
dynamic relocations PLT relocations
Architecture number size (bytes) number size (bytes)
x86 231,836 1,854,688 3,772 30,176
x86-64 235,893 5,661,432 3,773 90,528
So, PLT relocations are quite negligible, and dynamic relocations are just huge, especially on x86-64. Compared to the binary size, it s pretty scary:
Architecture libxul.so size relocations size %
x86 21,869,684 1,884,864 8.61%
x86-64 29,629,040 5,751,984 19.41%
Let me remind you that not only do we need to read these relocations at startup (at least the dynamic ones, but the PLT ones are just negligible), but we only read them by chunks, and need to read other data in between. Of the many existing types of relocations, only a few are actually used in dynamic libraries. Here is a summary of those in use in libxul.so:
x86 relocation type number x86-64 relocation type number
dynamic relocations
R_386_TLS_DTPMOD32 1 R_X86_64_DTPMOD64 1
R_386_GLOB_DAT 213 R_X86_64_GLOB_DAT 238
R_386_32 27,643 R_X86_64_64 27,611
R_386_RELATIVE 203,979 R_X86_64_RELATIVE 208,043
PLT relocations
R_386_JUMP_SLOT 3,772 R_X86_64_JUMP_SLOT 3,773
The above types can be separated in two distinct categories: In the second category, it means we are wasting all the bits for the symbol reference in each entry: 24 on x86 and 32 on x86-64. Unfortunately, the vast majority of the relocations in libxul.so are from that category. At this point, this is how much waste we identified:
description num. entries waste per entry (bytes) total % of relocation size
x86
Relocation without symbol ref. 203,980 3 611,937 32.46%
x86-64
Duplicated addend 239,666 8 1,917,328 33.33%
Relocation type encoded on 32 bits 239,666 3 718,998 12.49%
Relocation without symbol ref. 208,044 4 832,176 14.46%
Total 3,468,502 60.30%
On top of that, one could argue that we don t need 24 or 32 bits for symbol reference (which is the entry number in the symbol table), and that we re really far from requiring 64 bits for r_offset on 64 bits systems, as libxul.so is far from being bigger than 4GB. Anyways, that means we have room for improvement here, and it means that the ELF format, especially on 64 bits systems with RELA relocations, really doesn t help with big programs or libraries with a lot of relocations. (For that matter, the mach-o format used on OS-X has some kind of similar issues ; I don t know for the DLL format) Another interesting data point is looking at how relocations r_offset are following each other, once relocations are reordered (to avoid too much symbol resolution, they are actually grouped by symbol). It turns out 206,739 relocations r_offset are at 4 bytes from the previous one on x86 (i.e. strictly following it), and 210,364 at 8 bytes from the previous on x86-64. The main reason why this happens is that most relocations are happening in pointer tables, and libxul.so has lots of them: And when I say libxul.so has lots of them, that s not an understatement: there are 184,320 relocations due to vtables (function tables you get when using virtual methods in C++) on x86 and 184,098 on x86-64. That s respectively 78.23% and 76.81% of the total number of relocations. Interestingly, while most of these relocations are R_*_RELATIVE, 26,853 are R_386_32, and 26,829 are R_X86_64_64. Except for a very few, these non relative relocations are for the __cxa_pure_virtual symbol, which is a dummy function that does nothing, used for pure virtual methods, such as the following:
class Abstract
public:
virtual void pure_virtual() = 0;
;
As for the remaining relative relocations, there are a few pointer tables responsible for several thousand relocations, such as JSString::length2StringTable, gEntries, GkAtoms_info, Html5Atoms_info, kUnixCharsets, nsIDOMCSS2Properties_properties, etc. Packing relocations While they are not detrimental to most binaries, we saw that relocations can have a bad effect on startup I/O for big binaries. Reducing how much space they take would have a direct impact on these startup I/Os. One way to do so is obviously to reduce the number of relocations. But as we saw above, the vast majority are due to vtables. While reducing vtables would be a nice goal, it s a long way before this can have a significant impact on the relocations number. So another possible way is to try to avoid wasting so much space in relocations. The main problem is that relocations are applied by ld.so, and that, as mentioned in the introduction, while we can hack ld.so to do what we want, it won t work everywhere before a long time. Moreover, it s difficult to test various implementations, and binary compatibility needs to be guaranteed once something is applied in the upstream libc. The idea I started to test a few weeks ago, is to effectively apply relocations by hand instead of relying on ld.so doing it. Considering the first thing ld.so does with a library after applying relocations is to call its DT_INIT function, the idea was to replace the dynamic relocations we can with a new DT_INIT function we would inject that d apply those relocations, while storing them in a more efficient manner. The function would obviously need to call the original DT_INIT function once done. Some parts of the PT_DYNAMIC section also obviously need to be adjusted accordingly. The first iteration I tested a few weeks ago helped validating the idea, but didn t change much of the binary: the dynamic relocation section still was taking all the space it took before, though its content was mostly empty (we ll see further below how efficient even the current dumb format is). Once the theory that an injected DT_INIT function could apply the relocations without breaking everything, I went on to implement a program that would actually strip the ELF binary. I won t get too much into the gory details, but it required PT_LOAD splitting, thus program headers growth, which means moving the following sections, then removing a huge part of the relocations, shrinking the relocations section, injecting our code and the packed relocations as sections, and moving the remaining sections after these new sections, to avoid empty space, but still respecting the proper offsets for both PT_LOAD and the code itself. So far, I only took care of the R_*_RELATIVE relocations. Some but not all other relocations could be taken care of, too, but everything involving symbol resolution from other libraries would be really difficult to handle from the injected code. The relocations are currently stored with a quite dumb format: As we only take care of one type of relocations, we can skip any information about the type. Also, the addend already being stored at r_offset, we just strip it from RELA relocations ; the binary being far from 4GB big, 32 bits is enough on 64 bits systems too. We also saw that a lot of relocations were next to the following ones, so instead of storing r_offset for each one, storing some kind of range is more efficient. As I ve so far been focusing on getting something that actually works more than on getting something really efficient, I only tested this format, but the results are already nice:
x86 x86-64
before
dynamic relocations (bytes) 1,854,688 5,661,432
libxul.so size 21,869,684 29,629,040
after
dynamic relocations (bytes) 222,856 668,400
injected code size 129 84
packed relative relocations (bytes) 224,816 228,568
libxul.so size 20,464,836 (-6.42%) 24,865,520 (-16.07%)
Getting rid of the __cxa_pure_virtual relocations would help getting this even further down, and an even better storage format could be used, too. Gathering new startup coverage data should be interesting as well. The code is available via mercurial. Please note the Makefile deeply sucks, and that the code is in the middle of its third refactoring. Anyways, once you get the code to compile, you just need to run test-x86 or test-x64 depending on your architecture, from the build directory, and give it the libxul.so file as an argument. It will create a libxul.so.new file that you can use to replace libxul.so. You may successfully use the tool on other libraries, but chances are you ll bump into an assert(), or in the worst case, that the resulting library ends up broken. The tool might work on PIE executables, but most probably not on other executables. If you wonder, Chrome is not PIE. It s not even relocatable (which means ASLR won t work with it) ; or at least the x86-64 binaries I just got aren t. More possible ELF hacking The code I wrote to pack relocations allows to do various tricks on ELF files, and it opens various opportunities, such as: Some of the above could probably be done with linker scripts, but using linker scripts is unnecessarily over complicated: as soon as you start using a linker script to fiddle with sections, you need to reimplement the entire default linker script (the one you can see with ld --verbose). And it s not guaranteed to work (Taras told me he had a hard time failing to align the .bss section). And as far as I know, you can t use the same thing depending whether you use ld or gold (AIUI, gold doesn t support the whole ld linker script syntax).

Biella Coleman: An unlikely story about a pit bull attack, free software, and a New York Times reporter

If I told you that in the last two days, I have been caught in a vortex of coincidence, a vortex composed of pit bulls, free software, diaspora (the software), mold, and a New York Times reporter, I bet you would think not likely. So the story started on Jet Blue, which offers snacks, lots of them, and Direct TV. Since I don t have TV I kinda go on a binge, watching all sorts of shows as I make my way home. I watched a pretty distributing but interesting documentary on Jim Jones on CNN and a show on Animal Planet on pit bulls and parolees. When I rolled into my my current digs in northern Manhattan (I am currently banished from my downtown apt due to mold, but that is a whole other story), there was a dinner party well underway. At some point in the evening prompted by me, we talked pit bulls as my friends want to get one but their family has issued a threat of disavowal if they do. The next morning, I was scoping out the website for the Animal Planet show as I was intrigued by it and frankly I kinda like pit bulls (maybe less now although I think they are unfairly maligned). Five minutes into pursuing the site, I hear screeches from hell. It sounds like a woman is being attacked. And she is. A woman right outside of my window was being attacked by a pit bull. So I am staying with a friend, an open source developer, Karl Fogel and good soul that he is, he runs out to help the lady (since I have been subject to 5 weeks of sickness due to mold or so that is what we think it is was enough for me; I could not stomach the idea of getting bit so I played the role of concerned spectator). It took minutes upon minutes, really just too many minutes to get the pit bull off, even a brick pounded against his head failed (apparently, a cigarette or match held to the throat does the trick, which I found out later). Eventually, the dog was extracted, a huge team of cops showed up, the dog was whisked away, the victim taken to the hospital, and life returned to calm and quiet. So the next day, I was being interviewed by a New York Times reporter Jim Dwyer who wrote a story about Diaspora for the New York Times back in the summer, helping to propel it from relative obscurity to near insta-fame (one of the Diaspora developers, Max, was my student). We were running out of time (I had another appointment) so I asked him if he lived in northern Manhattan as that is what his bio page indicates. He confirmed, I explained I was up there and that we could meet up there later to finish up. He inquired what part, I told him roughly where I was, he remarked he was near there, and so naturally I told him about the crazy pit bull attack I witnessed from my window as I can t shut my trap when it comes to things like that. Well yes you know what is coming next next: he was there, helping Karl (and others) deal with the pit bull attack. He lives nearby and heard the shrieks of agony and came out to aid. All and all it was pretty horrific. He also met Karl in so far as Karl gave him his phone number and email just in case he was needed as a witness (Karl had to dash off to catch a plane). Well, the funny thing, or as you also might guess: Jim, who is doing some more writing on tech, free software etc, should really talk to Karl given his key role in the community, so they already met, although under odd and terrible circumstances. I am not sure if I am more wigged out by the fact that I was reading about pit bulls when the attack happened or whether the reporter I was interviewed by was there along side with a free software developer he really needs to interview. Whatever the case, I kinda hope the vortex of coincidence now leaves me to hit someone else (sans any horrible attack). Or else, as Karl noted in the blog comments, I will have to be very careful about what shows I watch:
Amen to that! Enough with the coincidence vortex. As I said to Biella in IRC later: Do us a favor don t watch any shows about nuclear attacks on New York, okay

Michal &#268;iha&#345;: New phpMyAdmin features - user interface cleanup

Next article highlighting some new features which will come in phpMyAdmin 3.4 is about more little changes. You can try them it out on our demo server. Or just wait few hours for first alpha release of 3.4. The user interface cleanup is partly connected with previous changes, because some functionality simply required more Javascript (for example editor for ENUM/SET fields). Besides these there were major changes in export and import pages, which now should be easier to understand, hiding advanced options from unexperienced users, while still providing ability to change them. New phpMyAdmin export page This feature was implemented by Lori Lee during Google Summer of Code 2010.

Filed under: Phpmyadmin 0 comments Flattr this!

22 November 2010

Michal &#268;iha&#345;: Strange Monday

Today was quite strange day for me - at the morning I felt quite bad so I took sick day to rest a bit. During afternoon I turned on the computer to see announcement that Novell agrees to be bought in $2.2b deal. As this is company where I work, it of course has attracted my attention. Novell was bought by Attachmate, a company with one quarter of our employees, and over a third of our revenue, what sounds strange. And this is the first time I hear of this company... The information is now very scarce (we as employees were not really given more information than is available publicly), so all what remains to people is to speculate. What does it mean for openSUSE? What is the "certain intellectual property" transferred to CPTN Holdings LLC (owned by Microsoft Corp.)? And some people just comment on current situation of Novell and some of it's products :-).

Filed under: Suse 1 comments Flattr this!

Next.

Previous.