Search Results: "reg"

14 May 2010

Matthew Garrett: Using qemu to instrument Windows

Part of the problem that we face in providing Linux hardware support is that we're lucky if there's a spec, and even if there's a spec there almost certainly isn't a test suite. Linux still isn't high on the list of things that vendors test with, so as a result hardware and firmware tend to be written to work with Windows rather than some more ideal notion of what a spec actually says.

This can lead to all kinds of problems. If the spec says we can do something and Windows never does that, we'll often find that there's at least one piece of hardware out there somewhere that breaks in response. But sometimes there'll be several different workarounds, and picking the wrong one may break some other system instead. It's helpful to know what Windows is actually doing, if only because that's the only configuration most systems have been tested with.

The problem is that doing this at the hardware level is next to impossible. I'm sure there are people out there who salivate at the possibility of working out i8042 initialisation sequences by hooking up oscilloscopes to their mouse, but I'm not one of them. There's a much easier alternative involving qemu.

The qemu source base is reasonably large and complex, but that's ok - we don't need to care about most of it. For our purposes we really only want to trace accesses to given bits of hardware. There's three main types of hardware access we're likely to care about: io ports, memory mapped io and pci configuration space. io ports are easy. Each piece of qemu that performs hardware emulation will call register_ioport_read or register_ioport_write. Just grep for those, find the ports that correspond to your hardware and then edit the functions to dump the information you want. PCI configuration space will be handled via pci_default_read_config or pci_default_write_config unless the driver overrides them. Finally, for PCI devices mmio will be handled via pci_register_bar - the last argument is the function called when the memory region is accessed.

All of which makes it pretty easy to watch register reads and writes performed by Windows when it's starting up. Suspend/resume is also an interesting problem, but sadly one that's harder to work with. First of all, you need at least version 0.6c of vgabios in order to indicate to Windows that it's possible to suspend at all. Secondly, for Vista or later you'll also need a WDDM driver for the graphics. Sadly there isn't one for the Cirrus that qemu emulates, which is unsurprising given how ancient it is. So I've had to perform my testing under XP, which was enough to give me an indication as to what Windows does with the SCI_EN bit on resume (answer: Ignores both the bit of the spec that says it should already be enabled and the bit of the spec that says it should never be written by hand). Nice, but if someone would like to write a WDDM driver for Cirrus it'd make my life easier.

The other thing I've been testing is keyboard controller probing. Some Macs deal badly with you banging on the keyboard controller, which is dumb but on the other hand they don't claim to have one. Linux will look at your ACPI tables and use any keyboard controllers it finds there, but if there isn't one it'll go on to try probing the legacy locations. Adding some debug code to the read and write functions of the keyboard driver in qemu and then editing the DSDT in Seabios to remove the declarations for the keyboard showed that Windows will only probe if there's a device with a recognised keyboard PNP ID. No keyboard for you if that's missing. So we probably need to emulate that behaviour as well.

The main reason to do this work is to try to reduce the number of DMI tables in the kernel. These are cases where we alter the kernel's behaviour based on the identity string of the hardware, allowing us to work around functional differences. The problem with this approach is that Windows generally works fine on these machines without knowing anything special about them, and chances are that the tables aren't exhaustive - there may well be some other piece of hardware that's also broken, but the user just gave up and went back to Windows instead of ever letting us know. Using qemu to work out how Windows actually behaves gives us the opportunity to fix things up in a way that will (with luck) work on all machines.

13 May 2010

Aigars Mahinovs: Hacker Neo caught in Latvia

