Author Topic: I love computers  (Read 1760 times)

0 Members and 1 Guest are viewing this topic.

Offline Joel

I love computers
« on: April 22, 2002, 11:36:41 PM »
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.



Offline Joel

Re:I love computers
« Reply #1 on: April 22, 2002, 11:54:42 PM »
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.

Offline Nick Sonneveld

Re:I love computers
« Reply #2 on: April 23, 2002, 12:01:46 AM »
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
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Joakim

Re:I love computers
« Reply #3 on: April 23, 2002, 07:25:00 AM »

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

Offline Joel

Re:I love computers
« Reply #4 on: April 23, 2002, 02:59:35 PM »
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.

Offline Nick Sonneveld

Re:I love computers
« Reply #5 on: April 23, 2002, 08:10:10 PM »
That's what I hate about memory errors.. they occurs any old time.. depending on how everything is laid out in memory.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.033 seconds with 20 queries.