FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

FB II COMPILER

Be careful with big projects



If it'll make you feel any better to have corroboration, Lucy, I have encountered a very similar problem, and I in fact eventually concluded that it was an FB bug. In my case, there were some 13000 lines of code, and the problem manifested itself initially in a SELECT block, showing symptoms pretty much identical to what you indicated. Interestingly, the SELECT block was added early in the project, and worked flawlessly _until_ the code (in other parts of the program) grew beyond a certain "critical" (but indefinite) size. After tearing my hair for a while, I eventually examined closely the machine language instructions that FB was generating, and found that it was doing some very, very bad things in the middle of an innocent SELECT block--things like branching into the _middle_ of a machine-language instruction, rather than into its beginning.

I sent a letter with a detailed, annotated machine-language listing to Andy Gariepy when this happened (a couple of years ago), and he said he would look into it. I never heard back from him; my guess is that he recognized that FB wasn't _supposed_ to generate that code, but that he was unable to duplicate the problem (_I_ couldn't duplicate it in any _small_ program), and that he eventually chalked it up as an Unsolved Mystery.

For my own part, I eventually got the problem to stop happening by breaking up the code into a large number of INCLUDE files. The bug never resurfaced in that project nor any other; but then again none of the others has been that big. Other people have reported creating much bigger projects with no problem. My feeling is that this is an intermittent and very elusive bug, but that it's definitely FB's fault.
(No jab at Staz intended; intermittent and elusive bugs exist in all software, and are by definition the hardest to verify and to fix.)

Rick


<< If it'll make you feel any better to have corroboration, Lucy, I have encountered a very similar problem, and I in fact eventually concluded that it was an FB bug. >>

No that I think about it, this sounds a lot like a mysterious problem I had about 2 years ago... It would mysteriously crash at a totally innocent- looking line of code.
After re-writing the code, trying to fix the problem, the problem would move to a nearby also-innocent line of code. The fatal crash was essentially located at a specific location in the compiled code, and it did not matter what actual line of source code lived at that location. I also complained about it but got no helpful answers.

<< For my own part, I eventually got the problem to stop happening by breaking up the code into a large number of INCLUDE files. The bug never resurfaced in that project nor any other... >>

I have had this same type of bug resurface, but much later and in different include files (but on the same project). It seems to occur whenever an include file gets very close to its 32K compiled-code-size limit. Try doing a Trial Compile and see how big the code segment is (with the troublesome include file inside). If it's more than say about 30K, then I bet that's the source of the problem. Break up your segment into smaller segments (or your include file into smaller includes, if it's a 1-include segment). As long as they're less than about 30K, this problem never seems to surface.
If you reach the 32K segment limit, then FB's compiler complains about it. If you get really close to the limit, without exceeding it however, then all sorts of mysterious (typically fatal) bugs appear in innocent-looking code for no obvous reason.

Break up ANY code segment more than about 30K... OR RISK FATAL BUGS in innocent code !!!

<< (No jab at Staz intended; intermittent and elusive bugs exist in all software, and are by definition the hardest to verify and to fix.)
Rick >>


Well said. Most similiar fatal bugs have turned out to be my own foolishness. Intermittent bugs are the worst kind because you cannot force them to occur while you are actively debugging and watching for them. There's NOTHING more boring than watching your program work perfectly for hours, patiently watching every line of code go by for the gazillionth time... without any hint of the amazing color-flashing sound-squawking bug that occurred every 30 seconds before you tried using the debugger to find it. I am very happy that FB2 works as well as it does. Thanks Staz and Company.

David Herron