Feb 16

Who bears the costs of moral vanity?

A high-ranking Taliban commander is captured in Pakistan, and the (now entirely predictable) dance begins. Says the Guardian:

Mullah Barader has been in Pakistani custody for several days, with US and Pakistani intelligence officials both taking part in interrogations, according to the officials. Though Barack Obama has banned US agencies from using forms of torture such as waterboarding, Pakistani questioning techniques are frequently brutal.

That’s right. Because the American chattering classes have their panties in a bunch about acts of “torture” that don’t do any permanent damage to the victim, Barader is in the hands of Pakistanis who are likely to fuck his shit up the old-school way, with knives and cattle-prods and blowtorches. And yet, this is supposed to count as a moral victory.

Continue reading

Feb 13

When you see a heisenbug in C, suspect your compiler’s optimizer

This is an attempt to throw a valuable debugging heuristic into the ether where future Google searches will see it.

Yesterday, my friend and regular A&D commenter Jay Maynard called me about a bug in Hercules, an IBM360 emulator that he maintains. It was segfaulting on interpretation of a particular 360 assembler instruction. But building the emulator with either -g for symbolic debugging or its own internal trace facility enabled made the bug go away.

This is thus a classic example of heisenbug, that goes away when you try to observe or probe it. When he first called, I couldn’t think of anything helpful. But there was a tickle in the back of my brain, some insight trying to break into full consciousness, and a few minutes later it succeeded.

I called Jay back and said “Turn off your compiler’s optimizer”.

Compiler optimizers take the output stream from some compiler stage and transform it to use fewer instructions. They may operate at the level of serialized expression trees, or of a compiler intermediate representation at a slightly later stage, or on the stream of assembler instructions emitted very late (just before assembly and linking). They look for patterns in the output and rewrite them into more economical patterns.

Optimizer pattern rewrites aren’t supposed to change the behavior of the code in any way other then making it faster and smaller. Unfortunately, proving the correctness of an optimization is excruciatingly difficult and mistakes are easy. Mistaken optimizations that almost always work are, though rare in absolute terms, among the most common compiler bugs.

Optimization bugs have a strong tendency to be heisenbugs. Enabling debugging symbols with -g can change the output stream just enough that the optimizer no longer sees the pattern that triggers the defective rule. So can enabling the conditioned-out code for a trace facility.

When I told Jay this, he reported that Hercules normally builds with -O3, which under GCC is a very aggressive (that is to say somewhat risky) optimization level.

“OK, set your optimizer to -O0,”, I told Jay, “and test. If it fails to segfault, you have an optimizer bug. Walk the optimization level upwards until the bug reproduces, then back off one.”

I knew of this technique because I’ve been in this kind of mess myself more than once – most recently the code for interpreting IS-GPS-200, the low-level bit-serial protocol used on GPS satellite-to-ground radio links. It was compromised by an optimizer heisenbug that was later fixed in GCC 4.0.

This morning Jay left a message in my voicemail confirming that my diagnosis was correct.

I said above that optimizer bugs have a strong tendency to be heisenbugs. If you are coding with an optimizing compiler, the reverse implication is also true, especially of segfault heisenbugs. The first thing to try when you trip over one of these is to turn off your optimizer.

You won’t hit this failure case very often — I’ve seen it maybe three or four times in nearly thirty years of C programming. But when you do, knowing this heuristic can save you many, many hours of grief.

Feb 12

LORAN, we hardly knew ye

There’s been some upset in the blogosphere over the shutdown of the LORAN system of radionavigation beacons. This post at Chicago Boyz is representative (hat tip to Instapundit). The author worries “I’m not totally sure that this was a good decision.” and various commenters are much more emphatic, bemoaning the lack of a backup for GPS.

In my capacity as lead of the GPSD project I’ve been required to become a topic expert on the strengths and weaknesses of GPS and various competitors to it, including LORAN. So here’s the straight scoop: yes, a backup for GPS would be a really good idea. No, LORAN was never plausible as that backup, so angsting about its passing on those grounds is just silly.

Continue reading

Feb 10

The Great Blizzard of 2010: It’s Baaaack!

So, if you entertained any thought the Great Blizzard of 2010 was Gaia dancing a mocking reel on the heads of the AGW crowd…she’s back to tread out a hornpipe, a polka, and a rigadoon. The mid-Atlantic coast is now experiencing a second record-setting snowstorm just five days after the first one. Once again: we are snowed in, we are OK, the fridge is still well supplied, and the cat is still fuzzy.

Washington D.C. is now long past seeing its seasonal record for snow shattered. City authorities appear to have plain given up. The Federal government is shut down. (Yay!) Philadelphia is pretty much shut down too and nobody thinks it’s going to be any better off tomorrow. As I write we’ve got three feet on the ground in Malvern and more coming down fast; the trench I dug from our door to the driveway this morning has already filled in.

Last time around Malvern was 30-50 miles north of the worst-hit areas. This time, if I can go by what I saw on the weather maps, we had the bull’s-eye painted on us. The wind’s not as stiff as it was in Round One, but I think the snow is actually accumulating faster this time. Between the weekend’s snow and the new stuff I think we might crack the five-foot mark here.

