[Lazarus] What's "External: SIGFPE"?

Xiangrong Fang xrfang at gmail.com
Thu Mar 7 10:04:13 CET 2013


2013/3/7 leledumbo <leledumbo_cool at yahoo.co.id>


> Because setting the mask means telling the processor to generate (or not to
> generate? I forgot) SIGFPE for the given operations. e.g. exZeroDivide may
> trigger SIGFPE if there's a division by zero with floating point operation.
> How to trace? You already get it, the program will report the line that
> causes it, you can directly go to the respective line to see what happens.
> But this requires that the code lies in the program space (not in external
> library) and the code is compiled with runtime error backtrace (-gl).
> Otherwise, the program can only report as deep as it can find.
>

I don't understand:

1) even if I set the masks, why an empty LCL application generate SIGFPE?
It means that somewhere GTK or whatever library *indeed* do things like
1/0, only that they are normally hidden/not reported?

2) I already found the problem in my code which is a like look like:

*if tbLog.Down then Y := exp(Y);*

And Y is a big number e.g. 2500, which caused floating point overflow.
The problem was that the number itself should be Log()ed, so that exp()
only restore its original value.   That was my bug, but the weird thing is
that SIGFPE is generated in unit LCLType on the line that set font height,
which is very innocent, and after I commented out the font.Height
operation, the SIGFPE slipped to somewhere else, but NEVER on the line that
generated it!

Could you explain why? and how to locate where the SIGFPE occurred?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130307/444d86ff/attachment-0003.html>


More information about the Lazarus mailing list