Archive for January, 2005

Sunday 16th January 2005

Sunday, January 16th, 2005

Here’s the first “big” update of the new year. First the obligatory photos of various recent events:

Photos (from left to right, and top to bottom on most standard displays): Amstrad E3 Video Phone, a visit to Totnes, Trafalgar Square on Christmas Eve, OxLUG Food end of year gathering, the Canonical Ubuntu Conference in Mataro, Wolves LUG Christmas Bash, the final days of the office being based in Witney, visiting Hannah and Joe, dfb’s Christmas Party 2004, the Christmas fayres in Birmingham (listening to Hannah Sing and Sir James Galway playing).

On Friday the 10th of December in the year 2004, I celebrated my 23rd birthday in the company of good friends and family, up in Nottingham. For the third year running, I went to dfb’s EP (now Digital Document Engineering) Christmas Party and this time took Hannah and Joe along for the ride. We stayed up in Nottingham at the Gresham and enjoyed a late night party on Campus with Dave and gang, before retiring for the evening. I had been staying with Hannah and Joe in Birmingham on the previous few evenings, following Hannah’s enjoyable performance with the Birmingham University Choir at Symphony Hall on the Wednesday. In fact, I was so reminded that I enjoyed Symphony Hall as to attend a concert on the Thursday also – Sir James Galway and Friends. At that concert, I happened to be sitting near to a physicist who also has worked for one the companies I work with and we ended up talking about magnets while he graciously offered to give me a lift back home afterwards (thanks!).

On Saturday, 11th December, we met up with Carl and Susie for some shopping and general traversing around Nottingham centre. Carl, Susie, and I went looking for a geocache near to the National Ice Centre, but came away empty handed – Carl used his shiney mobile to lookup the website and ultimately found a photo which elluded as to where the cache might have actually been (but then, apparently some of those caches have been very awkward indeed). I suggested that a useful service would be to use mobile phone triangulation to approximate a location and then have various nearby caches automatically SMS’d to the cacher in response to a simple text. The idea must have been considered previously and probably has already been done – but it would nonetheless be reasonably easy to do and pretty cool for those spontaneous cachers.

We had lunch in V1 on that day, and went to Starbucks for some coffee (well, I suppose at least one of us had one in the end). Discussed Simon Cozens’ blog entry on ozymandns before Hannah poked me in to getting my arse in gear and going back to Birmingham with them. While up in Birmingham during the preceeding week, I had enjoyed visiting the German market and having a number of pretzels and fresh coffee. Saw Dan (must arrange to meet again soon when I’m next up in Birmingham or London or even perhaps in Kent), popped in to Open Advantage and talked with Jono Bacon for a while about random stuff – he’s keen on this ABI/API compatibility stuff for the Linux Kernel – I’m not so sure whether it’s not already covered or even will actually work out. But he’s keen for me to do something about it and that’s probably worth covering in LU&D.

I was in Witney, Oxford and Reading, helping to begin to sort out the office move from Witney out to Tubney Woods (think clinical private hospital looking place in the woods – hard to get to by public transport but luckily not quite impossible). Went up to Wolverhampton for the Wolves LUG Christmas Bash 2004 – great stuff. Got an early train from Wolverhampton to London so as to get a flight to an airstrip^W RyanAir serviced airport quite some way outside of Barcelona. Canonical hosted their second Ubuntu Conference out in Mataro, Spain, and I was there to see what they were up to – and generally to meet the likes of Mark Shuttleworth, Matt Zimmerman, Jeff Waugh, Lu (Louise McCance-Price), and the other guys and gals behind the team that everyone’s talking about (well it would seem pretty everyone in the Debian universe is involved at this point at any rate).

Back in the UK, I tried to get stuff flowing in to LU&D for the January issue of the magazine. January’s “Open Source Car” issue 45 looks pretty damn cool – go buy it now! We’ve got a DVD of Fedora Core 3 on the front cover and the a shiney new cover design to boot. Popped in for the OxLUG Food Christmas gathering (just four of us this time around in the Pizza Express in the centre of Oxford, off George Street). I popped in to London on Christmas Eve and finally got around to some shopping – bought a lot of stuff in Selfridges and prior to that got my dad a book token in Foyles bookstore. Selfridges changed me for tape to go with wrapping paper as their giftwrap service was overbooked (not surprising) and I couldn’t resist buying a Hershey’s bar while I was in there too. It’s truly disgusting by the way – nothing like Cadbury’s and “only” 30% fat too – so just a few squares and you’d be ready to swell up like a giant Texan.

