Hi,

On my x86_64 machine with gcc 4.4.5 (Debian squeeze),
current EMC 2.5 git crashes for me on G3 operations with a realtime fault:

[  440.161663] RTAPI: Task 1[ffff88007c5f3800]: Fault with vec=13, signo=11 
ip=ffffffffa0031142.
[  440.161666] RTAPI: This fault may not be recoverable without rebooting.
[  440.161667] RTAPI: Task 2[ffff88007c775000]: Fault with vec=14, signo=11 
ip=ffffffffa00a6279.
[  440.161668] RTAPI: This fault may not be recoverable without rebooting.

EMC 2.4 works fine, though. So I bisected the issue. The following
commit breaks EMC 2.5 on my machine:

2e7d4506a65e3a5d157533d5887aee47a65b3a09
Author: Jeff Epler <[email protected]>  2010-11-23 21:06:20
Committer: Jeff Epler <[email protected]>  2010-11-30 05:03:55
    build: we want sane math

This commit introduces various floating point related options.
Tests showed, that reverting the -ffast-math and -fno-unsafe-math-optimizations
changes fixes the issue for me (both have to be reverted to fix it):

Index: emc2-git-2.5/src/Makefile
===================================================================
--- emc2-git-2.5.orig/src/Makefile      2011-12-20 22:00:07.000000000 +0100
+++ emc2-git-2.5/src/Makefile   2011-12-20 22:08:14.000000000 +0100
@@ -615,13 +615,13 @@
 # "kbuild" system.  $(BASEPWD) is used here, instead of relative paths, because
 # that's what kbuild seems to require
 
-EXTRA_CFLAGS = $(filter-out -ffast-math,$(RTFLAGS)) -D__MODULE__ -I$(BASEPWD) 
-I$(BASEPWD)/libnml/linklist \
+EXTRA_CFLAGS = $(RTFLAGS) -D__MODULE__ -I$(BASEPWD) 
-I$(BASEPWD)/libnml/linklist \
        -I$(BASEPWD)/libnml/cms -I$(BASEPWD)/libnml/rcs 
-I$(BASEPWD)/libnml/inifile \
        -I$(BASEPWD)/libnml/os_intf -I$(BASEPWD)/libnml/nml 
-I$(BASEPWD)/libnml/buffer \
        -I$(BASEPWD)/libnml/posemath -I$(BASEPWD)/rtapi -I$(BASEPWD)/hal \
        -I$(BASEPWD)/emc/nml_intf -I$(BASEPWD)/emc/kinematics 
-I$(BASEPWD)/emc/motion \
         -DSEQUENTIAL_SUPPORT -DHAL_SUPPORT -DDYNAMIC_PLCSIZE -DRT_SUPPORT 
-DOLD_TIMERS_MONOS_SUPPORT -DMODBUS_IO_MASTER \
-       -fno-fast-math $(call cc-option,-mieee-fp) 
-fno-unsafe-math-optimizations \
+       $(call cc-option,-mieee-fp) \
        $(call cc-option,-Wframe-larger-than=2560)
 ifeq ($(RTARCH),x86_64)
 EXTRA_CFLAGS += -msse
Index: emc2-git-2.5/src/Makefile.modinc.in
===================================================================
--- emc2-git-2.5.orig/src/Makefile.modinc.in    2011-12-20 22:00:22.000000000 
+0100
+++ emc2-git-2.5/src/Makefile.modinc.in 2011-12-20 22:08:32.000000000 +0100
@@ -39,7 +39,7 @@
 
 KERNELDIR := @KERNELDIR@
 CC := @CC@
-RTFLAGS = $(filter-out -ffast-math,@RTFLAGS@ @EXT_RTFLAGS@) -fno-fast-math 
$(call cc-option,-mieee-fp) -fno-unsafe-math-optimizations
+RTFLAGS = @RTFLAGS@ @EXT_RTFLAGS@ $(call cc-option,-mieee-fp)
 RTFLAGS := -Os -g -I. -I@RTDIR@/include $(RTFLAGS) -DRTAPI -D_GNU_SOURCE 
-Drealtime -D_FORTIFY_SOURCE=0
 ifeq ($(RTARCH),x86_64)
 EXTRA_CFLAGS += -msse


While I understand that we want to avoid -ffast-math and friends,
I think it probably is a bad idea to compile rtai with -ffast-math and EMC
with -fno-fast-math, because this option introduces ABI changes. Probably
not a good idea for code that is linked together. -ffast-math also defines
the __FAST_MATH__ preprocessor macro, which changes ABI in math headers.

-- 
Greetings, Michael.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to