I love computers

Joel and by "I love computers", I mean "I hate computers."

Well, I was going to release a beta version of the new Base Logic Generator tonight because the major parts of the code are pretty much done. However, when I compiled a release build of the code, I suddenly have an illegal operation when writing settings to the registry. This illegal operation didn't exist in the debug build, and since it's a release build without debugging info the process of localizing the error is a painful one, especially since the problem area seems to be something I did prior to where the error actually occurs (it actually occurs on the return from a function call, even though I don't remember writing it so that anything would get destroyed on return from the function). So, basically, look for a new release of the BLG some time in the next couple of days. If I don't figure out this stupid registry problem, I'll just save settings to a file for this release.
Joel sweet...after banging my head for several hours (not really...more like ten minutes before I noticed my head was starting to hurt), I finally, realized I was doing a strncpy with a string that I had declared 1 byte too small. I don't know why it was waiting till the function was done to cause a problem, but I think I've finally got the stupid thing. Unfortunately, I'm now too tired to worry about packaging the BLG up tonight, so I'll do it tomorrow, after some more testing to make sure I didn't make any more boneheaded mistakes like that.
sonneveld I once wrote a strdupa (duplicates a string to the stack) macro that added one to the buffer pointer instead of the buffer size.

Considering this was used throughout the program for a while, I'm surprised my program held together for so long.

- Nick
Joakim
Joel wrote:

and by "I love computers", I mean "I hate computers."

Well, I was going to release a beta version of the new Base Logic Generator tonight because the major parts of the code are pretty much done. However, when I compiled a release build of the code, I suddenly have an illegal operation when writing settings to the registry. This illegal operation didn't exist in the debug build, and since it's a release build without debugging info the process of localizing the error is a painful one, especially since the problem area seems to be something I did prior to where the error actually occurs (it actually occurs on the return from a function call, even though I don't remember writing it so that anything would get destroyed on return from the function). So, basically, look for a new release of the BLG some time in the next couple of days. If I don't figure out this stupid registry problem, I'll just save settings to a file for this release.


Hehe. Just as the import bug you filed. I did not notice it in the debug, but it crashed in the release build.. You've got to keep a good control of your arrays! ;)

/ Joakim
Joel the crazy thing is that the error didn't cause any problems in debug mode. The only thing I can think of is that maybe there was some extra debugging info in there that it was overwriting in the debug build and the release build took that out so I was overwriting some important part of the activation record or something. I can't say I've ever had any bugs happen to me like that before.

It was a difficult thing to debug, too, because of course I couldn't step through my code. I was putting tracing statements in there and they were all coming up, even the one that said, "About to return from the function". It wasn't until I decided to comment out one statement at a time that I figured out what the heck was going on.
sonneveld That's what I hate about memory errors.. they occurs any old time.. depending on how everything is laid out in memory.

- Nick