I saw a couple of plays over the Christmas period. One with my friend Emma in the week before Christmas itself, at the Arts Theatre – How to Lose Friends and Alienate People – and another at the Playhouse theatre on Christmas Eve itself. This is how I came to be wondering along Shaftesbury Avenue and in Trafalgar Square on Christmas Eve, watching singers and noting numbers of people standing outside a church trying to catch a glimpse of the action. I also met a Canadian woman from Ottawa, which is always appreciated. I actually quite enjoy walking down Shaftesbury Avenue and towards the Thames, especially on a clear evening as I can walk across the Thames and on to the Southbank, pondering silently to myself. I’ve recently (as in now 2005) popped in to the Southbank Centre, in search of upcoming perfomances that I might attend over the next few months. I’ve not mentioned meeting Ben or Markus, but we did meet. In actual fact we met just after I got back from Spain and had crashed at the house of Sladen up in Seven Sisters. We installed panic.printk.net in Redbus in Harbour Exchange and then did the whole Docklands weekend coffee experience, followed by a trip in to central London. Discussion with the London Eye administration (for not coping with being able to store my suitcase in their luggage area) eventually lead to a private capsule on the London Eye, and curry somwhere just off the South Bank. I suppose I should write more about all this sometime.

Just before the new year, I popped down to Totnes for an afternoon to see Richard. Twas nice. Hannah and Joe were en route to Devon anyway so I stopped off with Joe’s parents for lunch – his mum makes the most wonderful tomato chutney and it was good to see Susie and Andy too. Totnes was as pleasant as the last time, and I especially enjoyed popping in and out of various little pubs as we tried to find the perfect place to grab a bite to eat. The photos show a bookstore Richard spotted, with a sale sign to rival all sale signs: Seriously Stupid [a la Bush] Sale.

New Year’s Eve was spent with the family at home once again, but we did go out in the evening for a change (this being my criteria for rejecting a friend’s party in Oxford in favour of being with my family at home – that we at least go somewhere different if we are all staying at home). We went to The Hinds’ Head out on the A4 towards Aldermaston – where Hannah and Joe are to put up some of their wedding guests later in the year. The “Masters Minds” team came second in the pub quizz and we won far too much chocolate to be even remotely healthy over New Year’s.

I did make a bunch of New Year’s resolutions, but I’ll choose to ellaborate upon them as I see fit. While on Christmas holiday, I did do some cleaning at home and bought myself an nice comfy leather chair to work in at the computer. This place is almost tidy right now and certainly much improved upon how I had let my stuff get. I did some reading over Christmas (I’m really enjoying having a Safari account so far – although I should use it more) and some reflection. I am trying to be more organised and to operate more regular hours, and to finish things I start. I also am now doing 10 press-ups, 20 sit-ups, and 10 press-ups both morning and evening, and it’s making a difference already. I can now eat 3 regular meals per day and still hopefully lose weight. I’ll mix that with regular outdoor exercise, as I’ve been trying to do, at least when feasible.

I am off to Munich this week and then I’ll be in Ontario (Canada) and Boston (Massachusetts) for much of February as I visit Canada for a week and a bit of skating and holidaying and Boston for the LinuxWorld. I spoke to Jeremy Allison recently about meeting up over there and happened to be at a Lonix meeting the other night, in which I heard Richard Cohen might be popping in.

Another update sometime soon. Should mention various stuff – also have a look over at planet.jonmasters.org for various news feeds.

* One of my favourite Christmas gifts was a shit spewing George W. Bush doll. Just press the button and he comes out with one of those trademark quotes. A great desktop item for anyone who dislikes George Dubya as the “leader of the free world”. Bah.

Jon.

Upgraded blog to Wordpress

Thursday, January 6th, 2005

This blog just got automagically imported into WordPress, courtesy of a PHPslash to Wordpress conversion script that I just wrote.

It’s not perfect yet – but with a bit of work it should be better than it was. Please don’t moan at me about templates and layout – I’ve had to do the hard bit of migration first.

Jon.

Wasted time, but fun

Sunday, January 2nd, 2005

[ from the arrrgh-damn-versioning-we-meet-again dept. ]

I just spent 2 days trying to fix a potential bug in the PCMCIA driver for my PRISM2 based wifi card (Sitecom GmBH) in my Apple Powerbook, only to discover it was somewhat a non-bug. As it would turn out, I had a few loadable modules (LKMs) kicking around which were compiled with slightly different set of options (bizzarely though, nothing which I would have thought would have needed a rebuild anyway) which resulted in somewhat random wait_queue corruption in khelper.

I’ve been experiencing a few problems with Powerbook Linux, and as part of my resolutions to make myself a better person – I’ve decided to actually fix stuff that really bothers me. Like having PCMCIA die on any cardctl eject event – or randomly when putting the Powerbook to sleep. Generally I would recommend running Linux on one of these since the support is usually pretty good – but sometimes things do go wrong, and for those who care, here’s the “411″ on this recent non-bug.

