Archive for the ‘Software’ Category

What you see may not be what you get

Wednesday, February 17th, 2010

There’s an interesting post here about heisenbugs and compiler optimizers. I’ve found two compiler bugs in my time. One was related to the optimizer, although it wasn’t due to the compiler generating incorrect code. Well, not quite, anyway.

In one case, a commercial embedded cross-compiler, the optimized code the compiler was generating was logically correct code. The problem was that it was incorrect in context. I was accessing machine registers that had to be accessed with 16-bit operations – if you tried to access half of the register with a byte operation, the processor would overwrite the other half of the register with random data. Naturally, the compiler was optimizing 16-bit accesses that only dealt with one byte of the register to 8-bit operations, because that was the better thing to do when dealing with normal memory. The compiler could produce code for several related variants of the processor in question, and I’m not sure that the register restrictions in question applied to other processors at the time.

I reported what was happening to the vendor, and they changed it in the next release of the compiler, but I couldn’t wait for the fix, and had to use assembly language to produce my access routines.

The other instance involved an IDE that used GCC as a cross-compiler. Our code wasn’t working, and initial investigation showed results that made no sense – one passed parameter was getting the value meant for the other, and another was getting a garbage value. Closer examination of the generated code showed that the stack frame for the function call in question was being built incorrectly, which beggared belief. Why was it only happening on this one call, rather than on all of them? If it were a general bug, there would be virtually no programs would be compiled correctly – what was it about this one call? Further investigation showed that the vendor had grabbed a version of GCC that had been pulled from distribution after about a day because of a significant bug involving calling across languages – calling C routines from C worked, as did calling C++ routines from C++, but calling one from the other didn’t … the specific bug that we were seeing, although we didn’t realize that it was due to a cross-language call until we saw the release notes on the GNU website. We were lucky that the vendor provided the capability to tell the IDE how to access other tools, or we’d have been dead in the water on our project.

It’s not often that you run into compiler bugs, unless you’re the one maintaining the compiler (in which case you probably see them more often than you’d care to). Most times, the problem is in your code, not the compiler. However, you can’t rule it out, particularly if you’re doing things that stress the compiler’s capabilities, or use features that most people don’t require. Some people make a point of looking for compiler bugs, which is nice of them. It’s not what I’d care to do on a daily basis, although I have designed and written test code to verify that language features work as intended.

Oh, this looks like fun

Tuesday, December 15th, 2009

Computer-aided design for Lego.

Via Ghost of a Flea.

Not much to show after thirty years

Wednesday, October 14th, 2009

I was going through boxes in the garage the other day, looking for things to fill the bookcases I recently assembled, when I came across the October 1979 issue of Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia. The magazine is now known as “Dr. Dobb’s,” but things back then were a little looser, with many companies having fanciful names – among the others I recall are Pickles & Trout, Parasitic Engineering, and Brown Dog Engineering, and Infoworld was once known as the Silicon Gulch Gazette. I used to work for a word processor company called NBI. Management claimed that it stood for “Nothing But Initials,” but I’ve seen one of the company’s original business cards, and its original name was Necton Bylennium, Inc. As an aside, I read about a man in California who was starting a computer consultancy back in the early 1980s who had trouble coming up with a business name that contained “computer” or “data” that wasn’t already being used, so he ended up naming his business “Solfan Industries,” with “Solfan” being an initialism for “Sick Of Looking For A Name.”

In any case, that issue of DDJ contains an article which is almost my sole publication to date in the computer field, apart from a letter to the editor in an old Apple II user group publication, a program distributed by the same user group, and a caption in one of the E.E. Times‘ Immortal Works competitions. Not a lot of output for thirty years, is it? Ah, well, something is better than nothing, and it’s not as though I haven’t been doing other things in the meantime.

Microsoft won’t pay you for forwarding emails

Wednesday, October 1st, 2008

They will, however, pay you to search the web (as long as you use Internet Explorer on their search site, and will accept frequent flyer miles).

Oh, this looks like fun

Tuesday, May 13th, 2008

… even if it’s called Phun. A 2-D physics simulator, available on Windows, Mac, and Linux. Be sure to watch the video.

Global Warming?

Friday, April 25th, 2008

How hot is it?

What global warming?

How cold is it?

Note: Both of these photos come from a column written by Jack Ganssle for Embedded Systems Design magazine on programmers being insufficiently paranoid about how their code handles errors.

Happy Easter!

Sunday, March 23rd, 2008

I can’t offer you any physical Easter eggs, but I can send you here and here to find virtual Easter eggs.

Related: you wonder why Microsoft software is so bloated?

Wanna play God?

Sunday, January 13th, 2008

Ever think that SimCity was a good game, but it would really rock if you could make some changes? Well, now you can.

Via Download Squad.

Antitrust, revisited

Wednesday, November 28th, 2007

I was disappointed in the ruling some years back in the Microsoft antitrust suit, and I haven’t been that impressed with what’s happened in the PC marketplace since the ruling. It looks as though I’m not the only one who thinks that way.

You can build a mainframe from the things you find at home

Wednesday, November 7th, 2007

Well, perhaps not. But Bill Buzbee built his own roughly-8086-equivalent computer from scratch, using wire-wrapped 7400-series logic. He also ported a C compiler an an operating system. Now that’s a homebrew computer!

Via One and One is 2.