[cfe-dev] SIGFPE received when a program is compiled with Clang but not with GCC

Shriramana Sharma via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 18 02:15:58 PST 2015


Hello. I'm using Clang 3.7~svn251177-1~exp1 from the Apt repo on
Kubuntu Trusty 64 bit. I'm trying to backport Asymptote from Debian
Sid: https://packages.debian.org/sid/asymptote

I find that the build fails with:

../asy -dir ../base -config "" -render=0 -f pdf -noprc filegraph.asy
../base/plain_Label.asy: 294.10: runtime: Floating point exception (core dumped)

When I investigated this I found that there was no problem when
compiling with GCC.

Please note the attached script which should demonstrate the error.
Running the script with -g will compile using the "default" compiler
(gcc) and does not produce any error.

I used KDbg to debug the situation i.e. run the executable asy with
the given arguments which produced the error during the build and
found that at pair.h, line 148 reads:

if(scale != 0.0) scale=1.0/scale;

but it is at this point that despite the if() check, during one
particular invocation to pair unit(const pair&), somehow the program
is trying to do the division and getting the error.

Note that for some reason during debugging I keep getting SIGPWR,
SIGXCPU etc – I don't know why this is but it is perhaps because asy
implements a virtual machine which does not support debugging or such?
Anyhow, repeatedly trying to run the executable with the given
arguments produces the error in the end.

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asymptote-compilation-bug.sh
Type: application/x-sh
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151118/dc63eb49/attachment.sh>


More information about the cfe-dev mailing list