Fatal floating point exception
Closed / Fixed218847ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:06:34
OriginalBugID: 2376 Bug
Version: 8.2b1
SubmitDate: '1999-07-16'
LastModified: '1999-07-16'
Severity: CRIT
Status: Released
Submitter: techsupp
ChangedBy: redman
OS: Other
OSVersion: Linux (RedHat 5.1) on Alpha XL-300
Machine: NA
FixedDate: '1999-07-16'
ClosedDate: '2000-10-25'
Name:
Don Porter
Comments:
When 'configure' finds -lieee and causes tclsh to be linked with it,
it also needs to compile with the -mieee option to gcc on DEC Alpha
platforms. Otherwise FPEs are fatal.
Apply the patch to aclocal.m4 and rerun autoconf to generate a
'configure' which sets up the required -mieee option in the
Makefile.
It's not clear to me what role the file unix/tcl.m4 plays, so I
left it alone.
This may not be the best fix. gcc documentation says -mieee will
slow down floating point operations. But it stops the crash
diagnosed above.
This problem only appeared with the 8.2b1 release of Tcl because
it coincides with an upgrade at Scriptics from autoconf-2.9 to
autoconf-2.13 to generate the 'configure' files distributed with
Tcl. autoconf-2.9 was buggy, so it never found -lieee and this
problem didn't occur. tclsh runs fine if the -lieee library is
omitted. That would probably be a better fix, but somewhat trickier
to develop as a patch without implications for other platforms
that I can't test.
ObservedBehavior:
$ ./configure --enable-symbols --disable-shared
...
checking for main in -lieee... yes
...
$ make
$ gdb ./tclsh
...
(gdb) run
...
% expr acos(-2.0)
Program received signal SIGFPE, Arithmetic exception.
0x12006b60c in ExprUnaryFunc (interp=0x1201e4060, eePtr=0x1201e44e0,
clientData=0x15555784260) at ./../generic/tclExecute.c:3451
3451 if ((errno != 0) || IS_NAN(dResult) || IS_INF(dResult)) {
(gdb) info stack
#0 0x12006b60c in ExprUnaryFunc (interp=0x1201e4060, eePtr=0x1201e44e0,
clientData=0x15555784260) at ./../generic/tclExecute.c:3451
#1 0x1200697d0 in TclExecuteByteCode (interp=0x1201e4060,
codePtr=0x12020a670)
at ./../generic/tclExecute.c:2439
#2 0x12002e294 in Tcl_EvalObjEx (interp=0x1201e4060,
objPtr=0x1201f2b70,
flags=0) at ./../generic/tclBasic.c:2698
#3 0x120075a10 in Tcl_RecordAndEvalObj (interp=0x1201e4060,
cmdPtr=0x1201f2b70, flags=0) at ./../generic/tclHistory.c:142
#4 0x12000d648 in Tcl_Main (argc=1, argv=0x11ffff850,
appInitProc=0x12000ce80 <Tcl_AppInit>) at
./../generic/tclMain.c:236
#5 0x12000ce58 in main (argc=1, argv=0x11ffff850) at
./../unix/tclAppInit.c:83
DesiredBehavior:
No crashes evaluating Tcl scripts.
Patch:
Index: aclocal.m4
===================================================================
RCS file: /cvsroot/tcl/unix/aclocal.m4,v
retrieving revision 1.6
diff -c -r1.6 aclocal.m4
*** aclocal.m4 1999/06/19 00:18:42 1.6
--- aclocal.m4 1999/07/15 23:26:06
***************
*** 713,718 ****
--- 713,721 ----
LDFLAGS=""
LD_SEARCH_FLAGS=""])
fi
+ if test "`uname -m`" = "alpha" ; then
+ EXTRA_CFLAGS="-mieee"
+ fi
;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
PatchFiles:
unix/aclocal.m4
Fixed in 8.2b2
-- 07/16/1999 redman
welch Closed ticket [218847ffff].
[History diff]2000-10-26 08:30:13
dgp Ticket [218847ffff]: 3 changes
[History diff]2001-04-18 21:39:53
Log in (anonymous is fine) to add a comment.