Sunday, December 21, 2008

Computers scare me

Computers do the darndest things!

I write programs for a living, but I still don't understand why they do what they do sometimes.

There is a program I wrote last year that is being used in various labs across the world. A few months back, a small number of users started reporting an odd problem. When the program starts, it is supposed to read three sets of reference data which the users will then compare to their own data. The three reference data sets come from the same single archive file. But for these few people, the program only reads two of the data sets, and gives no indication of why it isn't reading the third.

That is odd, but there could be many possible causes. Sadly, we could not reproduce the problem on any of our own machines, so we couldn't help much.

Finally, this week, I found a copy of the program on my machine that did this bad thing. Great! Now I had something to test with. I could try varying things and see what effect it had on the program. Before doing that, I copied the directory containing the program to a new directory so I could leave the first copy untouched while modifying only the copy.

Much to my surprise, the copy of the program behaves flawlessly! All I did was copy it. Now I have one copy that is broken and one that works. But they are identical copies! My boss suggested the files might have different "permissions" set on them before and after the copy, so I've investigate that, and there seem to be no differences. Anyway, the three pieces of data that are supposed to be loaded at start-up all come from a single file, so any permissions problem should affect that whole file and not just part of it.

I'm completely stumped. And scared. If you program a robot to obey Asimov's 3 laws, what will happen when it makes a copy of those laws? Will only 2 of them continue to apply?

1 comment:

Anonymous said...

What happened to your cute little tree? was it confiscated for neglect?