Archive for July, 2007

Parallels 3 4560 Still Segfaults

This latest update from Parallels is a big one, evidently fixing many, many issues. Alas it does not fix the “playing audio segfaults Parallels” problem. If you’re a Parallels user and you’re finding that it still dies on you, disable audio support via Devices > Sound > Mute.

Maybe next time….

No Comments »

chris on July 29th 2007 in /dev/random

I Know Where “– tables()” Comes From!

After four days of hunting through Rails code, my own, Rails proper, and plugins I finally know where the errant “– tables()” is coming from: a plugin I’d completely forgotten about.

In production Apache was throwing back the following error:

Application error
Rails application failed to start properly

In effect a 500 error - something died on the server. The server logs revealed the following:

[Thu Jul 19 14:23:13 2007] [error] [client 70.79.1.4] malformed header from script. Bad header=– tables(): dispatch.cgi

A good googling of that error seemed to indicate that it mainly gets caused in Rails app by developers who leave puts statements in, probably because when Rails is run locally using lighttpd those puts are written out to the console. Very handy for debugging.

However under Apache those puts are written out as part of the HTTP header which causes the server to puke, which then throws a 500 error, which Rails then returns as that nice little inoffensive error message.

So I scoured my code for every instance of puts and p I could find and commented them out (I don’t tend to use them for debugging, that’s what the Logger is for but if you grep your Rails project you’ll see a ton of them laying about).

Nothing changed, that wasn’t it. puts was not the culprit.

Today I noticed that it only happened in the one project of three I’m working on. diff the configuration and environment files for those projects - no tell-tale differences of any importance.

Then today over lunch it occurred to me that the only signifigant difference between Rails projects over which I don’t exercise total control is the plugins I use. And sure enough the three apps all share the same plugins save for one.

Comment out the require statement for that plugin in its init.rb file and voila! Problem goes away.

Four days of wonderment solved with a simple =begin...=end statement.

Developers often get chastised (perhaps mostly behind our backs) for not thinking our code could ever be the problem, it must always be something else. Well, for once it really was something else. Ha.

Now I can get back to fixing all my own bugs.

No Comments »

chris on July 19th 2007 in /dev/random

Where Does “– tables()” Come From?

When starting up one of my Rails apps the initial console output looks like this:

=> Booting Mongrel (use ’script/server webrick’ to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment…
– tables()
-> 0.0576s
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
** Rails signals registered. HUP => reload (without restart). It might not work well.
** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.

Note that little chunk in the middle that shows how long it took to read the table structure from the database:

– tables()
-> 0.0576s

Where the heck does that come from??

Of the three Rails apps I currently have in development that only gets output in one of them. The config and environment files are the same across all three platforms (save for database access credentials) and yet only one of them spits out that data.

It’s really messing up the production server since Apache attempts to jam it into the HTTP header which causes a 500 error, as one might expect.

Anyone know? A plugin? Lesser-known config option? Elves? I am stymied.

No Comments »

chris on July 19th 2007 in /dev/rails

“You keep using that word. I do not think it means what you think it means.”

“It means impossible. Since no engineer is going to admit something is impossible, they use this word instead. When an engineer says something is “non-trivial,” it’s the equivalent of an airline pilot calmly telling you that you might encounter “just a bit of turbulence” as he flies you into a cat 5 hurricane.”

This quote shows both the difference between the engineer and non-engineer’s conception of non-triviality, and their different definitions of impossible (Flying through a hurricane isn’t necessarily impossible, you just really wouldn’t want to do it).

In Understanding Engineers: Feasibility Charles Miller does an excellent job of explaining what engineers (and by association software developers) really, truly mean when we say a problem is “hard” or “Very Hard” or “impossible”. An excellent read, well worth the time for anyone who has been on the receiving end of a bluntly-delivered “that problem is non-trivial” and been left annoyed and confused, wondering “wtf does that mean???”

Alas Charles doesn’t quite explain why engineers would use “trivial” instead of “already solved… in my head”, use “non-trivial” instead of “impossible”, and use “very hard” instead of “not a chance in hell”.

The answer is simple: we don’t want you to panic. Panic is bad.

To the engineer none of these terms actually mean impossible per se, not in the same sense that the entire rest of the world understands “impossible” anyhow.

Rather these terms are gradations of effort, and of work, and of thought and, oddly enough, the amount of practical engineering or development that will be involved in solving the problem.

(Note that if a developer actually says “no, impossible. Totally impossible, can’t be done” and then starts to walk around in small, worried circles that really does mean it can’t be done. In that case you probably ought to leave them alone for a bit to think about it, just in case.)

The rock climbers out there will instantly get this concept - think of this as the developer’s Yosemite Decimal System. The YDS is a scale by which rock climbers rate the difficulty of a climbing route (a “problem”). A 5.1 is a set of carpeted stairs with excellent hand-rails, 5.14 is restricted to baboons, orangutans and mutants. Most climbers would thus accuse a 5.15 of being “impossible, totally impossible”. A few would then up and send it, which of course does absolutely nothing to reduce the problem’s total impossibleness. It remains impossible.

A non-rock climber would look at that same rock wall, hear a climber moan “impossible” and assume that the climber actually means “nope, can’t be done, ever, no sense in even standing about gazing at it, might as well go have a beer” which of course is completely perpendicular to what the climber actually means. Except for the the beer bit. That’s probably still correct.

What the climber is really saying is:

“I’m going to stand here staring at this blank wall for a few hours, doing a strange little slow-motion dance, looking a bit like a mime trying to climb a ladder, while muttering under my breath. Then I’m going to go home and dream about this place. I’m going to wake up, re-christen it ‘my project’, sucker a friend into coming back here to suffer on belay, bash away at it for hours, swear a lot, call it ‘impossible’, curse its name, and come back and do the very same thing again next weekend. Let’s go have a beer.”

So, the next time you hear a developer use one of these terms know that they do so not to confuse but rather to mitigate worry. What they’re really saying is “Let me think about it”.

No Comments »

chris on July 17th 2007 in /dev/random

Solving the Depricated @Flash Warning

Long long ago I ran into an issue in which my use of flash always generated a warning, though I thought I was implementing it properly.

In the comments Dmitry finally solved the mystery:

Don’t name your flash partial “_flash.rhtml”, name it something else, like “_flash_box.rhtml”. This is a known bug.

And with that, no more warnings.

No Comments »

chris on July 10th 2007 in /dev/rails

Parallels Support Forums: Nope, Not There Either

With Parallels 3.0 crashing like Mr Magoo in bumper cars and no other responses from the Parallels folks I figured I’d head into their support forums and post my results, including crash logs, there since I can make Parallels 3.0 seg fault almost at will.

I own Parallels, I have a support forum account, but trying to post gets me:


parallels no post

People at Parallels come on, enough already. It’s like you want your users to dislike you.

I swear, not even Microsoft makes it this difficult to help them. Throw a dog a bone and open up at least one line of communication.

Update: After poking about with Parallels for a couple hours I am now largely confident the problem with 4128 is its audio support. Just before a crash or kernel panic the audio cuts out. It appears that disabling the audio playback in the resident Windows application provides a measure of stability (I haven’t crashed in about three hours of constant use thus far) so this probably means no games for the time being and if your apps play any sounds at all I’d disable them in that app’s preferences.

5 Comments »

chris on July 1st 2007 in /dev/random