The serious-damage threshold has already been crossed. Some friends of ours about a mile and a half away own a hot tub that sits under a light wooden-and-plexiglass gazebo. Used to sit under it, I should say; the roof collapsed today. Internet service is getting slow and flaky; I’ve had a couple episodes of being unable to reach even Google today. Pandora Radio is, unsurprisingly and with no blame to them, dropping out a lot. I’m thinking some of the core routers in the D.C./Baltimore area have probably crapped out.

I made another ginormous pancakes-and-bacon breakfast for us this morning. Wasn’t as much fun this time. And had to do almost all the shovelling myself, as Cathy slightly pulled something in her right hip over the weekend and I was not about to let her re-injure herself. Not that shovelling’s done a lot of good, anyway; as I noted, the snow has filled already in this morning’s trench to the driveway, Getting all the way to the road isn’t going to be pleasant.

Overall, this is starting to suck. Not seriously, yet, but the trend is not good. Um, about that global warming, could I actually have some, please? The cocoa is holding out, but we’re down to our last slice of pumpkin pie here, man!

Feb 10

If God is dead, is anything permissible?

One of my regular commenters asked, in a previous thread, “If everyone was truly released from the shackles of religion, and got beyond the false moral codes imposed on them, would society collapse in a heap of nihilism?” This question needs a longer answer that will fit in a reply comment.

The shortest summary is “No!”. The less short answer is: “No, because religious moral codes are epiphenomenal.” And it is on point to add that the question reveals serious ignorance of the actual traits of most religions over most of history.

Continue reading

Feb 09

Don’t Dis the Wiccans, Tea-Partiers!

A few minutes ago I read Bill Whittle sneering at “mass-produced members of bused-in wiccan nihilist anarcho-Maoist lesbian eco-weenie anti-war protestors”. I tried to leave a comment there; it went into moderation, and I lost my original in the browser shuffle. I can’t guarantee that the following is a word-for-word copy, but it’s pretty close.

Hey! Hey! Don’t lump all Wiccans in with the left-wing rent-a-mob crowd. It’s true that some our more vocal people fit the stereotype, especially in the Dianic wing of the movement. But there are lots of quieter Wiccans who are gun-toting libertarians like me; for us, the rejection of monotheism and “faith” is continuous with the rejection of One-True-Wayism in all its forms. Thomas Jefferson might say of us that we have sworn on the altars of our gods eternal hostility towards every form of tyranny over the mind of man.

Wiccans are potential allies for the Tea Party movement, as long as it remembers that America was founded on religious dissent and doesn’t fall into an unholy alliance with bigoted religious conservatives as the GOP did. That choice didn’t play well with the general population of independents and moderates, either; heed the lesson.

Here’s the disturbing part. There are now two comments on that post, and mine isn’t either of them – suggesting that Bill Whittle did a moderation pass and shitcanned it. If true, that’s deeply disappointing news about both Bill Whittle and the movement in which he claims to be a principal figure. It puts some point on the left-liberal accusation that Tea Partiers are a bunch of reactionary know-nothings wearing fiscal conservatism as mere camouflage.

Mr. Whittle, I’m making a noise about this because I think your attitude about Wiccans — whatever it actually is — is a good proxy for your movement’s ability to see beyond tired stereotypes and fratricidal culture wars. Are limited government and individual liberty your actual goals? If so, can you recognize potential allies from wherever they hail?

Much — including the future of the Tea Party movement, and perhaps the future of our country — may turn on your answer.

UPDATE: It now appears that the apparent disappearance of my comment was due to technical difficulties. I apologize to Bill Whittle for entertaining dark suspicions of him personally, and note that he disclaims being a spokesperson for the movement. The larger question about the willingness of the Tea Party movement to (sorry for the PC phrase…) embrace diversity, is still open.

Feb 07

Opening Pandora’s Music box

I’ve been meaning to experiment with Pandora Radio for a while, and finally got to it today. It’s based on something called the “Music Genome Project” that categorizes music by how it expresses a large number of “genes” — traits that describe features like song structure, instrumentation, genre influences, and so forth. According to Wikipedia these are used to construct a vector, and similarity between tunes is measured by a simple distance function. You give Pandora a seed artist; it then apparently random-walks you through tunes and artists similar to that artist’s style.

Continue reading

Feb 06

The Great Blizzard of 2010

This is a bulletin for those of my regulars who know that I live smack-dab in the middle of the mid-Atlantic-coast region of the U.S. that’s just been hit by epic snowfall. We’re OK. It’s dangerous outside and we’re not planning on stirring out of sight of the house until the blizzard is over, but we’re OK.

Continue reading

Feb 04

Error cascade: a definition and examples

I’ve used the term “error cascade” on this blog several times, notably in referring to AGW hysteria. A commenter has asked me to explain it, and I think that’s a good idea as (a) the web sources on the concept are a bit confusing, and (b) I’ll probably use the term again — error cascades are all too common where science meets public policy.

Continue reading

Feb 03

Naming and shaming the AGW fraudsters