Linux has various parts of the hotplug subsystem and events subsystem, which work together when a new device is inserted before it becomes available. Linux has a permanent kernel_thread helper running called khelper. This thread is occasionally used as a schedulable context for stuff that call_usermode_helper wants to run – like /sbin/hotplug or modprobe. It’s a pretty cool solution to the problem of calling out to userspace for help. khelper is responsible for running up hotplug when I insert my wifi card, which then configures the netdevice and hooks up ifplugd to watch for net events. Incidentally, for those who don’t have ifplugd watching their network sockets – where have you been?

I have recently been seeing kernel oopses on card removal, similar to this one:

Oops: kernel access of bad area, sig: 11 [#1]
PREEMPT
NIP: 4800024C LR: C001A3F4 SP: CFF97ED0 REGS: cff97e20 TRAP: 0400    Not tainted
MSR: 40001032 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c0570660[4] 'khelper' THREAD: cff96000Last syscall: 120
GPR00: 4800024D CFF97ED0 C0570660 C00305BC 00000003 00000000 00000000 00000000
GPR08: 00009032 C00305C8 C1275D80 CFF96000 CFF96000 00000000 00000000 00000000
GPR16: 00000000 00000000 00000000 00000000 00000000 CFFA68A0 CFF96000 CFFA68B8
GPR24: 00000003 00000000 00000000 00000001 C1275D84 38A5A768 7C00F028 CFF97ED0
NIP [4800024c] 0x4800024c
LR [c001a3f4] __wake_up_common+0x58/0xa4
Call trace:
 [c001a5c4] complete+0x58/0x98
 [c0030800] __call_usermodehelper+0x78/0x88
 [c0030ca0] worker_thread+0x1ac/0x27c
 [c0035b0c] kthread+0xb8/0xc0
 [c000b490] kernel_thread+0x44/0x60
note: khelper[4] exited with preempt_count 1

Note how the LR (Link Register) contains c001a3f4, the address of __wake_up_common+0x58 (hex offset 0×58 bytes), a function which is apprently 0xa4 hex bytes in length. On PowerPC, the Link Register serves as a saved instruction pointer one can return to in a function epilogue by doing a blr, or similar. So the cause of the exception was whatever happened at that address. It turns out that this was a branch instruction. Here’s the offending function:

/*
 * The core wakeup function.  Non-exclusive wakeups (nr_exclusive == 0) just
 * wake everything up.  If it's an exclusive wakeup (nr_exclusive == small +ve
 * number) then we wake all the non-exclusive tasks and one exclusive task.
 *
 * There are circumstances in which we can try to wake a task which has already
 * started to run but is not in state TASK_RUNNING.  try_to_wake_up() returns
 * zero in this (rare) case, and we handle it by continuing to scan the queue.
 */
static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
                             int nr_exclusive, int sync, void *key)
{
        struct list_head *tmp, *next;

        list_for_each_safe(tmp, next, &q->task_list) {
                wait_queue_t *curr;
                unsigned flags;
                curr = list_entry(tmp, wait_queue_t, task_list);
                flags = curr->flags;
                if (curr->func(curr, mode, sync, key) &&
                    (flags & WQ_FLAG_EXCLUSIVE) &&
                    !--nr_exclusive)
                        break;
        }
}

The offending line turns out to be the call to curr->func(curr, mode, sync, key) since this dereferences an entry in the waitqueue and attempts to run the func element. func is the wakeup function, which is usually default_wake_function but presumably might be changed for some special applications (example sought) . Suppose this wait queue entry existed on a dud stackframe somewhere or was otherwise trashed and the function pointed off in to space, as is the case with this oops. Then the kernel would get very unhappy calling it.

What followed was over a day of exploring with the PCMCIA subsystem and going through the source to cs.c and ds.c in an attempt to understand what might have registered itself for a wakeup. Eventually I did a full recompile with spinlock and wait queue debugging, which failed to run properly without recompiled modules – that was a fairly obvious mistake – but when I did re-install modules, I eventually figured it must have been that I had missed this step on a previous build.

So that’ll teach me to always be sure I do a make modules_install step on any new kernel.

Jon.

Forthcoming Events

Saturday, January 1st, 2005

[ from the happy-new-year-all dept. ]

Happy new year everyone!

This is a placeholder until a full update goes up properly. I’ll be away quite a lot over the next two months – a partial list follows.

  • Munich, Germany – 2005/01/20 – 2005/01/23
  • Ottawa, Canada – 2005/02/01 – 2005/02/20
    • LinuxWorld – Boston, MA – 2005/02/14 – 2005/02/17
  • UKUUG Conference – Birmingnam 2005/02/24 (possibly).
  • FOSDEM – Brussels, Belgium 2005/02/25 – 2005/02/26

Jon.