Russ Allbery: Review: Thinking in Java
| Publisher: | Prentice Hall |
| Copyright: | 2006 |
| Printing: | October 2009 |
| ISBN: | 0-13-187248-6 |
| Format: | Trade paperback |
| Pages: | 1461 |
| Publisher: | Prentice Hall |
| Copyright: | 2006 |
| Printing: | October 2009 |
| ISBN: | 0-13-187248-6 |
| Format: | Trade paperback |
| Pages: | 1461 |
When I am writing software sometimes XKCD is accurate! curl -o /dev/null http://target.domain/1GB.bin 2>&1 tr "\r" "\n" awk ' print $12 ' >test1.dat
set terminal png nocrop enhanced font arial 8 size 1024,600 xffffffset output 'xfer.png'set style data linespointsset title "1Gigabyte file transfer throughput"set ylabel "Throughput in Kilobytes per second"set y2label "Speed in Megabits per second"set xlabel "Seconds of transfer"set ytics 1024set y2tics ("10" 1220, "20" 2441, "50" 6102, "100" 12204)set grid noxtics y2ticsset yrange [0:13000]set datafile missing "-"plot 'test1.dat' using 1 title 'Test1', \'test2.dat' using 1 title 'Test2', \'test3.dat' using 1 title 'Test3'