James Delingpole, in Climategate: Time for the Tumbrils, noting the public collapse in credibility of AGW “science” utters a fine rant summed up in this wise (parochial references to British political figures and organizations omitted):

I’m in no mood for being magnanimous in victory. I want the lying, cheating, fraudulent scientists prosecuted and fined or imprisoned. I want warmist politicians booted out and I want fellow-travellers who are still pushing this green con trick to be punished at the polls for their culpable idiocy.

For years I’ve been made to feel a pariah for my views on AGW. Now it’s payback time and I take small satisfaction from seeing so many rats deserting their sinking ship. I don’t want them on my side. I want to see them in hell, reliving scenes from Hieronymus Bosch.

I too long to see the frauds and the fellow-travellers in the hell they’ve earned for themselves. But revenge, while it’s a tasty dish that long-time public “deniers” like Delingpole and myself are now thoroughly enjoying, isn’t the best reason to hound them and their enabling organizations out of public life. The best reason not to relent, to name and shame the fraudsters and shatter their reputations and humilate them — ideally, to the point where there’s a rash of prominent suicides as a result — is this:

If we don’t destroy them, they’ll surely ramp up yet another colossal, politicized eco-fraud to plague us all.

Continue reading

Jan 28

“I forgot he was black tonight for an hour”

In commentary following Barack Obama’s 2010 State of the Union address last night, MSNBC commentator Chris Matthews said “You know, I forgot he was black tonight for an hour.”

It’s hard for me to even wrap my mind around racial prejudice that blind and entrenched. If I were black I think I’d be righteously pissed off — and yet, Matthews and his fans undoubtedly think of themselves as the enlightened ones who are leading the rest of us troglodytes to the sunny uplands of universal brotherhood.

Mr. Matthews, I have news for you: some of us actually manage to forget that Obama is black for weeks at a time — that is, until we’re reminded of it by a self-righteous, pompous, race-obsessed idiot like you.

Why does this man still have a job this morning? Why is there not a universal howling for his blood from bien pensants everywhere?

Oh, right. I forgot the rules. Only Republicans get that treatment.

Jan 22

Are political parties obsolete?

There’s been a lot of punditry emitted in the wake of Scott Brown’s victory in the Massachusetts special election to replace Teddy Kennedy. All of it that I’ve seen is aimed at making some partisan point in the Democratic vs. Republican tug of war. But the facts of the Brown victory seem to me to suggest something different and more radical: that political parties as we have known them for the last 200 years may be obsolete, or at least well on their way to becoming so.

Continue reading

Jan 19

Jews and the tragedy of universalism

One of my commenters recently pointed me at the work of Kevin McDonald, and academic who has studied the adaptive strategies of diaspora Jewry in great historical depth, largely drawing from Jewish historians as his sources.

I have yet to read his actual books, but I’ve found a great deal of review and discussion and analysis of them on the Web, and he makes some interesting cases. Through reading about his work, I’ve found a possible answer to a historical question that has troubled me for a couple of decades. That answer implies a terrible, bloody irony near the heart of the last few centuries of Jewish history.

Continue reading

Jan 18

Reading racism into pulp fiction

I have a scholarly interest in the historical roots of science fiction and related genres. For this reason, I sometimes seek out and read late 19th and early 20th-century fiction, both classic and “pulp”, that I have reason to believe was formative for these genres. Nowadays I read such books critically, trying to understand what they reveal about the assumptions and world-views of the authors as well as appreciating what the authors were intending as artists.

My recent readings in this category have have included some rediscovery of the works of Edgar Rice Burroughs (which I read much less critically as a child). I’m presently reading for the first time the Cossack stories of Harold Lamb, rousing tales of battle and derring-do set in Russia and India and Northern Asia around the turn of the 17th century that are at least as well constructed as anything Robert Louis Stevenson or Alexandre Dumas ever wrote. As I’ve been reading, I’ve been comparing Burroughs and Lamb to Rudyard Kipling’s tales of India, and H. Rider Haggard’s lost-worlds tales of Africa, and to Talbot Mundy’s adventure stories also set in India.

One of the obligatory features of modern reactions to these books is to tut-tut at racist and colonialist stereotyping in them. This Wall Street Journal review of Lamb is typical, waxing a bit sententious about “brushes with anti-semitism” in the Cossack stories. But I’m learning to be critical about that sort of reaction, too — because, in rereading Burroughs, I began to understand that ascriptions of “racism” are an oversimplification of Burroughs every bit as crude as the stereotypes he’s often accused of trafficking in. And now, reading Lamb, I find that these “brushes with anti-Semitism” are raising more questions in my mind about the comfortable prejudices of my own time than they are about Harold Lamb’s.

Continue reading

Jan 14

The Devil in Haiti

There’s a great deal of ridicule being aimed at Pat Robertson for describing the catastrophic earthquake in Haiti as God’s retribution on the country for a deal with the Devil supposedly made by the leaders of the 1791 slave revolt in which they threw off French control. And Robertson is a foaming loon, to be sure…but when I dug for the source of the legend I found a curiously plausible account:

Continue reading