A scandal has been brewing in Latvia over the last half year and yesterday the activity spiked shocking the media and some IT people in the country. I ll go back and explain what happened first, what is happening now and why this could have a heavy impact on IT and journalists in Latvia. At the end of last year, there were rumours that the IT system of Latvia s Internal Revenue System was hacked and millions of documents had been downloaded by multiple organizations. Shortly thereafter more details on the glaring security hole became public (after it was closed). There is a full electronic interface to give all reports to the IRS electronically (at http://eds.vid.gov.lv) and as part of that system you could also view and export monthly report summaries about your organization into XML and PDF files. After the system checked that you are authorized to access the report, you were redirected to the URL to actually download the report by report ID (as a single param in a GET request). Unfortunately, report IDs were predicable and the script that gave the reports for download did not check if you were authorized to get that report. It did not even check if were logged into the system. There were suspicions that the authorization was disabled on purpose to allow to leak data on purpose, but apparently it was an error of forgetting to disable debug code in production environment. The error was discovered only because the firewall administrator noticed an unexplained stable increase of traffic, especially during night hours when typically the traffic fully stopped. Apparently a single hacker (who later identified himself as Neo to the press) discovered the flaw and wrote a script to just try all possible report ids and get as much data out as possible. This had been going on for months, before someone noticed. After the flaw was discovered and a bit of time passed, Neo made his first move he published the list of top salaries in a governmental company, that clearly showed that the top leadership of this company failed to cut their salary by 40%, like everyone elses during harsh budget cuts of 2009. He stripped the names and ids of the specific employees, but named the company which made it pretty easy to figure out who was who. The society was outraged that the top managers in a government owned company failed to comply with the strict pay cut that everyone else in government had to endure. But after a few weeks the outrage subsided and no action followed from the government or law enforcement. Neo continued to release documents detailing salaries of top managers in different Latvian government companies. And each time after short outrage, nothing happened. Neo gave an interview where he said that he was disappointed in the passivity of the Latvian people in face of such blatant injustices. After a few month Neo went silent, promising to return before parliamentary elections this fall. However, this week a new development shocked everyone in the middle of the night two police SWAT teams went into action: one detained Ilm rs Poik ns, a researcher in artificial intelligence at the University of Latvia s Computer Science department and another raided the home of a Latvian TV journalist Ilze Nagle who interviewed Neo. Poik ns confessed of being Neo the next day and was released (with travel restrictions, pending trial) today. Politicians reacted immediately opposition demanded the resignation of the Interior Minister over such blatant disregard of freedom of press and another politician (who is also a famous lawyer) Aleksejs Loskutovs volunteered to defend Neo pro-bono (on Twitter, no less). Almost all Latvian online media have the arrest of Neo and the raid on the home of a journalist as main stories of the day. As a legal titbit, we also know that Neo is being charged with breaking statutes 145 and and 244p2 of the criminal law. Statute 145 is hard to find applicable in this situation as talks about actions done by people authorized (..) to access [private] information . Statute 244p2 will also be hard to pin down as it mentions influencing system resources of (an IT system) and if such action caused severe harm . It looks like the first part talks about at least a DoS attack (which did not happen in this case) and also there was no measurable harm from these leaks. Also Neo was careful to strip all personally identifying information (such as names, social security numbers and addresses of the employees in question), so it will be hard to pin him on that. Also no actual breaking or other modification of an IT system occurred. And no specialized software was used beyond a trivial script such as :
for i in range(0,7000000):
    wget('https://eds.vid.gov.lv/getRep.aspx?id='+str(i))
A lot of commentators on the Internet likened the situation to walking trough an unlocked door and stealing something. I think that analogy is very incorrect there was no door, and nothing went missing after the action. I came up with a different analogy there was this corridor with a lot of doors in IRS, locked steel doors. You were instructed to go to a room with a specified number and given a key to that room to unlock it and see your secret info. However, that corridor opened out to the street on one end, oh and also the walls of the rooms with all the secrets were transparent. So Neo walked into the corridor, looked at some of the secrets, wrote them down (to remember them better) and then went out and discussed the worst examples abuses of power he saw. In the end IRS had to learn their lesson if you have to put naked photos of yourself on the Internet (or something equally embarrassing), then make damn sure you password protect that, but if you don t then don t cry that someone hacked you and stole you pictures. What other people think:
http://freespeechlatvia.blogspot.com/2010/05/neo-released-under-restrictions.html We ll see how the story develops soon.

Petter Reinholdtsen: systemd, an interesting alternative to upstart

The last few days a new boot system called systemd has been introduced to the free software world. I have not yet had time to play around with it, but it seem to be a very interesting alternative to upstart, and might prove to be a good alternative for Debian when we are able to switch to an event based boot system. Tollef is in the process of getting systemd into Debian, and I look forward to seeing how well it work. I like the fact that systemd handles init.d scripts with dependency information natively, allowing them to run in parallel where upstart at the moment do not. Unfortunately do systemd have the same problem as upstart regarding platform support. It only work on recent Linux kernels, and also need some new kernel features enabled to function properly. This means kFreeBSD and Hurd ports of Debian will need a port or a different boot system. Not sure how that will be handled if systemd proves to be the way forward. In the mean time, based on the input on debian-devel@ regarding parallel booting in Debian, I have decided to enable full parallel booting as the default in Debian as soon as possible (probably this weekend or early next week), to see if there are any remaining serious bugs in the init.d dependencies. A new version of the sysvinit package implementing this change is already in experimental. If all go well, Squeeze will be released with parallel booting enabled by default.

11 May 2010

MJ Ray: TravelWatch SouthWest General Meeting

Weeks ago, I was at a TravelWatchSW meeting in Taunton for Cooperatives-SW. The Chair s theme for the meeting was the journey was going so well, but is there trouble ahead? contemplating cuts due to the debt crisis and possible change of government. Lots of good people were present, so it was quite an illuminating meeting. First, we listened to Dr Gabriel Scally, Director of Public Health for the South West NHS, as he spoke on fat, exercise and transport He s a keen cyclist, so I asked for suggestions of how to get better parking at health centres and hospitals. Sadly, he had no easy answer. One tip: Primary Care Trusts control most money, so they re probably the best ones to persuade. The second keynote address was First Great Western s Projects and Planning Director Matthew Golton. He spoke about railway development, unsurprisingly. Rail is vital for co-operatives in the South West, as it s a greener way to travel the 250 miles length of this peninsula and avoids our poor congested roads. The big news is that class 150s (Sprinters) will replace the Exeter area 142s (Pacers/Railbuses) and there will be grade-seperated junctions at Reading by 2016 to reduce congestion between the various routes that converge at that point. There s bad news on the Intercity Express Programme and HST2 being delayed until after the election, but the original High Speed Train fleet should continue as reliably as ever. After lunch, there were a series of Just a minute comments on topics including: west country commuter services, staffing, Taunton nhs parking, axminster peak times, a TransWilts meeting. Finally before the reports and forum came the third and final keynote from Mike Lambden, head of corporate affairs for National Express Group. He outlined their plans including longer coaches, but asked for better coach stations. One strange mistake had been increasing the leg room on some coaches so much that they got complaints from shorter passengers that they couldn t reach the footrest any more oops! The forum was a scary discussion of rail under-provision planned in our region. Even if we only continue to grow rail use at the last decade s rates, overcrowding will increase. The forum ended with applause for all the hard work done by TWSW and the next meetings will be 9 October 2010 in Taunton, 5 March 2011, 1 October 2011.

Andrew Pollock: [life] One week later

Zoe's a week old today. As such things tend to do, this feels like both an eternity and no time at all. We've been back to the paediatrician twice since I last blogged. Zoe's weight is now on the increase again. Today she weighed in at 6 lbs 3 oz (2806 grams) (I think. My brain has gone a bit fuzzy) We're largely sticking with bottle feeding pumped breast milk for now. Apparently 7 lbs is the magic size where they've got enough strength to feed exclusively at the breast. Sleep-wise, I think we're all doing reasonably well. Zoe just eats, sleeps and poops. Sometimes we need to wake her up to have a feed. I think the longest we've let her got is 4.5 hours. She's taking a lot of milk at each feeding session - up to 90 mL, so I expect that she'll have blasted past her birth weight by the time she's two weeks old. It'll be good when she's exclusively breastfeeding. The current regime is a little bit tiring. Zoe wakes up (or gets woken up). I change her diaper and give her a bottle. Sarah tries a little bit of breastfeeding. I put Zoe back in her crib. Sarah pumps some milk for the next feeding session, and I go and wash and sterilise bottles and pumping paraphernalia. If Zoe's feeding every three hours, this only really gives us two hours to get anything else done. Not that I'm complaining, mind you. At the paediatrician's this morning, there was another father with the same LPCH diaper bag that we'd received while we were in the hospital. Turned out he had a two-week old boy. I asked how the sleep levels were going, and he exclaimed about how they were only getting 2.5 hours at a time, and his son would raise the roof. I mentioned the 4.5 hour stint that we'd managed to have, and he was totally gobsmacked. In other news, it seems like Sarah has a bit of UTI, which has totally wiped her out this afternoon. She got a 3 day course of antibiotics this afternoon, so hopefully that'll fix her up. Zoe at 6 days of age

10 May 2010

Romain Beauxis: Ubuntu, the firm and its employees

This post is not meant to be offensive in any way. I would just like to write down things that came to my mind recently. It all started when I was considering applying for the right to upload the package I maintain into Ubuntu. Looking at the procedure, I realized that this needs to be present during an IRC meeting at a given date online. This stopped me immediately. I am working most of my day-time and, given the time zone I am living now, this was not an option. But, since I had registered to the corresponding mailing list, I started receiving mails of other applicants that where trying to arrange things with their work and private life to be able to participate. Now, today, I stumbled upon these notes of Mark's presentation in Bruxelles, relayed by a friend that is not either working for Ubuntu. Reading it gave me a strong taste of management-oriented presentation, with all this sort of "yeah we want our product in every box next year" propaganda. Not like Steve Ballmer, fortunately, but not far perhaps. So, yeah, there is something that makes me uncomfortable with Ubuntu. I am really happy by its success and I will continue to recommend it to friends around me. However, I wonder if, in a way, Ubuntu is not a model of commercial company where a minimal core of developers are actually payed, while a second layer of developers are fan-boys that are willing to participate as if there were employees but without being actually payed, and a third layer being the open-source developers whose work is actually what makes 90% of the core of the OS. A very good illustration is at the end of the note from Mark's presentation. It reads:
Somebody asks about advertising Ubuntu, looks like there are no plans for the moment to actually advertise Ubuntu across traditional media. Mark uses the Ubuntu Manual as an example of how Ubuntu gets advertised and will reach the mainstream, Mark points out myself and the room applauds the Ubuntu Manual Project! Woohoo!
Now, guess what:
About Us We are a group of individuals trying to promote the use of Ubuntu and its variants. This is a private web site that is not connected in any official or financial way with Ubuntu, Canonical PL or Ubuntu.com. Official Ubuntu guides and downloads are freely available at www.ubuntu.com. Ubuntu is a registered trademark of Canonical PL
Source: http://ubuntumanual.org/about-us

9 May 2010

Gregor Herrmann: RC bugs 2010/17, 2010/18

the usual short overview about my RC bug activities: luckily the count of RC bugs is going down; but some more people tackling the remaining ones would be great!

Gunnar Wolf: You will not be renumbered

I woke up with a loud BZZZT It happens every couple of years. The electric transformer for the circuit where my house is located, at the Northern edge of Ciudad Universitaria, decided to die (or at least, to take a break literally). About one hour later, I decided it was time to wake up and start being a useful person. I gave breakfast to my cats and had breakfast myself, and called the electrical company to report this mishap. They told me the report was registered, and I hope to have electricity soon (meanwhile, I'm sitting at a nearby restaurant, as there is some job to do Yes, besides writing blog entries). And they told me, as is often told in Mexico, a general anticorruption phrase With a twist: recuerde que usted no debe renumerar ning n servicio que realice el personal de la Comisi n Federal de Electricidad . (You should not renumber any service done by the Federal Electrical Commission personnel). Yes, remunerado (not renumerado). This shows once again the power of asking people to read things they don't understand.

Robert Collins: Maintainable pyunit test suites

There s a test code maintenance issue I ve been grappling with, and watching others grapple with for a while now. I ve blogged about some infrastructural things related to it before, but now I think its time to talk about the problem itself. The problem shows up as soon as you start writing setUp functions, or custom assertThing functions. And the problem is where do you put this code?
If you have a single TestCase, its easy. But as soon as you have two test classes it becomes more difficult. If you choose either class, the other class cannot use your setUp or assertion code. If you create a base class for your tests and put the code there you end up with a huge base class, and every test paying the total overhead of your test needs, rather than just the overhead needed to test the particular system you want to test. Or with a large and growing list of assertions most of which are irrelevant for most tests.
The reason the choices have to be made is because test code is just code; and all the normal issues there separation of concerns, composition often being better than inheritance, do-one-thing-well all apply to our test code. These issues are exacerbated by pyunit (that is the Python unittest module included with the standard library and extended by various projects)
Lets look some (some) of the concerns involved in a test environment: Test execution, fixture management, outcome decision making. I m using slightly abstract terms here because I don t want to bind the discussion down to an existing implementation. However the down side is that I need to define these terms a little.
Test execution by this I mean the basic machinery of running a single test: the test framework calling into user code and receiving back an outcome with details. E.g. in pyunit your test_method() code is called, success is determined by it returning successfully, and other outcomes by raising specific exceptions. Other languages without exceptions might do this returning an outcome object, or passing some object into the user code to be called by the test.
Fixture management the non trivial code that prepares a situation where you can make assertions. On the small side, creating a few object instances and glueing them together, on the large end, loading data into a database (and creating the database instance at the same time). Isolation issues such as masking out environment variables and creating temp directories are included in this category in my opinion.
Outcome decision making possibly the most obtuse label I ve ever given this, I m referring the process of deciding *what* outcome you wish to have happen. This takes different forms depending on your testing framework. For instance, in Python s doctest:
>>> x
45
provides a specification the test framework calls str(x) and then compares that to the string 45 . In pyunit assertions are typically used:
self.assertEqual(45, x)
Will call 45 == x and if the result is not True, raise an exception indicating a Failure has occured. Unexpected exceptions cause Errors, and in the most recent pyunit, and some extensions, other exceptions can signal that a test should not be run, or should have failed.
So, those are the three concerns that we have when testing; where should each be expressed (in pyunit)? Pragmatically the test execution code is the hardest to separate out: Its partly outside of user control , in that the contract is with the test framework. So lets start by saying that this core facility, which we should very rarely need to change, should be in TestCase.
That leaves fixture management and outcome decision making. Lets tackle decision making if you consider the earlier doctest and assertion examples, I think its fairly clear that there are multiple discrete components at play. Two in particular I d like to highlight are: matching and signalling. In the doctest example the matching is done by string matching the reference object(s) are stringified and compared to an example the test writer provides. In the pyunit example the matching is done by the __eq__ protocol. The signalling in the doctest example is done inside the test framework (so we don t see any evidence of it at all). In the pyunit example the signalling is done by the assertion method calling self.fail(), that being the defined contract for causing a failure. Now for a more complex example: testing a float. In doctest:
>>> %0.3f % x
0.123
In pyunit:
self.assertAlmostEqual(0.123, x, places=3)
This very simple check that a floating point number is effectively 0.123 exposes two problems immediately. The first, in doctest, is that literal string comparisons are extremely limited. A regex or other language would be much more powerful (and there are some extensions to doctest; the point remains though the operator is not enough). The second problem is in pyunit. It is that the contract of assertEqual and assertAlmostEqual are different: you cannot substitute one in where the other was expected without partial function application something that while powerful is not the most obvious thing to reach for, or to read in code. The JUnit folk came up with a nice way to address this: they decoupled /matching/ and /deciding/ with a new assertion called assertThat and a language for matching expressed as classes. The initial matcher library, hamcrest, is pretty ugly in Python; I don t use it because it tries too hard to be english like rather than being honest about being code. (Aside, what would is_() in a python library mean to you? Unless you ve read the hamcrest code, or are not a Python programmer, you ll probably get it wrong. However the concept is totally sound. So, outcome decision making should be done by using a matching language totally seperate from testing, and a small bit of glue for your test framework. In testtools that glue is assertThat , and the matching language is a narrow Matcher contract (in testtools.matchers) which I m going to describe here, in case you cannot or don t want to use the testtools one.
class Matcher:
    def __str__(self):
        "Describe this matcher."""
    def match(self, something):
        """Determine if something is matched.
        :param something: Something to match.
        :return: None if something matched, or a Mismatch object otherwise.
        """
class Mismatch:
    def describe(self):
        """Describe a mismatch that has occured."""
This permits composition and inheritance within your matching code in a pretty clean way. Using == only permits this if you can simultaneously define an __eq__ for your objects that matches with arbitrarily sensitivity (e.g. you might not want to be examining the process_id value for a process a test ran, but do want to check other fields).
Now for fixture management. This one is pretty simple really: stop using setUp (and other similar on-TestCase methods). If you use them, you will end up with a hierarchy like this:
BaseTestCase1
 +TestCase1
 +TestCase2
 +BaseTestCase2
   +TestCase3
   +TestCase4
   +BaseTestCase3
     +TestCase5
     ...
That is, you ll have a tree of base classes, and hanging off them actual test cases. Instead, write on your base TestCase a single glue method e.g.
def useFixture(self, fixture):
      fixture.setUp()
      self.addCleanup(fixture.tearDown)
      return fixture
And then rather than having a setUp function which performs complex operations, define a fixture an object with a setUp and a tearDown method. Use this in tests that need that code::
def test_foo(self):
      server = self.useFixture(NewServerWithUsers())
      self.assertThat(server, HasUser('fred'))
Note that there are some things around that offer this sort of convention already: thats all it is convention. Pick one, and run with it. But please don t use setUp; it was a conflated idea in the first place and is a concrete problem. Something like testresources or testscenarios may fit your needs if it does, great! However they are not the last word they aren t convenient enough to replace just calling a simple helper like I ve presented here.
To conclude, the short story is:
  • use assertThat and have a seperate hierarchy of composable matchers
  • use or create a fixture/resouce framework rather than setUp/tearDown
  • any old TestCase that has the outcomes you want should do at this point (but I love testtools).

7 May 2010

David Welton: Better Software 2010

Florence, Italy, is an extremely popular tourist destination, and for a good reason: it's absolutely full of beautiful architecture and famous art. It apparently gets more than a million tourists a year. So it felt kind of odd for me, as a foreigner, to hole up in a conference talking about computers, software and business within a stone's throw of this. It was well worth it though. "Better Software" was a very interesting conference, and extremely professional. One anecdote: since there were so many people signed up, they did the lunch and coffee breaks in another facility nearby, about a block away. However, the weather wasn't very nice, so the organizers rounded up a bunch of umbrellas, and put them near the door with a sign saying "take one if you need it", so that people could stay dry while going back and forth. Of course, having grown up in Oregon, I don't trust the weather much, and carry an umbrella, but it was a really nice gesture and attention to detail. I expected it to be good, but it ended up being a really great event. Some memorable bits: I suppose that, given the huge success of the event this year, they may look for a larger facility for future events, but I hope it doesn't end up in some soulless place in the suburbs; even if I didn't do any sightseeing, I liked being in the city center. While the organizers would be more than capable of putting on a more international event, I enjoyed the focus on Italy, and the cool things people are doing here, and I feel it also contributed some to the positive atmosphere. It's one thing to have some guy come in from abroad and tell you something, another to see someone like Peldi talk about how he did what he did. And what with all the problems Italy has right now, some "positive energy" was more than welcome. Like I said, Italy has a lot of really talented people; the problems lie elsewhere. A big thanks to the organizers and everyone who came, and I hope to see you there next year.

Andrew Pollock: [life] And we're home

It took longer than expected, but we were finally discharged from the hospital early this afternoon. There was some concern about jaundice in Zoe, so the hospital paediatrician ordered a bilirubin blood test, which we had to wait for the results from. It came back fine though. The other concern was weight loss. She's still hovering around the 5 lbs 13 oz mark, which is at some magical 10% of birth weight lost, which seems to cause some concern for the doctors. So for the next week or so, we're going to bottle feed her breast milk, as she seems very sleepy when she tries to nurse, and we want to make sure she's getting enough. It's nice to be able to more actively participate in the feeding routine. Since we've been home, Zoe's not been sleeping terribly well on her own, so right now her and Sarah are having a nap together. We've got our first appointment with Zoe's ongoing paediatrician tomorrow. She was the recommendation of a friend, and seems to be highly regarded by all of the hospital paediatricians we saw. I'm feeling very disorganised in the nursery, because I didn't really participate in any of the set up of it. I knew where everything was in the hospital, so for a diaper change, everything was under control. I'm going to have to get a couple of totes tomorrow, so everything is on hand. I may also go berserk with a label maker. Looking forward to a hot shower and some shut-eye after this next feeding.

6 May 2010

Aigars Mahinovs: Going to Debconf10!

After a few months, today I finally got the approval and As I work for Accenture now, I got them to pay for the plane tickets and also spring for the Professional registration, so more people can attend. I am very happy, and very grateful to the company and to the managers here in Riga office for being so very supportive. It is refreshing to see that even a large corporation can be quite nimble. I hope I can get on a direct Riga New York flight (there actually is one, once a week, by Uzbekistan Airways) which would be a wicked cool way to save travel time and worries. This might even be faster end-to-end than last year going to Spain (via Frankfurt). Now I only need to replace my passport with the new biometric one, to qualify for USA Visa Waiver and I ll be good to go :)

Andrew Pollock: [life] Going home today

The OB resident dropped by on her rounds this morning and asked if Sarah wanted to go home today or tomorrow. There was some brief indecision regarding stairs, but Sarah has decided to go home today. We only stayed 3 nights in hospital after Joshua's C-section as well. So the staples have been removed, and we're getting discharged at about 11am.

Andrew Pollock: [life] Crazy few days

Here's why: Zoe's birth Zoe Dianne Pollock was born at 12:30pm PDT, at Lucile Packard Children's Hospital, via Caesarean-section. Her birth weight was 2920 grams (6 lbs, 7 oz) and she's 49.5 centimetres (19.5 inches) long. As for why she was born 11 days early than her previously scheduled early arrival... Monday morning started off like any other normal Monday morning. I got up at 6am to go to the gym with Dan. I got home at around 8am. I asked Sarah if she'd felt any baby movement, and she said she hadn't. Even after some jiggling and a cold glass of orange juice, there was nothing. Not wanting a repeat performance of what happened last time, we wasted no time in heading to Labour and Delivery to get things checked out. When we were nearly at the hospital, Sarah felt some small movement, so that was a relief. When we got to the hospital, they performed a non-stress test as they have previously. They spent a good couple of hours with Sarah hooked up to the monitor, and then the on-call obstetrician asked us how we'd feel about just having the baby today. I asked if there was anything particularly concerning about the NST, and the OB said that she (the baby) was doing marvelously now, but was "less than marvelous" when we first came in. I haven't had a chance since to ask her if there was anything untoward observed during the delivery. Anyway, she (the on call OB) said that rather than have Sarah get stressed out for the following 11 days, she'd talked with our regular OB, and they felt that since she was at 37 weeks (and considered "full term") that it was okay to deliver at that point. At the end of the conversation, it was upgraded to a recommendation, rather than an option. So so much for an attempt at VBAC. We got to the hospital at around 9am, and I think they/we made the decision to deliver at about 10:30am. I had enough time to race home and grab the camera and race back again, and the next thing I knew we were all in the operating room, and Zoe was being delivered. It was amazing getting to see the "extraction". They dropped down the sheet that was blocking our view of the action right at the end, and I got to see (and photograph) Zoe's head and whole body being pulled out. She gave out a little cry, and Sarah and I totally lost it with relief. Things were a bit of a blur after that. I got to come over and meet Zoe while they were weighing her and measuring her, and then they bundled her up and let me take her back to Sarah's head-end on the operating table, so Sarah could get a look at her. Sarah handled this C-section better than last time. She didn't get any nausea, but she still got the itching and involuntary shivering, courtesy of the morphine. While they were still putting Sarah's insides back in, Zoe and I went to the nursery, where they put her under a heater for a little while to warm her up a bit. Then it was back to the recovery room to have a proper meeting with Sarah. Once Sarah was ready to move to the maternity ward, Zoe and I again returned to the nursery, where she got her first bath, had her umbilical cord trimmed some more, and her anti-theft device fitted to her umbilical cord clamp. Then it was off to the maternity ward. I think we were all in the maternity ward by 3pm. After a little while, we managed to get bumped to a private room, which was a lot better than the shared room (the other bed was vacant, but just having more space made a big difference), and that's where we've been ever since. I've stayed each night on the roll away bed, helping out with diaper (sorry Aussies, I've been here too long, and dealt with too many babies, I never think of them as "nappies" any more) changes, and burping and other miscellaneous tasks. Monday night was okay. Tuesday was a bit rough. Sarah didn't get any sleep on Monday night, and the anaesthesia totally wore off and she was in a fair bit of pain. She slept better on Tuesday night, and today, the breastfeeding has been going well, and the post-operative pain is well and truly under control. She's lost a bit of weight since delivery (as is to be expected). She was down to 5 lbs 14 oz (2664 grams) at last night's weigh-in, and at tonight's weigh-in she came in at 5 lbs 13 oz (2636 grams). So the weight loss is starting to plateau. We're already supplementing the breastfeeding with syringes of colostrum/milk that Sarah's pumped previously, so I hope the weight loss will have turned around by tomorrow night's weigh-in. The breastfeeding in general is going pretty well as of today. Mum and bub have both mastered the latch. I think it's just a matter of Sarah's milk coming in now. I've brought forward my 7 weeks paternity leave (an excellent benefit Google offers) to start as of Zoe's delivery. Sarah's Mum arrives on the 19th for 4 weeks, which will be great. We expect to be discharged from hospital on Friday. Luckily we were pretty much all ready for this happening a little bit earlier. We had our last baby classes on the weekend. The nursery is ready enough to bring a baby home to, so aside from Sarah's Mum being disappointed that Zoe's going to be a bit older when she first gets to see her, we're all good. The WiFi in the hospital is great. We've already Skyped with both grandmothers and they've had a chance to see Zoe. We've had a steady trickle of visitors, and the whole baby routine is making the time go pretty quickly.

Russ Allbery: git-pbuilder 1.10

This is a minor update of the glue script that I use between git-buildpackage and pbuilder (with cowbuilder). The primary feature it has over other versions of a similar script is that one can set an environment variable to specify the chroot in which to build. This update changes the -i regex to include all of the Git-relevant parts of the standard dpkg-source exclusion regex. Before, the regex tried to exclude only .git directories, but also used insufficient quoting and ended up excluding any file containing git. That should be fixed, and now it should exclude .gitattributes files as well. Thanks to Allard Hoeve for the bug report. You can get the latest version from my miscellaneous scripts page.

4 May 2010

Erich Schubert: Facebook tracking users via "like" function.

Facebook recently launched the "Like" function, which basically can be embedded into arbitrary web sites. Naively, it does two things:
  1. Provide a "Like" button for sharing the web site
  2. Show you how many other users like the web site
Sounds good, doesn't it?But now reconsider: even when you don't use the "Like" function, facebook is in fact notified of which web sites you visit!.Encouraging you to "share" content with friends is the hanger for this function. This is what makes web masters install it on their sites: they expect to get some extra traffic from your friends, so they just add it.But whether you like it or not, it basically allows Facebook to track your complete web viewing habits. And it's the target web site that opts in, not the user! Combined with all the personal information Facebook already has on you, this is a major privacy concern. Combining this information might even be illegal in some countries (but probably not in the US where Facebook lives, privacy unfortunately has a low role here).The best workaround currently is to blacklist Facebooks "Like" function using some kind of AdBlock, for example using this element filter:
IFRAME[src^="http://www.facebook.com/plugins/like.php"]
But in general, we should try to make this kind of data aggregation illegal without explicit consent and force Facebook to make this an opt-in feature. Political work needed here ...P.S.: Make sure to check if your AdBlock actually blocks and not just hides. As far as I can tell, WebKit Adblock, including Chromes, only hide ads. Firefoxs AdblockPlus seems to be more powerful.P.P.S.: yes I've read the claim that Facebook doesn't track. No wait, all they basically said was that they are not going to announce at F8 they will be selling web surfing behaviour based ads to their customers. They actually did NOT state (or guarantee) they will NOT use data mining on this data. Just that you probably will not be able to buy eyeballs based on rules such as "has visited/liked disney.com" ...P.P.P.S.: I've been told that facebook.com/widgets/like.php also needs to be blocked, since some sites use this URI scheme. And of course, Privoxy and similar privacy-increasing proxies are a useful addition, too.

Wouter Verhelst: On clue and opinions

How does one define one's "national identity"? One way is to look at where a person is born. By that definion, I could be called Flemish, Belgian, or European, whatever you think about it. Another way to look at it is how one feels about one's own identity. This, of course, is a much more accurate way to describe a person; and by that definition, I am either Belgian or European. I do not feel any affinity with much of the so-called "flemish" identity, nor do I wish to be associated with it any more than is strictly necessary. Obviously, some people feel different about that for themselves. This I can understand. In fact, the statement to feel more Belgian than Flemish is probably not one that is very common in this general area. I am not stupid; I know that Belgium is not a Nation (it is a state, but that is a different matter). I just do not feel a lot of warm fuzzy feelings about Flanders. Naturally, other people have other feelings about that. This, too, I can understand. The logical result of the above is that my personal opinions about the somewhat convoluted politics in this country are not shared by many; that when I state my opinion, I may expect opposition, or at the very least someone stating why they disagree with me. This, of course, I can also understand. But what I cannot understand is that every time I state my opinion, someone must come out and insult my intelligence by telling me I "do not have a clue". Please do not mistake my disagreement for misunderstanding. Martijn asks me to "check the facts". Let's do that, shall we?
  1. There's been a judgement by the constitutional court that the current situation regarding which party may run for election in the BHV region is unconstitutional.
  2. One group of politicians wishes to resolve this issue by splitting the BHV region in two. That would certainly solve the issue.
  3. Another group of politicians dislikes this solution. They may be willing to go along, but they want other concessions before they will do so. This is what I referred to when I said that there were "a huge heap of all kinds of side issues" in my previous post.
  4. The first group does not wish to make such concessions. Some of their numbers have even stated in the press that there is no need to make them, because, given the first point, there's only one solution and that is to split.
That last point is, of course, complete and utter bullshit. It would hold merit if there was only one way to solve a constitutional crisis; but by definition, there are always at least two ways: one is to change the law to comply with the constitution, the other is to change the constitution to make the law no longer be unconstitutional. So a group that feels strongly about one of these two possible solutions should be prepared to negotiate with the other group so as to hammer out an agreement that benefits both parties. In some cases, this will mean doing things that they do not completely like; but if they're not willing to do that, at all, they have no business being politicians. For the longest time during the early negotiations, however, both parties have stubbornly refused to even acknowledge the other position, let alone talk about it. Now, for clarity, I'm not advocating that the latter of the two options in that previous paragraph is what should happen. Frankly, I don't even care what happens, so long as they manage to resolve the issue at hand in some way. What I do care about, however, is that this country has been in a near-constant state of stalemate over these past few years for an issue that only matters to politicians; I don't care who or what a group of people in a (to me) obscure part of the country can vote for. This country needs a stable government which can act on things that actually matter. Like, say, the international economic crisis of the past two years; I think it matters much more whether the man in the street has a job than whether John Q. Politician will past these next elections.

3 May 2010

Matthew Garrett: PCI power management problems

I've previously written about some of the implementation details of runtime PCI power management. One of the key aspects for PCI devices is that the PME line on the device be able to generate a wakeup event. Unfortunately, it turns out that since Windows makes no use of this functionality at present, some vendors have started failing to wire this up. This is problematic because the device itself still announces PME support and will even raise a PME signal when it gets woken up - but it's pretty much screaming as hard as it can and nobody's listening because somebody's replaced the air with cheese.

Bother, etc.

The obvious question is what to do next. We could poll all the PCI devices every second or so to see if there's a PME status register that's been set. This would be reasonably cheap (we're going to wake up at least once a second on x86 anyway, so it makes no real difference to power consumption) but would introduce obvious latency in the wakeup path. This would be fine for certain types of situation (you're probably not going to be too sad if your SD reader takes a second longer to notice a card insertion) but not others (if an sdio wireless card generates a wakeup interrupt then we really ought to do something about it in a more sensible timeframe). A second is to force users to pass a boottime argument to enable this at all. That kind of sucks.

The third possibility is limited to a subset of hardware, but does allow the introduction of some kind of elegance into what would otherwise be one of those nightmarish scenarios that makes me consider taking up farming instead. If we can trigger a PME ourselves then we can test whether the line is connected. This doesn't appear to be possible on SDHCI but the spec for firewire makes it look like we can do it there - one of the interrupt sources is the port enable/disable register, and we can hit toggle that ourselves. I haven't actually tested this yet, but if it works that would let us make this determination.

It's depressing that doing anything interesting with power management is still heavily determined by what Microsoft have bothered to implement - to the extent that on some machines (hello, Thinkpads) there are no GPE methods at all for PME signals and you don't get runtime power management at all. The only thing that saves us is that (a) it's pretty hard to be able to screw up stuff that's already all glued into one chip package, so integrated stuff like USB should be fine anyway, and (b) PCIe does this as part of the normal traffic stream so there's no way to get that wrong. Unless you're still missing the GPE methods for the signals (hello, Thinkpads) in which case you get nothing unless the native PCIe signalling works. I suspect that we can always force that, so there's some hope yet.

In summary, then: dispassionate.

Wouter Verhelst: Yves Leterme, Belgian minister for resignation.

At least that's what it looks like right now. No less than five times did he offer his resignation as prime minister of Belgium to the king. Looks like fifth time is a charm now, too we get to go elect a new parliament in a month or two. Sigh. The 'fun' bit is, there's no real reason why this is necessary. The main issue that they've been talking about these past few years is the 'BHV' thing. While the issue is somewhat complex and, I'm sure, involves a huge heap of all kinds of side issues, the crux of the matter is that there's one group of politicians who wants to forbid another group of politicians from running in a region of the country around the capital. Now I'm sure that's hugely important to politicians after all, their career depends on it but beyond a few fanatics in and around that very capital, I'm pretty sure nobody actually cares what the particular names are of the particular groups of people that appear on the list of people they can vote for. Because, you see, this isn't actually about politicians wanting to forbid other politicians from running; it's about politicians wanting to forbid other political parties from running. Which, of course, makes a whole world of difference. Yeah, right. Now I wouldn't care about this much, except that it interferes with the smooth running of this country. The fact that they've come up with "problem" after "problem" related to this BHV "issue" for these past years has made it hard(er) for the government to actually to any real work. So although I hate the current situation, I'm actually quite relieved that an election is coming up. Perhaps this time we can get the fanaticals out and have a real government. (no comments allowed on this item; please use your own blog)

Ingo Juergensmann: Drupal and PostgreSQL - SELECT DISTINCT, ORDER BY

Some time ago, version 6.16 of Drupal was released and hit the Debian archives shortly after. It fixed some security issues, but apparently introduced a regression for PostgreSQL users. The problem seems to be a MySQLism in Drupal or in other words: Drupal is not following the SQL92 standard.
The error is:

2010-05-02 06:36:23.155 CEST drupal6_mycr drupal6 ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
2010-05-02 06:36:23.155 CEST drupal6_mycr drupal6 STATEMENT: SELECT DISTINCT nc.nid FROM node_comment_statistics nc INNER JOIN node_access na ON na.nid = nc.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'content_access_author') OR (na.gid = 1 AND na.realm = 'content_access_rid'))) AND ( nc.comment_count > 0 )ORDER BY nc.last_comment_timestamp DESC LIMIT 10 OFFSET 0


There are several issues open in the Drupal issue tracker like #742896 and #742006 and #735120. Apparently there are several ways to address this issue, but none seem to be the preferred solution. In #735120 there's a patch, but it seems not to be accepted so far.

So, is there a good and viable patch for that issue that will go into the next update of Drupal?

Next.

Previous.