Debian s testing distribution is where Debian developers prepare the next
stable distribution. While this is still its main purpose, many users have
adopted this version of Debian because it offers them a good trade-off between
stability and freshness. But there are downsides to using this distribution
and the Constantly Usable Testing (CUT) project aims to resolve those.
This article will present the project and the challenges involved to make
it happen.
About Debian unstable & testing
Debian unstable is the distribution where developers upload new versions of
their packages. It happens frequently that some packages are not installable due
to changes in other packages or due to transitions not yet completed.
Debian testing, on the contrary, is managed by a tool that ensures the
consistency of the whole distribution: it picks updates from unstable only if
the package has been enough tested (10 days usually), if it s free of new
release-critical bugs, if it s available on all supported architectures, and if
it doesn t break any other package already present in testing. The Release
Team (RT) controls this tool and provide hints to help it find a set
of packages that can flow from unstable to testing.
Those rules also ensure that the packages that flow into testing are
reasonably free of show-stopper bugs (like a system that doesn t boot, or
X that doesn t work at all). This makes it very attractive to users
who like to regularly get new upstream versions of their software without
dealing with the biggest problems associated to them. This is all very
attractive, yet several Debian developers advise people to not use
testing. Why is that?
Known problems with testing
Disappearing software
The release team use this distribution to prepare the next
stable release and from time to time they remove packages from it. Either
because it s needed to ensure that other packages can migrate from
unstable to testing, or because they have long-standing release-critical
bugs without progress towards a resolution. It also happens that they
remove packages on request of the maintainers because they believe
that the current version of the software cannot be supported
(security-wise) for 2 years or more. The security team also regularly
issues such requests.
Long delays for security and important fixes
Despite the 10-day delay in unstable, there are always some annoying
bugs (and security bugs are no exceptions) that are only discovered when
the package already has migrated to testing. The maintainer might be quick to
upload a fixed package in unstable, and might even raise the urgency to
allow the package to migrate sooner, but if the packages gets entangled in a
large ongoing transition, it will not migrate before the transition is
completed. Sometimes it can take weeks for that to happen.
This delay can be avoided by doing direct uploads to testing (through
testing-proposed-updates) but this is almost never used, except
during a freeze, where targeted bugfixes are the norm.
Not always installable
With testing evolving daily, updates sometimes break
the last installation images available (in particular netboot images
that get everything from the network). The debian-installer (d-i) packages
are usually quickly fixed but they don t move to testing automatically
because the new combination of d-i packages has not necessarily been
validated yet. Colin
Watson sums up the problem:
Getting new installer code into testing takes too long, and problems remain unfixed in testing for too long. [...] The problem with d-i development at the moment is more that we re very slow at producing new d-i *releases*. [...] Your choices right now are to work with stable (too old), testing (would be nice except for the way sometimes it breaks and then it tends to take a week to fix anything), unstable (breaks all the time).CUT s history CUT finds its root in an old proposal by Joey Hess: it introduces the idea that the stable release is not Debian s sole product and that testing could become with some work a suitable choice for end-users. Nobody took on that work and there was no visible progress in the last 3 years. But recently Joey brought up CUT again on the debian-devel mailing list and Stefano Zacchiroli (the Debian project leader) challenged him to setup a BoF on CUT for Debconf10. It turned out to be one of the most heavily attended BoF (video recording is here), there is clearly a lot of interest in the topic. There s now a dedicated wiki and an Alioth project with a mailing list. The rest of this article tries to summarize the various options discussed and how they re supposed to address the problems identified. The ideas behind CUT Among all the ideas, there are two main approaches that have been discussed. The first is to regularly snapshot testing at points where it is known to work reasonably well (those snapshots would be named cut ). The second is to build an improved testing distribution tailored to the needs of users who want a working distribution with daily updates, its name would be rolling . Regular snapshots of testing There s general agreement that regular snapshots of testing are required: it s the only way to ensure that the generated installation media will continue to work until the next snapshot. If tests of the snapshot do not reveal any major problem, then it becomes the latest cut . For clarity, the official codename would be date based: e.g. cut-2010-09 would be the cut taken during September 2010. While the frequency has not been fixed yet, the goal is clearly to be on the aggressive side: at the very least every 6 months, but every month has been suggested as well. In order to reach a decision, many aspects have to be balanced. One of them (and possibly the most important) is the security support. Given that the security team is already overworked, it s difficult to put more work on their shoulders by declaring that cuts will be supported like any stable release. No official security support sounds bad but it s not necessarily so problematic as one might imagine. Testing s security record is generally better than stable s one (see the security tracker) because fixes flow in naturally with new upstream versions. Stable still get fixes for very important security issues sooner than testing, but on the whole there are less known security-related problems in testing than in stable. Since it s only a question of time until the fixed version comes naturally from upstream, more frequent cut releases means that users get security fixes sooner. But Stefan Fritsch, who used to be involved in the Debian testing security team, has also experienced the downside for anyone who tries to contribute security updates:
The updates to testing-security usually stay useful only for a few weeks, until a fixed version migrates from unstable. In stable, the updates stay around for a few years, which gives a higher motivation to spend time on preparing them.So if it s difficult to form a dedicated security team, the work of providing security updates comes back to the package maintainer. They are usually quite quick to upload fixed packages in unstable but tend to not monitor whether the packages migrate to testing. They can t be blamed because testing was created to prepare the next stable release and there is thus no urgency to get the fix in as long as it makes it before the release. CUT can help in this regard precisely because it changes this assumption: there will be users of the testing packages and they deserve to get security fixes much like the stable users. Another aspect to consider when picking a release frequency is the amount of associated work that comes with any official release: testing upgrades from the previous version, writing release notes and preparing installation images. It seems difficult to do this every month. With this frequency it s also impossible to have a new major kernel release for each cut (since they tend to come out only every 2 to 3 months) and the new hardware support that it brings is something worthwhile to many users. In summary, regular snapshots address the not always installable problem and changes the perception of maintainers towards testing, so that hopefully they care more of security updates in that distribution (and in cuts). But they do not solve the problem of disappearing packages. Something else is needed to fix that problem. A new rolling distribution? Lucas Nussbaum pointed out that regular snapshots of Debian is not really a new concept:
How would this differentiate from other distributions doing 6-month release cycles, and in particular Ubuntu, which can already be seen as Debian snapshots (+ added value)?In Lucas s eyes, CUT becomes interesting if it can provide a rolling distribution (like testing) with a constant flux of new upstream releases . For him, that would be something quite unique in the Free Software world . The snapshots would be used as starting point for the initial installation, but the installed system would point to the rolling distribution and users would then upgrade as often as they want. In this scenario, security support for the snapshots is not so important, what matters is the state of the rolling distribution. If testing were used as the rolling distribution, the problem of disappearing packages would not be fixed. That s why there have been discussions of introducing a new distribution named rolling that would work like testing but with adapted rules, and the cuts would then be snapshots of rolling instead of testing. The basic proposal is to make a copy of testing and to re-add the packages which have been removed because they are not suited for a long term release while they are perfectly acceptable for a constantly updated release (the most recent example being Chromium). Then it s possible to go one step further: during freeze, testing is no longer automatically updated which makes it inappropriate to feed the rolling distribution. That s why rolling would be reconfigured to grab updates from unstable (but using the same rules than testing). Given the frequent releases, it s likely that only a subset of architectures would be officially supported. This is not a real problem because the users who want bleeding edge software tends to be desktop users on mainly i386/amd64 (and maybe armel for tablets and similar mobile products). This choice if made opens up the door to even more possibilities: if rolling is configured exactly like testing but with only a subset of the architectures, it s likely that some packages migrate to rolling before testing when non-mainstream architectures are lagging in terms of auto-building (or have toolchain problems). While being ahead of testing can be positive for the users, it s also problematic on several levels. First, managing rolling becomes much more complicated because the transition management work done by the release team can t be reused as-is. Then it introduces competition between both distributions which can make it more difficult to get a stable release out, for example if maintainers stop caring of the migration to testing once the migration to rolling has been completed. The rolling distribution is certainly a good idea but the rules governing it must be designed to avoid any conflict with the process of releasing a stable distribution. Lastly, the mere existence of rolling would finally fix the marketing problem plaguing testing: the name rolling does not suggest that the software is not yet ready for prime time. Conclusion Whether CUT will be implemented remains to be seen, but it s off for a good start: ftpmaster Joerg Jaspert said that the new archive server can cope with a new distribution, and there s now a proposal shaping up. The project might start quickly: there is already an implementation plan for the snapshot side of the project. The rolling distribution can always be introduced later, once it is ready. Both approaches can complement each other and provide something useful to different kind of users. The global proposal is certainly appealing: it would address the concerns of obsolescence of Debian s stable release by making intermediary releases. Anyone needing something more recent for hardware support can start by installing a cut and follow the subsequent releases until the next stable version. And users who always want the latest version of every software could use rolling after having installed a cut. From a user point of view, there are similarities with the mix of usual and long term releases of Ubuntu. But from the development side, the process followed would be quite different, and the constraints imposed by having a constantly usable distribution are stronger: any wide-scale change must be designed in a way that it can happen progressively in a transparent manner for the user.
This article was first published in Linux Weekly News. If you want to see more articles like this, join Flattr and click on the flattr button below every article that you like.
Since I ran Bois d'Arcy hal-marathon back on Sept 12th, breaking my
record down to 1h37, I continued working on resistance, in preparation
for the Sein-Eure marathon on Oct 17th, two weeks from now.
I'm still working empirically. No program, no fractioned sessions,
work on speed, constant cardio training, etc. Just running...a
lot...most often at marathon speed, and alternating trail and road
running.
Usually, I'm out 4 days per week: both Saturdays (short 10km run, or
so), Sundays (long run, up to 20) and two week days, during lunch
(skipping lunch and going out running). I'm now working one day per
week in another facility of Onera,
in Palaiseau. This is 20km away from center Paris and has woods close
to it. So, I can train in trails rather than stupid roads...:-)
I ran a small local race on Sept 26th: "la vir e des Deux Bois", in
Villebon sur Yvette, a 18km trail with 330meters positive slope. I
finished 27th out of 69 in 1h31, despite the high level of
runners....most being trained trail runners who didn't want to run in
the crowd of Paris-Versailles.
Finally, this week-end (Oct 3rd), I (alone) ran a long trail to the Colline
d' lancourt, one of my favourite spots in the neighbourhoods,
marvelous when the sun is shining, with a 360 paronamic view up to 30
km in distance (yes, one can see the Eiffel Tower). This artificial "moutain" is
the highest point in Paris region. That trail involves many
funny...and muddy...single tracks in the forest. A great piece of
cake. It also involves 300 meters positive slope, so that's hard
training..:-)
I now feel ready for the third marathon of this year! Let's rest for
two weeks, now.
When I took over man-db in 2001, one of the major problems that became evident after maintaining it for a while was the way it handled subprocesses. The nature of man and friends means that it spends a lot of time calling sequences of programs such as zsoelim < input-file tbl nroff -mandoc -Tutf8. Back then, it was using C library facilities such as system and popen for all this, and I had to deal with several bugs where those functions were being called with untrusted input as arguments without properly escaping metacharacters. Of course it was possible to chase around every such call inserting appropriate escaping functions, but this was always bound to be error-prone and one of the tasks that rapidly became important to me was arranging to start subprocesses in a way that was fundamentally immune to this kind of bug.
In higher-level languages, there are usually standard constructs which are safer than just passing a command line to the shell. For example, in Perl you can use system([$command, $arg1, $arg2, ...]) to invoke a program with arguments without the interference of the shell, and perlipc(1) describes various facilities for connecting them together. In Python, the subprocess module allows you to create pipelines easily and safely (as long as you remember the SIGPIPE gotcha). C has the fork and execve primitives, but assembling these to construct full-blown pipelines correctly is difficult and error-prone, so many programmers don't bother and use the simple but unsafe library facilities instead.
I wrote a couple of thousand lines of library code in man-db to address this problem, loosely and now quite distantly based on code in groff. In the following examples, function names starting with command_, pipeline_, or decompress_ are real functions in the library, while any other function names are pseudocode.
Constructing the simplified example pipeline from my first paragraph using this library looks like this:
pipeline *p; int status; p = pipeline_new (); p->want_infile = "input-file"; pipeline_command_args (p, "zsoelim", NULL); pipeline_command_args (p, "tbl", NULL); pipeline_command_args (p, "nroff", "-mandoc", "-Tutf8", NULL); pipeline_start (p); status = pipeline_wait (p); pipeline_free (p);You might want to construct a command more dynamically:
command *manconv = command_new_args ("manconv", "-f", from_code,
"-t", "UTF-8", NULL);
if (quiet)
command_arg (manconv, "-q");
pipeline_command (p, manconv);
Perhaps you want an environment variable set only while running a certain command:
command *less = command_new ("less");
command_setenv (less, "LESSCHARSET", lesscharset);
You might find yourself needing to pass the output of one pipeline to several other pipelines, in a "tee" arrangement:
pipeline *source, *sink1, *sink2; source = make_source (); sink1 = make_sink1 (); sink2 = make_sink2 (); pipeline_connect (source, sink1, sink2, NULL); /* Pump data among these pipelines until there's nothing left. */ pipeline_pump (source, sink1, sink2, NULL); pipeline_free (sink2); pipeline_free (sink1); pipeline_free (source);Maybe one of your commands is actually an in-process function, rather than an external program:
command *inproc = command_new_function ("in-process", &func, NULL, NULL);
pipeline_command (p, inproc);
Sometimes your program needs to consume the output of a pipeline, rather than sending it all to some other subprocess:
pipeline *p = make_pipeline ();
const char *line;
line = pipeline_peekline (p);
if (!strstr (line, "coding: UTF-8"))
printf ("Unicode text follows:\n");
while (line = pipeline_readline (p))
printf (" %s", line);
pipeline_free (p);
man-db deals with compressed files a lot, so I wrote an add-on library for opening compressed files (which is somewhat man-db-specific, but the implementation wasn't difficult given the underlying library):
pipeline *decomp_file = decompress_open (compressed_filename); pipeline *decomp_stdin = decompress_fdopen (fileno (stdin));This library has been in production in man-db for over five years now. The very careful signal handling code has been reviewed independently and the whole thing has been run through multiple static analysis tools, although I would always welcome more review; in particular I have no idea what it would take to make it safe for use in threaded programs since I generally avoid threading wherever possible. There have been a handful of bugs, which I've fixed promptly, and I've added various new features to support particular requirements of man-db (though in as general a way as possible). Every so often I see somebody asking about subprocess handling in C, and I wonder if I should split this library out into a standalone package so that it can be used elsewhere. Web searches for things like "pipeline library" and "libpipeline" don't reveal anything that's a particularly close match for what I have. The licensing would be GPLv2 or later; this isn't likely to be negotiable since some of the original code wasn't mine and in any case I don't feel particularly bad about giving an advantage to GPLed programs. For more details on the interface, the header file is well-commented. Is there enough interest in this to make the effort of producing a separate library package worthwhile? As well as the general effort of creating a new package, I'd need to do some work to disentangle it from a few bits and pieces specific to man-db. If you maintain a specific package that could use this and you're interested, please contact me with details, mentioning any extensions you think you'd need. I intentionally haven't enabled comments on my blog for various reasons, but you can e-mail me at cjwatson at debian.org or man-db-devel at nongnu.org.
Recently, Google started changing the web in some interesting ways. A lot by
contributing code. It started with projects such as the Chrome web browser,
which quickly achieved a market shares over 10%, which is more than Apple
Safari and Opera together.And the good side, Chrome did not actually add "yet another incompatible
platform", but by being closely related to Safari (or more precisely WebKit),
it is not that different.Other stuff that belongs into this category is the Google Web Toolkit and the
closure compiler (which essentially is a JavaScript code checker and optimizer).But recently, Google goes a step further. They started tackling internet
file formats. First they proposed a new Video codec known as WebM or VP8.
Now they extracted an image format out of this codec, known as WebP.There is some serious
doubt on the quality, the images do appear to be a bit blurry and lose
details. I concur with JPEG even being a bit better, despite the block
artefacts. The blurry results of WebP are not really convincing.The h.264 based image looks best to me, but H.264 is patent-encumbered for all
I know, so we might not see this new format in wide use until 2028. This
already ruled out other image formats such as JBIG or FIF. Or look at audio
formats: we're still using MP3 everywhere, because everyone tries to push
another patent-encumbered audio format that the others are not going to adopt.
So MP3 remains the only thing widely accepted (Ogg Vorbis is nice, but it looks
as if companies such as Apple are not going to adopt it, probably because they
have interest in other formats. Maybe the Ogg Vorbis support in Chrome will
help here on the long run).In particular, why would you pay royalties for a tiny bit of image quality,
given the constantly sinking prices of bandwidth? The H.264 patents may make
a difference on video data, they probably won't pay of for still images.Given that WebM is sometimes claimed to be a simplified H.264 (minus the patent
issues?), WebP probably is as good as we can get to the H.264 based quality
without running into the same patent issues?But enough on the image data. There is one thing, I'd really like to see Google
change on the web. The worst thing about the web is called JavaScript (or
more accurately, ECMAScript). There is just so much wrong with this language
that we really need to replace it ASAP.Some things that are wrong with JavaScript:
I finally found the time to port the scripts
generating these statistics to use the Ultimate Debian
Database (and especially its bugs webinterface). Parsing the HTML output of bts.turmzimmer.net was
quite insane and slow, but it worked... kind of. However it's now done:
The script now uses not that insane SQL queries and UDD, of which I have
been told has more accurate numbers as bts.turmzimmer.net, which uses to
the best of my knowledge the obsoleted ldap gateway.
Well, so much for the talk, here are the actual numbers, created with
the new script:
| In Total: | 799 |
|---|---|
| Affecting Squeeze: | 429 |
| Squeeze only: | 110 |
| Remaining to be fixed in Squeeze: | 319 |
| Pending in Squeeze: | 22 |
|---|---|
| Patched in Squeeze: | 57 |
| Duplicates in Squeeze: | 35 |
| Can be fixed in a security Update: | 12 |
| Contrib or non-free in Squeeze: | 18 |
| Otherwise fixed in Squeeze: | 40 |
Squeezereleased. However, with the view of the Release Managers, 260 need to be dealt with for the release to happen. You'll note, that the numbers got quite higher. Sorry, for that, but bts.turmzimmer.net seems to be kind of buggy :( You'll also note, that there is no longer a row for
claimedand
fixed in delayedbugs, as UDD doesn't support these numbers as of now. But I think you'll agree with me, that having more accurate numbers is better than having these rows.
As this year's admin, I wrote up the following summary which has now been
posted at the R site in the appropriate slot. My thanks to
this year's students, fellow mentors and everybody else who helped to make it
happen.
f:R^m -> R^n, through Automatic Differentiation (AD). Numerical evaluation of derivatives has widespread uses in many
fields. rdx will implement two modes for the computation of derivatives, the Forward and Reverse modes of AD, combining
which we can efficiently compute Jacobians and Hessians. Higher order derivatives will be evaluated through Univariate
Taylor Propagation.
Delivered:
Two packages
radx: forward automatic differentiation in R and
tada: templated automatic differentiation in C++ were created; see
this blog post for details.
Last modified: Wed Sep 22 19:39:43 CDT 2010
class MyTest(TestCase):
def setUp(self):
foo = Foo()
bar = Bar()
self.quux = Quux(Foo(), Bar())
self.addCleanup(self.quux.done)
You can make it reusable across your code base simply by moving it into a fixture like this:
class QuuxFixture(fixtures.Fixture):
def setUp(self):
foo = Foo()
bar = Bar()
self.quux = Quux(Foo(), Bar())
self.addCleanup(self.quux.done)
class MyTest(TestCase, fixtures.TestWithFixtures):
def setUp(self):
self.useFixture(QuuxFixture)
I do hope that the major frameworks (nose, py.test, unittest2, twisted) will include the useFixture glue themselves shortly; I will offer it as a patch to the code after giving it some time to settle. Further possibilities include declared fixtures for tests, and we should be able to make setUpClass better by letting fixtures installed during it get reset between tests.
One of the things that I love about our Local LUG is the people. At our LUG, we have our resident geek artist, Antonio Roberts (aka hellocatfood) who, on the odd occasion, gets harassed into doing a talk for us. His talks are always fairly awesome. His previous talk about FLOSS + Art is the video with the highest views on our video archive, and tomorrow night, Thursday 16th September, at 19:30pm BST, he ll be delivering his next talk about his experience in the FLOSS community as an artist to us.
In his own words:-
This talk extends greatly on what was said and goes into issues of copyright and what experiences I ve had as an artist in the open source worldHis previous talk was a bit of an eye-opener to me, as a pure geek with barely a trace of artistry in me, and it s always good to see the FLOSS world from the eyes of someone who doesn t exactly fit the stereotype of what you d normally expect to see. The video will be available after the event, at some point, but for those who re interested in gaining an insight into artistry and FLOSS, we ll be broadcasting the talk live over the interwebs. <script type="text/javascript"> var flattr_wp_ver = '0.9.11'; var flattr_uid = '34168'; var flattr_url = 'http://www.sourceguru.net/freedom-creativity/'; var flattr_btn = 'compact'; var flattr_hide = 0; var flattr_lng = 'en_GB'; var flattr_cat = 'text'; var flattr_tle = 'Freedom in Creativity'; var flattr_dsc = 'One of the things that I love about our Local LUG is the people. At our LUG, we have our resident geek artist, Antonio Roberts (aka hellocatfood) who, on the odd occasion, gets harassed into doing a talk for us. His talks are always fairly awesome. His previous talk about FLOSS + Art is the video with the highest views on our video archive, and tomorrow night, Thursday 16th September, at 19:30pm BST, he\'ll be delivering his next talk about his experience in the FLOSS community as an artist to us. In his own words:- This talk extends greatly on what was said and goes into issues of copyright and what experiences I ve had as an artist in the open source world His previous talk was a bit of an eye-opener to me, as a pure geek with barely a trace of artistry in me, and it\'s always good to see the FLOSS world from the eyes of someone who doesn\'t exactly fit the stereotype of what you\'d normally expect to see. The video will be available after the event, at some point, but for those who\'re interest'; var flattr_tag = 'art,artist,floss,lug,presentation,sblug birmingham lug,streaming,talk,video'; </script> <script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>
Peter Cox on model complexity
As mentioned in my last blog post the GuruPlug Server Plus needs some major refactoring before it can be used. Not doing so will make you end up with a fried brick. There are various stories in the forums about cooling it properly, so you might want to have a look first instead of following mine blindly. And of course - whatever you do - it is your fault when you end up with a brick, not mine!.
Not sure if I could introuce some more load, the CPU had a load of 6 running stress. Network traffic was around 2x100MBit/s again. I could imagine with 2xGBit the CPU and PHY would become much hotter (no idea if it would be able to handle it at all, though). The PHY was usually a bit cooler than the CPU, so I didn't spend time to measure the temperature properly.
Really, I should have known better than to buy myself a rather 'bleeding-edge' laptop. I suppose I've been lucky with my last couple of laptops and was thinking that pretty much everything works on Linux. Or maybe I'm being picky, because in fact pretty much everything does work on my new Dell Studio.
I bought this laptop mainly because it has a 1920x1080 screen, without being a 17" monster. I had such a monster about four laptops ago (an enormous Sony Vaio weighing in at around 5kg and with a 1hr battery life) and it was an disaster: lots of weird proprietary stuff that never worked, like the external speakers in the docking station. But I loved that screen right up until the day Fraser threw a pair of scissors into it.
With the advent of mass-market 1920x1080 screens I've been waiting for them to arrive in laptops at a reasonable price, and the availability of this screen in a few possible laptops seemed to me to be that point.
It's a Dell Studio 15, and as well as the nice screen, it comes with a new Intel i7 Quad Core CPU, 6G RAM, 640G hard drive and a Blu-ray drive. While there are a few similar models around this one seemed to have the best mix of features-for-weight-and-price, so I bought my first Dell.
I built a USB key with the latest Debian Installer from Squeeze and installed that and everything came up pretty well. I had to use the broadcom-sta driver for the wireless, since the BCM 43224 is not (yet) supported by the free b43 driver (though from looking the mailing list people seem to be working on it, and it looks like it might not be too far away).
Everything seemed good. X came up on the (georgeous) screen. I don't care too much about 3D performance, but it was nice to note that the ATI 5000 series is expected to have full support as soon as it's integrated into the right places - it seems the code is written, and public, it just isn't incorporated into the 'radeon' driver quite yet. The fact that ATI is nowadays a free-software friendly company was one of the reasons for choosing this, in preference to an NVidia-based laptop.
But it seems that it isn't all roses. The fan in the laptop seems permanently on, and not on, in a quiet-just-barely-audible way, but ON, in an 'IN UR LAPTOPZ KOOLIN UR P0RCESSAZ' kind of a way. Too damn noisy for me to concentrate in a quiet room.
I've investigated what's going on, and it seems likely there are some ACPI misunderstandings happening. Some googling and some pecking around in /sys makes me wonder if the laptop expects some kind of configuration choice between favouring Active cooling and Passive cooling, and it's defaulted to the first one. Perhaps you get better benchmarks that way.
Linux ACPI also seems to only half understand it, it has two thermal zones, and one of them always appears with 0 temperature. I can see set points for the fans, but have no control over them. In particular this got me out reading the ACPI 4.0 specification, and it explicitly mentions this choice of favouring 'Active' vs 'Passive' as being done by configuring the passive trip point setting to a higher value than the low & high active trip points.
In the ACPI 4 spec (page 409) it says:
To implement a preference towards performance or energy conservation, OSPM can request that the platform change the priority of active cooling (performance) versus passive cooling (energy conservation/silence) by evaluating the _SCP (Set Cooling Policy) object for the thermal zone or a corresponding OS-specific interface to individual devices within a thermal zone.This laptop is showing 'passive' at 95000 millidegrees celsius, and 'active' at 55000 / 75000 so right in line with the suggestion. However I don't see any way in Linux to change these trip point values, and in any case I'm not convinced the laptop is actually obeying them at all. It should be that if I do nothing on the laptop for a while the temperature would surely drop below 55 degrees celsius. Surely a modern laptop will sit at under 40 degrees when it's quiescent, and the temperature sensor that does show me something sits at around 30 degrees in this too, 26.8, to be overprecise. That one doesn't budge either. Looking in /sys/ I can't for the life of me find a way to set that cooling policy, and when I disassemble the DSDT it looks like a noop... Thinking that perhaps there was a newer BIOS, I looked at the Dell site and found there was one. Great! Investigating even further, it seems Dell hardware has some interesting capability via libsmbios and some utilities which will let me install my BIOS from a Linux system... even better! Linux is a second-class citizen though, and when I look for the Dell BIOS Hdr file I need there is no version of the file for this laptop - let alone the current BIOS version. And when I download the BIOS from Dell's website and unzip the first layer of packaging I find that both of the files inside will only run on Windows. I added a FreeDOS boot stanza to Grub 2 in order to discover this, also discovering in the process that this is not well explained, and I could not find how to do it on the FreeDOS or Grub2 websites, so in passing, here is what I added into
/etc/grub/40_custom :
menuentry 'BIOS Flash 1558 A09' --class os
set root='(hd0,msdos1)'
linux16 /boot/memdisk
initrd16 /boot/1558_A09.img
Which certainly does boot FreeDOS from Grub2, into the image built from the 8M FreeDOS base image, and which I called '1558_A09.img' because that seems to be one of Dell's reference numbers for this model / BIOS version.
So still no BIOS update for Andrew, it seems, and the laptop is probably going to continue to be noisy for some time. Possibly forever.
Suspend/Resume works though. Kernel mode-setting for the ATI Radeon Mobility HD 5450 (or whatever it is) seems to work. Building kernels seems to work. The Blu-ray drive seems to work, at least as far as reading CDs - just because I got a laptop with a "Full HD" screen doesn't mean I watch movies on it: those pixels are for programming on! In any case, after reading the literature of pain about playing Blu-ray disks on Linux I'm convinced that we won't be shelling out to buy one any any time soon.
After a bit more frustration I did manage to get the BIOS installed, using the hack I found here of running the Windows BIOS update under Wine and copying the BIOS file out of the temp directory while the error message is displayed. I could then download a random DOS-installable Phoenix BIOS to get copy of phlash16.exe and put those two files on the FreeDOS image I created earlier. Finally I was able to put that learning about how to boot FreeDOS from Grub2 to good use!
Unfortunately, having jumped through all of those hoops (including the frustration of trying to build and use Dell's firmware-extract tools on a Debian system), the fan continues to grind away at annoying volume, with no way that I have been able to find to control it, and the temperature sensors also seem wrong, since one doesn't budge from 0 and the other doesn't budge from 26800.
During boot I get a bunch of error messages, like:
[ 1.049936] \_SB_.PCI0:_OSC invalid UUID
[ 1.052202] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[ 1.052210] pci 0000:00:1c.0: PME# disabled
[ 1.065228] pci 0000:07:00.2: PME# supported from D0 D1 D2 D3hot D3cold
[ 1.065237] pci 0000:07:00.2: PME# disabled
[ 1.079086] Unable to assume PCIe control: Disabling ASPM
[ 1.086412] HEST: Table is not found!
[ 1.249906] ACPI: Fan [FAN0] (off)
[ 1.249959] ACPI: Fan [FAN1] (off)
[ 1.250093] [Firmware Bug]: ACPI: ACPI brightness control misses _BQC function
[ 1.259118] acpi device:02: registered as cooling_device2
[ 1.262132] thermal LNXTHERM:01: registered as thermal_zone0
[ 1.262139] ACPI: Thermal Zone [TZ00] (27 C)
[ 1.262561] thermal LNXTHERM:02: registered as thermal_zone1
[ 1.262571] ACPI: Thermal Zone [TZ01] (0 C)
[ 1.262598] ERST: Table is not found!
[ 2.769664] i801_smbus 0000:00:1f.3: PCI INT C -> GSI 18 (level, low) -> IRQ 18
[ 2.769670] ACPI: resource 0000:00:1f.3 [io 0x1840-0x185f] conflicts with ACPI
region SMBI [bus 1840-184f pref window disabled]
[ 2.769672] ACPI: If an ACPI driver is available for this device, you should use it
instead of the native driver
I don't yet know what this all means, so I guess I'll be signing up for the linux-acpi mailing list to see if there's anything I can do to get things working better. Any pointers will be gratefully received :-)
Right about now I wonder if maybe I should have gone for the HP or the Asus, even if they were a little heavier and a bit more expensive and next time I get a new laptop I must remember not to spend more than $900 (USD$600) on it.
[Updated: 2010-09-08... Noise Problems Solved
I have been wanting to post for several days already, at least since this last Sunday. I have repeatedly bragged about taking part in the Ciclot n: The last Sunday every month, the city's government closes to automotive transit a ~33Km circuit, for cyclists to enjoy. And by cyclists, I mean people from all expertise ranges Well, the very elite bikers will not take part of such a massive thing, but there are people pedalling a couple of blocks, people taking their small kids to drive a bit, and I recognized an amazingly large proportion of people doing the whole route.
Well, this last Sunday one lap was not enough for me I did two laps, ~65Km.
For some reason, the distance numbers in that map were made... in miles :-P Anyway, the planned route will be:
Some careful readers of Planet OCamlCore should wonder why the OCaml packages in Debian has not yet been upgraded to 3.12.0. For the Planet Debian readers, this is the latest version of the Objective Caml programming language.
The answer is simple: Debian Squeeze froze on 6th August. This means that Debian folks focus on fixing release critical bugs and avoid doing big transitions in unstable (Sid). In particular, the Debian OCaml maintainers has decided to keep OCaml 3.11.2 for Squeeze, because the delay was really too short: OCaml 3.12 was out on 2nd August.
A great work has already been done by S. Glondu and the rest of the Debian OCaml maintainers to spot possible problems. The result was a series of bugs submitted to the Debian BTS. This effort has started quite early and have been updated with various OCaml release candidates.
S. Glondu has also built an unofficial Debian repository of OCaml 3.12.0 packages here.
Let's use it to experiment with OCaml 3.12.0.
schroot setup
Following my last post about schroot and CentOS, we will use a schroot to isolate our installation of unofficial OCaml 3.12.0 packages.
approx
approx is a debian caching proxy server for Debian archive files. It is very effective and simple to setup. It is already on my server (Debian Lenny, approx v3.3.0). I just have to add a single line to create a proxy for ocaml 3.12 packages:
$ echo "ocaml-312 http://ocaml.debian.net/debian/ocaml-3.12.0" >> /etc/approx/approx.conf $ invoke-rc.d approx restartapprox is written in OCaml, if you want to know how I come to it. debootstrap and schroot We create a chroot environment with Debian Sid:
# PROXY = host where approx is installed, debian/ points to official Debian repository of # your choice. $ debootstrap sid sid-amd64-ocaml312 http://PROXY:9999/debianWe create a section for sid-amd64-ocaml312 in /etc/schroot/schroot.conf (Debian Lenny):
[sid-amd64-ocaml312] description=Debian sid/amd64 with OCaml 3.12.0 type=directory location=/srv/chroot/sid-amd64-ocaml312 priority=3 users=XXX root-groups=root run-setup-scripts=true run-exec-scripts=trueReplace XXX by your login. And we install additional softwares:
$ schroot -c sid-amd64-ocaml312 apt-get update $ schroot -c sid-amd64-ocaml312 apt-get install vim-nox sudoOCaml 3.12 packages Now we can start the setup to access OCaml 3.12.0 packages. The repository is signed by S. Glondu GPG key (see here). We need to get it and inject it into apt:
$ gpg --recv-key 49881AD3 gpg: requ te de la cl 49881AD3 du serveur hkp keys.gnupg.net gpg: cl 49881AD3: St phane Glondu <steph@glondu.net> n'a pas chang gpg: Quantit totale trait e: 1 gpg: inchang e: 1 $ gpg -a --export 49881AD3 > glondu.gpg $ schroot -c sid-amd64-ocaml312 apt-key add glondu.gpgThe following part is done in the schroot:
$ schroot -c sid-amd64-ocaml312
# PROXY = host where approx is installed
(sid-amd64-ocaml312)$ echo "deb http://PROXY:9999/ocaml-312 sid main" >> /etc/apt/sources.list
(sid-amd64-ocaml312)$ cat <<EOF >> /etc/apt/preferences
Package: *
Pin: release l=ocaml
Pin-Priority: 1001
EOF
(sid-amd64-ocaml312)$ apt-get update
...
(sid-amd64-ocaml312)$ apt-cache policy ocaml
Install : (aucun)
Candidat : 3.12.0-1~38
Table de version :
3.12.0-1~38 0
1001 http://atto/ocaml-312/ sid/main amd64 Packages
3.11.2-1 0
500 http://atto/debian/ sid/main amd64 Packages
(sid-amd64-ocaml312)$ apt-get install ocaml-nox libtype-conv-camlp4-dev libounit-ocaml-dev...That's it. The apt-policy command shows that OCaml 3.12 for the ocaml-312 repository has an higher priority for installation. Good luck playing with OCaml 3.12.0.
Two weeks ago, Maria and I completed
one of our dreams
when we arrived in Cap de Creus, where the Pyrenean range sinks in the
Mediterranean. To get there, we walked hundreds of kilometres during a month,
crossed dozens of steep valleys and enjoyed one of the richest experiences
of our lives.
We managed to complete this challenge without facing major problems or
pains, and after the first five our six days, our legs seemed to have
gotten used to the daily effort and it started to be easier and easier.
Our morale kept growing as days passed and we advanced east. When I
started walking on a cold and rainy morning in Hondarribia, after barely
no rest in the night bus to Ir n, I thought for myself that it was
improbable that we'd manage to get anywhere near Catalunya, that one of
us would get injuried way before, or we'd just give up and go for the easy
beach vacation in the Basque Country.

Biad s refuge, under Posets
But we didn't, and after a somewhat painful start, with our boots soaking
wet during the stages that crossed the enchanting Selva de Irati
which ended up with me getting the biggest blister I've ever seen, we
started to walk farther every day, extending the stages when we
felt strong after reaching their official end. When we crossed from
Nafarroa to Aragonese territory, the mental wall that I had built over the
toughest stages in our quest started to fall apart. Days later, we found
ourselves climbing down to Pineta, leaving Ordesa behind and enjoying a
feeling that our adventure could not go better. The weather had been
perfect for over a week and our legs and back were strong to go all over
the way to the sea.

Ca n de A isclo, on our way to Pineta
When we finally saw that huge blue stain on the horizon, the day before
getting to the last mark, we got really excited. We had made it, but as we
walked towards the cape, happiness slowly got mixed with melancholy. An
unforgettable adventure was about to end, and we didn't want to face our
return to the city and our routines. It had been many days surrounded only by
awesome landscapes, and living without watches, with only sunlight and
weariness marking the time to get in our sleeping bags.

At the very last red and white mark of our journey
We've had plenty of time to meet great people. Starting with
the Navarrian brothers we met in the early stage, which provided us with a
good pace to follow while our leg muscles were still building up; or Kike
and Ana, who drove from Pamplona to visit us during the first Aragonese
stages (thanks for the supplies!). Tom s and Roger, young hikers from
Matar , surprised us with their maturity and experience as mountaineers;
we had the pleasure to join forces during four days, walking a really cool
variant through the Infiernos and Collado del Letrero
which avoided going through the ghost city of Panticosa. Roger and Tom s,
we really hope to meet you soon! Andreu, Manel, Ghandi and Ga la visited us
at the Vall de N ria and were unlucky to suffer a frightening
hail and thunder storm when they left our shelter on their way back to
their car. Thanks! All of you have been a very special part of our
experience!
This adventure through GR 11 has been incredibly positive for us for
several reasons. We've learned a lot about ourselves and strengthened our
relation, and now I know how powerful drive can be; to get somewhere, no
matter how far, it's really easy if you just believe you can do it and
desire to get there.
Maria and I are proud of what we've done, and no wonder we're looking
for new challenges. An obvious one would be repeating this experience,
going through the French side of the Pyrenees, but for now, the Corsican
GR 20 seems the most appealing. We'll see, next summer!
Next.