Fog Creek Software
Discussion Board




VB ActiveX EXE Heisenbugs

This morning, I fixed a bug which had been floating around for some time. The symptom was that a Visual Basic ActiveX EXE wasn't being registered correctly, and hence the client would complain accordingly. Easy enough workaround - register the server by hand.

I tracked it down to the fact that the installer was registering the EXE with the command line "/reg", rather than the expected "/regserver". Looking in MSDN (Q200034) seems to confirm that "/regserver" is the command line parameter you should use to register an ActiveX EXE.

What puzzles me, though, is how the installer managed to ever work at all. I'm pretty sure all our customers haven't had to work around it!

Thoughts, anyone?

Better Than Being Unemployed...
Monday, June 16, 2003

Beats the heck out of me. We have the same kind of heisenbug... a critical DLL or OCX isn't registered. Registering it fixes the problem. But the doggone SETUP program is supposed to register it. In desperation I'm actually going to teach our main app to register DLLs when it runs into trouble ("self repair")

Joel Spolsky
Monday, June 16, 2003

Heisenbug - Anyone know where this phrase originated?

B#
Monday, June 16, 2003

Its a bug, Heisenburg  talked about the observer affecting the event, as in quantum states.  So a heisenbug tends to be one that changes its nature, or disappears if you look for it.

Just another one of those gosh darned jokey portmanteau things that those cool computer chappies with a modicum of physics knowledge comes up with.

By the way its lovely out here in the garden today, pity I can't read the screen.

Simon Lucy
Monday, June 16, 2003

I appreciate the definition (it's going that way) but I was wondering where it came from.  Since we're concerned with that lately.

B#
Monday, June 16, 2003

Screen reference?!? Whoosh

B#
Monday, June 16, 2003

I used "Heisenbug" in this instance to mean "a bug which is never found until somebody reports it, at which point it is discovered the code could never have worked in the first place".

Joel,

Your mileage may vary etc, but I've found that DLLs & OCXs sometimes fail to register automatically at install time because they depend on a newer version of some runtime library (msvcrt.dll and msvcp60.dll being common culprits). These can't yet be upgraded because it's being used by the installer itself, so registration will fail and if it's not storing the result to DllRegisterServer (or just shelling to regsvr32 /s) you won't notice until you launch the app.

I've certainly found from experience that any DLL using ATL 3 or above won't self register on a bare NT4 box without upgrading the runtime libraries first.

Best solution is to write your own custom "repair & register" app that's launched on reboot.

Better Than Being Unemployed...
Monday, June 16, 2003

Aach!  Thanks again

For anyone interested:

http://c2.com/cgi/wiki?HeisenBugs

B#
Monday, June 16, 2003

To Better Than Being Unemployed...: what you describe is in fact a schroedinbug (see http://www.dict.org/bin/Dict?Form=Dict2&Database=*&Query=schroedinbug ), rather than a heisenbug ( http://www.dict.org/bin/Dict?Form=Dict2&Database=*&Query=heisenbug ).

Roel Schroeven
Monday, June 16, 2003

Oh yeah, looks like I've got the meanings mixed up. Thanks.

Better Than Being Unemployed...
Monday, June 16, 2003

Would a Heisenbug be one that only pops-up/disappears in a Debug build?

Just me (Sir to you)
Tuesday, June 17, 2003

Aaarggh ... disregard the previous post. Didn't follow the links above. Sorry.

Just me (Sir to you)
Tuesday, June 17, 2003

Actually Simon,

The guy was Heisenberg, rather that Heisenbug. I think of it more as a joke:

Heisenberg + bug = Heisenbug !

Maxime Labelle
Tuesday, June 17, 2003

BTW, Simon, I don't see this as an attempt at false erudition - I see it as an honest piece of language art - one term that communicates a volume of meaning.

And a software geek who doesn't understand the Heisenberg reference, well... hmph.

Philo

Philo
Tuesday, June 17, 2003

Simon, just put on some very DARK sunglasses. They won't help you see the screen any easier but at least nobody will notice that you have dozed off 8-)

zzz
Tuesday, June 17, 2003

Getting real Heisenbugs now. Time to break out the logfiles.

Actually, Heisenbugs in the sense of things not working under Release that do in Debug are fairly common. As are bugs that only occur on a machine you didn't test on yourself. Especially if said machine runs Windows 9x.

Better Than Being Unemployed...
Wednesday, June 18, 2003

*  Recent Topics

*  Fog Creek Home