Crashy crashy

October 6th, 2005

We’ve been playing Golf at work, except that we allow languages other than Perl. Today’s challenge has been simple: cause a segfault.

The only way we could think of in perl was:

kill SEGV=>$$;

Which is actually pretty compact, although it’s not a real segfault. The classic segfault in C is:

*(int*)0=0;

So the logical first try is:

main(){*(int*)0=0;}

But I figured that was a bit verbose, and got it down to:

*i=0;main(){*i=0;}

Which shaves a character off because of C’s default of typing everything as an int. You can shave a further two characters thus:

*i;main(){*i=0;}

But that’s not guaranteed – it depends on how i is initialised. Then Graham hit on a brainwave: since functions are just pointers to a place in memory in C, and all the C runtime libs do is transfer control to main, you can cause a crash very simply with:

main=0;

The C runtime tries to transfer control to 0 and crashes – this is probably technically a protection error, but it still shows up as a segfault. Therefore, using the technique from my unguaranteed code above, we get:

main;

And we think that’s as far as you can go. Any advance on that? Using -D on the command line is, of course, cheating…

Catholic Church gets it right

October 5th, 2005

The Times is reporting that the Catholic Church says the Bible isn’t totally accurate.

“We should not expect to find in Scripture full scientific accuracy or complete historical precision,” they say in The Gift of Scripture.
[..]
They go on to condemn fundamentalism for its “intransigent intolerance” and to warn of “significant dangers” involved in a fundamentalist approach. “Such an approach is dangerous, for example, when people of one nation or group see in the Bible a mandate for their own superiority, and even consider themselves permitted by the Bible to use violence against others.”

Wonderful. Can we have something similar from the Protestant church now, too?

This made me laugh

October 4th, 2005

PartiallyClips is very, very funny. This strip in particular made me giggle hysterically for quite some moments.

World of Stupid

October 4th, 2005

Your trial key for World of Warcraft has expired. To continue playing, please purchase a boxed retail copy of the game and enter the authorisation key in the box below.

Well, lovely, except that a traipse around Manchester on sunday afternoon revealed precisely zero shops selling it, and Amazon, Play, Gameplay et al all had leadtimes of several weeks on getting hold of it. Fortunately, a friend up in Bradford has found a copy and is sending it to me, but it does seem utterly stupid that a game that can only be played online can, in fact, only be played if you buy a copy of it in a shop.

(compare and contrast with Half Life 2, which is a single-player game that can only be played if you’ve got an internet connection; the genius of games developers never ceases to amaze me)

Gallery

October 2nd, 2005

I’ve switched over my gallery to use Gallery2. It’s easier to manage than v1, but customising it is still an enormous pain in the arse. At some point I’ll make it look prettier, but it doesn’t look too bad as it is. Also, I got a load of comment spam and there’s no easy way to delete it all, so far as I can, so I’ve disabled comments until I can figure out the MySQL runes to sort it out.

Hot Tub Ranking

October 1st, 2005

There are just no words. No words.

Also, that girl in green has an overbite you can open bottles with.

Diabetics sweepstakes

September 30th, 2005

Yesterday afternoon, we ordered about £75 worth of sweets from A Quarter Of…. They’ve just turned up. We’re now running a sweepstakes no who’s going to die of diabetes first.

(I’ve got a load of Desperate Dan bars, Wham bars and a quarter of a kilo of Yorkshire Mixture. Awesome.)

Sign of the times

September 28th, 2005

Overheard on the bus, two students talking:

Yeah, we were out the other day; there were loads of people there. Yeah, some famous people, like that Bez from off Big Brother.

Burnout Legends – review

September 28th, 2005

The bad:

  • Load times
  • All the EA crap
  • Very obvious rubberband catchup AI in races
  • Holes in the track geometry
  • Texture flickering
  • Load times
  • Stupid camera in crash mode
  • Limited resolution means it’s sometimes hard to see distant vehicles when racing
  • Load times

The good:

  • It’s Burnout
  • It’s portable
  • It’s Burnout
  • They got rid of that mind-buggeringly idiotic DJ
  • It’s Burnout

So yeah, you should probably buy it.

Further confusion

September 27th, 2005

Following on from the revelation that Phil Johnson has posted something that didn’t totally offend me, he’s now linked to me in his weekly BlogSpotting section. I mean, I’m kind of flattered, but it still feels odd.