Unknown runtime error 202

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Unknown runtime error 202

Wolfram Kläger
I had this error two or three times these days. I managed to get rid of it by moving a local method variable to a field. Example:

class.method
var
 d3 : array[ .., .., ..] of ...
begin
...

Works, if length(d3) < unknown limit. When I get the unknown runtime error 202 instead,  I rearrange d3 to

... class
private
 Fd3 : array ...

Then it works again. Apparently for unlimited array sizes. But what is the secret, where is the limit? And if this secret / limit is known, why the error is not?

Regards
Wolfram

P.S. I do love all fpc warnings and hints too. Except [file variable] does not seem to be initialized. So far the only situation, where I am used to wrap a statement in {$HINTS OFF} .. {$HINTS ON}
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Vinzent Höfler
Wolfram Kläger wrote:
> I had this error two or three times these days. I managed to get rid
 > of it by moving a local method variable to a field. Example:
>
> class.method
> var
>  d3 : array[ .., .., ..] of ...
> begin
> ...
>
> Works, if length(d3) < unknown limit. When I get the unknown runtime
 > error 202 instead,  I rearrange d3 to
>
> ... class
> private
>  Fd3 : array ...
>
> Then it works again. Apparently for unlimited array sizes. But what is
 > the secret, where is the limit? And if this secret / limit is known,
 > why the error is not?

Well, I don't know why exactly it is displayed as "Unknown runtime
error", but I hit that several times myself. Fortunately I still
remember the good old Turbo Pascal days, where number 202 was a stack
overflow error, and from my findings - when it happened to my code - it
still is. Highly recursive routines with a wrong or even missing
termination condition have never been a good idea. ;)

To answer your question: According to the documentation, the size of the
local variables (allocated on the stack) should not exceed 32 KiBytes
for portability reasons. So if you need more, it just depends on how
much the target architecture is able to supply.

So it's probably a better idea to allocate anything larger than that
from the heap.


Vinzent.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Wolfram Kläger
In reply to this post by Wolfram Kläger
Vinzent wrote:
> .. According to the documentation, the size of the
> local variables (allocated on the stack) should not exceed 32 KiBytes
> for portability reasons.

Thanks a lot. And I thought, I did RTFM often enough ...

BTW, do you know why exceptions donŽt return a line number? As I understand it, the except clause can return everything I want, when an exception occurs. I wished the compiler would throw the line number in addition to e.Classname and e.Message automatically.

Wolfram
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Vinzent Höfler
On Thursday 27 July 2006 12:05, Wolfram Kläger wrote:
> Vinzent wrote:
> > .. According to the documentation, the size of the
> > local variables (allocated on the stack) should not exceed 32
> > KiBytes for portability reasons.
>
> Thanks a lot. And I thought, I did RTFM often enough ...
>
> BTW, do you know why exceptions donŽt return a line number?

Because you forgot to include the "-gl" switch for automatically
including the line info unit?

If you do that, the backtrace usually consists of procedure names and
line numbers instead of just addresses.


Vinzent.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Wolfram Kläger
In reply to this post by Wolfram Kläger
Vinzent wrote:
> > BTW, do you know why exceptions donŽt return a line number?
>
> Because you forgot to include the "-gl" switch for automatically
> including the line info unit?

As I understand it, this option is only helpful when you are struggling with the debugger. My question is: What is the problem to throw the line number on the console as well as e.message, e.classname and everything else specified in the except clause, e.g. the contents of a local variable named LastLineDone?

Wolfram
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Michael Van Canneyt


On Thu, 27 Jul 2006, Wolfram Kläger wrote:

> Vinzent wrote:
>>> BTW, do you know why exceptions don?t return a line number?
>>
>> Because you forgot to include the "-gl" switch for automatically
>> including the line info unit?
>
> As I understand it, this option is only helpful when you are struggling with the debugger.

No. It is also meant for adding more information to the exception backtrace.

> My question is: What is the problem to throw the line number on the console as
> well as e.message, e.classname and everything else specified in the except
> clause, e.g. the contents of a local variable named LastLineDone?

Because you need the debug information for that. Hence the -gl switch.
It adds a HUGE amount of data to your executable, which is why it is not
included by default.

FileName/Linenumber info is only available through debug information.
It's not an interpreted language, but compiled language.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Burkhard Carstens-3
In reply to this post by Wolfram Kläger
Am Donnerstag, 27. Juli 2006 15:15 schrieb Wolfram Kläger:

> Vinzent wrote:
> > > BTW, do you know why exceptions donŽt return a line number?
> >
> > Because you forgot to include the "-gl" switch for automatically
> > including the line info unit?
>
> As I understand it, this option is only helpful when you are
> struggling with the debugger. My question is: What is the problem to
> throw the line number on the console as well as e.message,
> e.classname and everything else specified in the except clause, e.g.
> the contents of a local variable named LastLineDone?

The program needs to *know* the linenumber, otherwise it can't tell you.
That's what option -gl is for: include linenumbers into executable.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unknown runtime error 202

Wolfram Kläger
In reply to this post by Wolfram Kläger

Michael wrote:
> .. FileName/Linenumber info is only available through debug information.
> It's not an interpreted language, but compiled language.

Thanks for explanation.

Wolfram
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal