Get your own customer support community
 

TIDE - INTERNAL COMPILER ERROR

*** THIS IS SERIOUS ***
My most recent project has grown to more than 150KB. today, after a few changes, I pressed F7 to rebuild and TIDE reported: "Internal Compiler Error". Just that.

I know that someone will suggest me to send the source files to Tibbo, so someone can check what may be causing the problem...however, like TIBBO, I too want to protect my intelectual property! Needless to say, my source files won't leave my computer.
I think it would be much better if the compiler could identify the problem, giving a proper error message - the current one is useless, ok, it warns us that something is not right: what???

And so my project has come to a sudden halt...

I'll try to reload my previous files, so I can recompile, then I'll try to check what caused the problem...
It won't be easy, and TIDE's error message doesn't help: "Guess what: Internal Compiler Error! eh eh eh"

Sincerely, I'm very worried.
 
sad I’m VERY WORRIED
Inappropriate?
1 person has this problem

  • Inappropriate?
    Dear Alex,

    I'm sorry for this error. Our main TIDE developer stepped in to explain and give some tips:

    "First, let me explain this INTERNAL COMPILER error.
    When the compiler sees error in user code, it reports the faulty source file, line, error code and description. But when an error occures in compiler itself, it has no choice but silently to crash -- and this INTERNAL COMPILER ERROR is just a stub to notify the user that the user's source code managed to crash the compiler itself.

    Of course, this is the compiler's fault -- it should not crash on any input. I feel sorry about that, but you know all the programs have bugs, I sometimes get such INTERNAL COMPILER errors even with MS Visual Studio.

    Now, what to do:

    Of course the simpliest and the fastest way is to send us the source project -- we give our word we will not use this source code for any purpose other than locating error in compiler. This way we can promise we will produce fixed TIDE in one day. We even can delete user's code from our computers as soon as we are done.

    However, if the customer really cannot send us the code, here are some clues on how to resolve this situation.

    He needs to try and locate the portion of the source file that causes the compiler to crash. Usually -- not always, but most of the time -- INTERNAL COMPILER error happens when the user's source code contains an error which the compiler fails to gracefully recover from.

    What has been added recently -- right after the project was compiling successfully and before it started to crash?

    Eliminate portions of source code from compiling (deleting, commening of #ifdef'ing them out) -- I use this technique all the time when I need to find a faulty piece of code (I mean, yes I have all the debuggers I need, but sometimes stepping through simply stops some timing or sincronization bug from happening, or the bug happens in release build only. And yes, I use this technique when I encounter INTERNAL COMPILER ERROR of Visual Studio itself).

    Possibly, by doing so he will find the part in his source code which causes the problem -- then PLEASE send description of this mistake to us because we want to enable the compiler to deal with it gracefully."

    Can you try these suggestions?
  • p.alex
    Inappropriate?
    Dear Ezuk,
    Here's the offending portion of code, I marked the line with "-->"
    (of course I remove that mark before compiling!)

    ...

    Function OpenSky2_StrToCounters( CountersStr as string(sizeof(TOpenSky2_Counters)), byref CountData as TOpenSky2_Counters ) as ok_ng
    dim i as byte

    if len(CountersStr) <> sizeof(TOpenSky2_Counters) then
    OpenSky2_StrToCounters = NG
    exit function
    end if
    CountData.CardCap = asc4(left(CountersStr, 4))
    CountData.CardIss = asc4(mid(CountersStr, 5,4))
    CountData.CardLoad = asc4(mid(CountersStr, 9,4))
    CountData.CardRej = asc4(mid(CountersStr, 13,4))
    CountData.CardRet = asc4(mid(CountersStr, 17,4))
    CountData.Receipts = asc4(mid(CountersStr, 21,4))
    CountData.VouchCnt = asc4(mid(CountersStr, 25,4))
    CountData.VouchVal = asc4(mid(CountersStr, 29,4))
    for i= 0 to BILL_TYPES-1
    --> CountData.BillStacker(1)= asc2(mid(CountersStr, i*2+33, 2))
    next i
    OpenSky2_StrToCounters = OK
    end function

    ...

    Notes:
    * when compiling, the compiler crashes with the message "Internal Compiler Error"
    * no linking took place
    * when I comment the marked line, everything compiles and links perfectly
    * FYI, this function extracts data from a string into a structure - a simple task
    * asc4() is similar to asc() but works with a 4-char string - fully tested
    * sizeof() seems to be an undocumented Taiko function - we discovered it in the latest version of TIDE, works Ok
    * just to be on the safe side, we replaced sizeof(...) with 42 - the actual size of the structure - same result
    * TOpenSky2_Counters is a structure, as follows:

    type TOpenSky2_Counters
    BillStacker(BILL_TYPES+1) as word
    CardIss as dword
    CardRet as dword
    CardCap as dword
    CardRej as dword
    CardLoad as dword
    Receipts as dword
    VouchCnt as dword
    VouchVal as dword
    end type

    * BILL_TYPES equals 4, I replaced BILL_TYPES+1 with 5, same result.
    * I tried moving the offending line to the top of the function, same result
    * A similar piece of code, placed in another module, produces no error.

    Of course this is a very small piece of a large project, envolving a few modules and libraries currently, the size of the compiled binary is 154880 bytes - pretty good.

    See what you can do with these clues.
    Thank you.
     
    indifferent I’m a little less worried, but still worried
  • p.alex
    Inappropriate?
    One more clue:

    My application calls this function once only. So, I commented the call and I copied the whole function code to the place where the call took place.
    The result? It worked Ok - the application still has its own bugs, but TIDE compiled and linked everything perfectly.

    Can this help?

    Just a few more questions:

    1- Is there a limit to the number of Functions, Subs, Types (structures), Variables, Arrays, Constants, etc, one can declare in a whole project - all modules and include files included? TIDE's manual doesn't mention these.

    2- Is there a limit to the number of variables a Type can contain? idem

    3- Is there a limit to the number of nested calls the program can execute? idem

    4- In this same application we had a problem when the application grew - more or less at application size= 100KBytes and Stack size > 50 bytes - the linking time grew to more than 10 MINUTES!!! We had to duplicate code to avoid more levels of function/sub calls - a terrible way of coding!!! The linking time now is 20 seconds - not very good, but a lot better than 10 minutes! Smaller applications I developped link in almost no time - 1, 2 seconds maybe.

    That's all.
     
    silly I’m confused... I think.
  • Inappropriate?
    Hi Alex,

    Thanks again for finding this bug and for the very detailed feedback! We have a bugfix for you. But it's really for you -- it is not a version we're releasing yet because it contains some new features.

    We would like you to test it with the whole project (we had just the snippet to work with) and tell us if it works.

    Please email me to ezuk at tibbo dot com and I will send you a direct download link. Please do not share it for now.
     
    happy
  • p.alex
    Inappropriate?
    Hi Ezuk,

    Thanks for the bug fix - it worked, so it seems. I uncommented the error causing lines and no error happened :)
    However, you still haven't answered my questions about TIDE's limits - number of variables, number/size of types, sub/functions call depth, etc :(
    I think that could be helpful - TIDE has such limits, hasn't it??? Or TIDE's perfomance is just limited by available RAM?

    Thanks for the bugfix. Just one issue - the long linking times still remain, current version of our application takes 20 seconds to link. TIDE reports:

    -> Application file size: 157824 bytes
    -> Required variable memory (RAM) size: 10114 bytes
    -> Stack size: 48 bytes

    Is this time normal? Are executing too many nested sub/function calls?

    *** Just among us, what was causing the "Internal Compiler Error"? I promise not to tell anyone... ***

    Thanks.
     
    happy I’m kind of confident
User_default_medium