Floating Point Ex running any C++ - Linux

This is a discussion on Floating Point Ex running any C++ - Linux ; Using Fedora Core 6: I cannot run rpm or yum any longer due to "Floating Point Exception". In fact I cannot run the simplest c++ as it turned out when compiling a small test program. I can compile it OK, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Floating Point Ex running any C++

  1. Floating Point Ex running any C++

    Using Fedora Core 6:
    I cannot run rpm or yum any longer due to "Floating Point Exception".
    In fact I cannot run the simplest c++ as it turned out when compiling a

    small test program.
    I can compile it OK, but not run it.

    Running it gives me:
    Floating point exception


    Running the same binary on another machine works OK!!


    I have recently upgraded to FC6 and uninstalled lots of X, KDE and
    Gnome - packages with yum removepackage as I wanted the machine to be a

    console-only server. Until then all worked fine.


    Can someone tell me by looking at the strace-outputs of the small
    program below, if I am missing libraries and how to get them back?


    For comparison, I added
    a) the source of the test-program (conftest.cc)
    b) the strace on the broken machine
    c) the strace of the same binary on another machine (fc4) - where it
    works


    Thank you very much,
    Reinhard


    a) source of test-file ==========================


    [root@www ~]# vi /mnt/intra/root/conftest.cc
    /* confdefs.h. */


    #define PACKAGE_NAME "rpm"
    #define PACKAGE_TARNAME "rpm"
    #define PACKAGE_VERSION "4.4.2"
    #define PACKAGE_STRING "rpm 4.4.2"
    #define PACKAGE_BUGREPORT "rpm-de...@lists.dulug.duke.edu"
    #define PACKAGE "rpm"
    #define VERSION "4.4.2"
    /* end confdefs.h. */


    int
    main ()
    {


    ;
    return 0;



    }


    =========================================

    b) strace on broken machine ====================


    [root@intra ~]# strace -f -F -o /tmp/log /root/a.out


    8918 execve("/root/a.out", ["/root/a.out"], [/* 26 vars */]) = 0
    8918 brk(0) = 0x976b000
    8918 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
    directory)
    8918 open("/etc/ld.so.cache", O_RDONLY) = 4
    8918 fstat64(4, {st_mode=S_IFREG|0644, st_size=55798, ...}) = 0
    8918 mmap2(NULL, 55798, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7fd2000
    8918 close(4) = 0
    8918 open("/usr/lib/libstdc++.so.6", O_RDONLY) = 4
    8918 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20 0\310"..., 512) =
    512
    8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=933676, ...}) = 0
    8918 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fd1000
    8918 mmap2(NULL, 960132, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x2c7000
    8918 mmap2(0x3a7000, 20480, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xdf) = 0x3a7000
    8918 mmap2(0x3ac000, 22148, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3ac000
    8918 close(4) = 0
    8918 open("/lib/libm.so.6", O_RDONLY) = 4
    8918 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p3\ 0\000"..., 512) =
    512
    8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=197856, ...}) = 0
    8918 mmap2(NULL, 147568, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xaec000
    8918 mmap2(0xb0f000, 8192, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x22) = 0xb0f000
    8918 close(4) = 0
    8918 open("/lib/libgcc_s.so.1", O_RDONLY) = 4
    8918 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\2 7\0\000"..., 512) =
    512
    8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=45008, ...}) = 0
    8918 mmap2(NULL, 48068, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xc5c000
    8918 mmap2(0xc67000, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xa) = 0xc67000
    8918 close(4) = 0
    8918 open("/lib/libc.so.6", O_RDONLY) = 4
    8918 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\nV \1\000"..., 512) =
    512
    8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=1529392, ...}) = 0
    8918 mmap2(NULL, 1254812, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x8aa000
    8918 mmap2(0x9d7000, 12288, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x12d) = 0x9d7000
    8918 mmap2(0x9da000, 9628, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x9da000
    8918 close(4) = 0
    8918 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fd0000
    8918 set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fd08e0,
    limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
    limit_in_pages:1, seg_not_present:0,


    useable:1}) = 0
    8918 --- SIGFPE (Floating point exception) @ 0 (0) ---
    8918 +++ killed by SIGFPE +++
    /tmp/log (END)


    c) strace of same binary working on another machine
    ===================================


    [root@www ~]# strace -f -F -o /tmp/log /mnt/intra/root/a.out
    [ Process PID=14631 runs in 32 bit mode. ]
    [root@www ~]# cat /tmp/log
    14631 execve("/mnt/intra/root/a.out", ["/mnt/intra/root/a.out"], [/* 25

    vars */]) = 0
    14631 brk(0) = 0x804a000
    14631 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7ffd000
    14631 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
    directory)
    14631 open("/usr/X11R6/lib64/tls/i686/sse2/libstdc++.so.6", O_RDONLY) =

    -1 ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/i686/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/sse2/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/libstdc++.so.6", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/i686/sse2/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/i686/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/sse2/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No

    such file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/sse2/libstdc++.so.6", O_RDONLY) =
    -1 ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/sse2/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/i686/sse2/libstdc++.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/i686/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/sse2/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/etc/ld.so.cache", O_RDONLY) = 4
    14631 fstat64(0x4, 0xffb68af0) = 0
    14631 old_mmap(NULL, 137591, PROT_READ, MAP_PRIVATE, 4, 0) =
    0xfffffffff7fdb000
    14631 close(4) = 0
    14631 open("/usr/lib/libstdc++.so.6", O_RDONLY) = 4
    14631 read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0
    (B\000"..., 512) = 512
    14631 fstat64(0x4, 0xffb68b6c) = 0
    14631 old_mmap(0x3e3000, 912984, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x3e3000
    14631 old_mmap(0x4b8000, 20480, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xd5000) = 0x4b8000
    14631 old_mmap(0x4bd000, 20056, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4bd000
    14631 close(4) = 0
    14631 open("/usr/X11R6/lib64/tls/i686/sse2/libm.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/i686/libm.so.6", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/sse2/libm.so.6", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/libm.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib64/i686/sse2/libm.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/i686/libm.so.6", O_RDONLY) = -1 ENOENT (No

    such file or directory)
    14631 open("/usr/X11R6/lib64/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No

    such file or directory)
    14631 open("/usr/X11R6/lib64/libm.so.6", O_RDONLY) = -1 ENOENT (No such

    file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/sse2/libm.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/libm.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/sse2/libm.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/libm.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/i686/sse2/libm.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/i686/libm.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/libm.so.6", O_RDONLY) = -1 ENOENT (No such
    file or directory)
    14631 open("/lib/libm.so.6", O_RDONLY) = 4
    14631 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20 \343"..., 512) = 512

    14631 fstat64(0x4, 0xffb68b50) = 0
    14631 old_mmap(0x39b000, 147616, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x39b000
    14631 old_mmap(0x3be000, 8192, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x22000) = 0x3be000
    14631 close(4) = 0
    14631 open("/usr/X11R6/lib64/tls/i686/sse2/libgcc_s.so.1", O_RDONLY) =
    -1 ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/i686/libgcc_s.so.1", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/sse2/libgcc_s.so.1", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib64/i686/sse2/libgcc_s.so.1", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/i686/libgcc_s.so.1", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/sse2/libgcc_s.so.1", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/sse2/libgcc_s.so.1", O_RDONLY) = -1

    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/libgcc_s.so.1", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/sse2/libgcc_s.so.1", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/i686/sse2/libgcc_s.so.1", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/i686/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/sse2/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/lib/libgcc_s.so.1", O_RDONLY) = 4
    14631 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20 06<\000"..., 512) =
    512
    14631 fstat64(0x4, 0xffb68b34) = 0
    14631 old_mmap(0x3c2000, 37576, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x3c2000
    14631 old_mmap(0x3cb000, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9000) = 0x3cb000
    14631 close(4) = 0
    14631 open("/usr/X11R6/lib64/tls/i686/sse2/libc.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/i686/libc.so.6", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/sse2/libc.so.6", O_RDONLY) = -1 ENOENT

    (No such file or directory)
    14631 open("/usr/X11R6/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib64/i686/sse2/libc.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib64/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No

    such file or directory)
    14631 open("/usr/X11R6/lib64/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No

    such file or directory)
    14631 open("/usr/X11R6/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such

    file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/sse2/libc.so.6", O_RDONLY) = -1
    ENOENT (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/i686/libc.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/sse2/libc.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/i686/sse2/libc.so.6", O_RDONLY) = -1 ENOENT
    (No such file or directory)
    14631 open("/usr/X11R6/lib/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No
    such file or directory)
    14631 open("/usr/X11R6/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such
    file or directory)
    14631 open("/lib/libc.so.6", O_RDONLY) = 4
    14631 read(4,
    "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\25 2\256"..., 512) =
    512
    14631 fstat64(0x4, 0xffb68b18) = 0
    14631 old_mmap(0x256000, 1215452, PROT_READ|PROT_EXEC,
    MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x256000
    14631 old_mmap(0x379000, 16384, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x122000) = 0x379000
    14631 old_mmap(0x37d000, 7132, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x37d000
    14631 close(4) = 0
    14631 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7fda000
    14631 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
    MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7fd9000
    14631 set_thread_area(0xffb69068) = 0
    14631 mprotect(0x379000, 8192, PROT_READ) = 0
    14631 mprotect(0x3be000, 4096, PROT_READ) = 0
    14631 mprotect(0x252000, 4096, PROT_READ) = 0
    14631 munmap(0xf7fdb000, 137591) = 0
    14631 exit_group(0) = ?


  2. Re: Floating Point Ex running any C++

    Hello,

    > Using Fedora Core 6:
    > I cannot run rpm or yum any longer due to "Floating Point Exception".
    > In fact I cannot run the simplest c++ as it turned out when compiling a
    >
    > small test program.
    > I can compile it OK, but not run it.
    >
    > Running it gives me:
    > Floating point exception
    >


    Does the problem persists if you link using the flags
    '-Wl,--hash-style=both' or '-Wl,--hash-style=sysv'

    HTH,
    Loic.


  3. Re: Floating Point Ex running any C++

    We found that on a fresh FC6, compile a C program and run on it gives
    us no problem, but if we move the result executable to a FC4 or RHEL4,
    it will get "Floating Point Exception" error.
    No matter how simple the program is, we always get that error.
    Strange issue.


    Sale wrote:
    > Using Fedora Core 6:
    > I cannot run rpm or yum any longer due to "Floating Point Exception".
    > In fact I cannot run the simplest c++ as it turned out when compiling a
    >
    > small test program.
    > I can compile it OK, but not run it.
    >
    > Running it gives me:
    > Floating point exception
    >
    >
    > Running the same binary on another machine works OK!!
    >
    >
    > I have recently upgraded to FC6 and uninstalled lots of X, KDE and
    > Gnome - packages with yum removepackage as I wanted the machine to be a
    >
    > console-only server. Until then all worked fine.
    >
    >
    > Can someone tell me by looking at the strace-outputs of the small
    > program below, if I am missing libraries and how to get them back?
    >
    >
    > For comparison, I added
    > a) the source of the test-program (conftest.cc)
    > b) the strace on the broken machine
    > c) the strace of the same binary on another machine (fc4) - where it
    > works
    >
    >
    > Thank you very much,
    > Reinhard
    >
    >
    > a) source of test-file ==========================
    >
    >
    > [root@www ~]# vi /mnt/intra/root/conftest.cc
    > /* confdefs.h. */
    >
    >
    > #define PACKAGE_NAME "rpm"
    > #define PACKAGE_TARNAME "rpm"
    > #define PACKAGE_VERSION "4.4.2"
    > #define PACKAGE_STRING "rpm 4.4.2"
    > #define PACKAGE_BUGREPORT "rpm-de...@lists.dulug.duke.edu"
    > #define PACKAGE "rpm"
    > #define VERSION "4.4.2"
    > /* end confdefs.h. */
    >
    >
    > int
    > main ()
    > {
    >
    >
    > ;
    > return 0;
    >
    >
    >
    > }
    >
    >
    > =========================================
    >
    > b) strace on broken machine ====================
    >
    >
    > [root@intra ~]# strace -f -F -o /tmp/log /root/a.out
    >
    >
    > 8918 execve("/root/a.out", ["/root/a.out"], [/* 26 vars */]) = 0
    > 8918 brk(0) = 0x976b000
    > 8918 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
    > directory)
    > 8918 open("/etc/ld.so.cache", O_RDONLY) = 4
    > 8918 fstat64(4, {st_mode=S_IFREG|0644, st_size=55798, ...}) = 0
    > 8918 mmap2(NULL, 55798, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7fd2000
    > 8918 close(4) = 0
    > 8918 open("/usr/lib/libstdc++.so.6", O_RDONLY) = 4
    > 8918 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20 0\310"..., 512) =
    > 512
    > 8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=933676, ...}) = 0
    > 8918 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fd1000
    > 8918 mmap2(NULL, 960132, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x2c7000
    > 8918 mmap2(0x3a7000, 20480, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xdf) = 0x3a7000
    > 8918 mmap2(0x3ac000, 22148, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3ac000
    > 8918 close(4) = 0
    > 8918 open("/lib/libm.so.6", O_RDONLY) = 4
    > 8918 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p3\ 0\000"..., 512) =
    > 512
    > 8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=197856, ...}) = 0
    > 8918 mmap2(NULL, 147568, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xaec000
    > 8918 mmap2(0xb0f000, 8192, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x22) = 0xb0f000
    > 8918 close(4) = 0
    > 8918 open("/lib/libgcc_s.so.1", O_RDONLY) = 4
    > 8918 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\2 7\0\000"..., 512) =
    > 512
    > 8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=45008, ...}) = 0
    > 8918 mmap2(NULL, 48068, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xc5c000
    > 8918 mmap2(0xc67000, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xa) = 0xc67000
    > 8918 close(4) = 0
    > 8918 open("/lib/libc.so.6", O_RDONLY) = 4
    > 8918 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\nV \1\000"..., 512) =
    > 512
    > 8918 fstat64(4, {st_mode=S_IFREG|0755, st_size=1529392, ...}) = 0
    > 8918 mmap2(NULL, 1254812, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x8aa000
    > 8918 mmap2(0x9d7000, 12288, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x12d) = 0x9d7000
    > 8918 mmap2(0x9da000, 9628, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x9da000
    > 8918 close(4) = 0
    > 8918 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fd0000
    > 8918 set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fd08e0,
    > limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
    > limit_in_pages:1, seg_not_present:0,
    >
    >
    > useable:1}) = 0
    > 8918 --- SIGFPE (Floating point exception) @ 0 (0) ---
    > 8918 +++ killed by SIGFPE +++
    > /tmp/log (END)
    >
    >
    > c) strace of same binary working on another machine
    > ===================================
    >
    >
    > [root@www ~]# strace -f -F -o /tmp/log /mnt/intra/root/a.out
    > [ Process PID=14631 runs in 32 bit mode. ]
    > [root@www ~]# cat /tmp/log
    > 14631 execve("/mnt/intra/root/a.out", ["/mnt/intra/root/a.out"], [/* 25
    >
    > vars */]) = 0
    > 14631 brk(0) = 0x804a000
    > 14631 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7ffd000
    > 14631 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
    > directory)
    > 14631 open("/usr/X11R6/lib64/tls/i686/sse2/libstdc++.so.6", O_RDONLY) =
    >
    > -1 ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/i686/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/sse2/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/sse2/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/sse2/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No
    >
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/sse2/libstdc++.so.6", O_RDONLY) =
    > -1 ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/sse2/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/sse2/libstdc++.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/sse2/libstdc++.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/etc/ld.so.cache", O_RDONLY) = 4
    > 14631 fstat64(0x4, 0xffb68af0) = 0
    > 14631 old_mmap(NULL, 137591, PROT_READ, MAP_PRIVATE, 4, 0) =
    > 0xfffffffff7fdb000
    > 14631 close(4) = 0
    > 14631 open("/usr/lib/libstdc++.so.6", O_RDONLY) = 4
    > 14631 read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0
    > (B\000"..., 512) = 512
    > 14631 fstat64(0x4, 0xffb68b6c) = 0
    > 14631 old_mmap(0x3e3000, 912984, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x3e3000
    > 14631 old_mmap(0x4b8000, 20480, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xd5000) = 0x4b8000
    > 14631 old_mmap(0x4bd000, 20056, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4bd000
    > 14631 close(4) = 0
    > 14631 open("/usr/X11R6/lib64/tls/i686/sse2/libm.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/i686/libm.so.6", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/sse2/libm.so.6", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/libm.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/sse2/libm.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/libm.so.6", O_RDONLY) = -1 ENOENT (No
    >
    > such file or directory)
    > 14631 open("/usr/X11R6/lib64/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No
    >
    > such file or directory)
    > 14631 open("/usr/X11R6/lib64/libm.so.6", O_RDONLY) = -1 ENOENT (No such
    >
    > file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/sse2/libm.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/libm.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/sse2/libm.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/libm.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/sse2/libm.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/libm.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/sse2/libm.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/libm.so.6", O_RDONLY) = -1 ENOENT (No such
    > file or directory)
    > 14631 open("/lib/libm.so.6", O_RDONLY) = 4
    > 14631 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20 \343"..., 512) = 512
    >
    > 14631 fstat64(0x4, 0xffb68b50) = 0
    > 14631 old_mmap(0x39b000, 147616, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x39b000
    > 14631 old_mmap(0x3be000, 8192, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x22000) = 0x3be000
    > 14631 close(4) = 0
    > 14631 open("/usr/X11R6/lib64/tls/i686/sse2/libgcc_s.so.1", O_RDONLY) =
    > -1 ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/i686/libgcc_s.so.1", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/sse2/libgcc_s.so.1", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/sse2/libgcc_s.so.1", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/sse2/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/sse2/libgcc_s.so.1", O_RDONLY) = -1
    >
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/libgcc_s.so.1", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/sse2/libgcc_s.so.1", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/sse2/libgcc_s.so.1", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/sse2/libgcc_s.so.1", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/lib/libgcc_s.so.1", O_RDONLY) = 4
    > 14631 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20 06<\000"..., 512) =
    > 512
    > 14631 fstat64(0x4, 0xffb68b34) = 0
    > 14631 old_mmap(0x3c2000, 37576, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x3c2000
    > 14631 old_mmap(0x3cb000, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9000) = 0x3cb000
    > 14631 close(4) = 0
    > 14631 open("/usr/X11R6/lib64/tls/i686/sse2/libc.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/i686/libc.so.6", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/sse2/libc.so.6", O_RDONLY) = -1 ENOENT
    >
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/sse2/libc.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib64/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No
    >
    > such file or directory)
    > 14631 open("/usr/X11R6/lib64/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No
    >
    > such file or directory)
    > 14631 open("/usr/X11R6/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such
    >
    > file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/sse2/libc.so.6", O_RDONLY) = -1
    > ENOENT (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/i686/libc.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/sse2/libc.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/sse2/libc.so.6", O_RDONLY) = -1 ENOENT
    > (No such file or directory)
    > 14631 open("/usr/X11R6/lib/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No
    > such file or directory)
    > 14631 open("/usr/X11R6/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such
    > file or directory)
    > 14631 open("/lib/libc.so.6", O_RDONLY) = 4
    > 14631 read(4,
    > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\25 2\256"..., 512) =
    > 512
    > 14631 fstat64(0x4, 0xffb68b18) = 0
    > 14631 old_mmap(0x256000, 1215452, PROT_READ|PROT_EXEC,
    > MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x256000
    > 14631 old_mmap(0x379000, 16384, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x122000) = 0x379000
    > 14631 old_mmap(0x37d000, 7132, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x37d000
    > 14631 close(4) = 0
    > 14631 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7fda000
    > 14631 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
    > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7fd9000
    > 14631 set_thread_area(0xffb69068) = 0
    > 14631 mprotect(0x379000, 8192, PROT_READ) = 0
    > 14631 mprotect(0x3be000, 4096, PROT_READ) = 0
    > 14631 mprotect(0x252000, 4096, PROT_READ) = 0
    > 14631 munmap(0xf7fdb000, 137591) = 0
    > 14631 exit_group(0) = ?



  4. Re: Floating Point Ex running any C++

    Hello,

    > We found that on a fresh FC6, compile a C program and run on it gives
    > us no problem, but if we move the result executable to a FC4 or RHEL4,
    > it will get "Floating Point Exception" error.
    > No matter how simple the program is, we always get that error.
    > Strange issue.


    That's absolutely normal. Backward compatibility isn't necessarily
    guaranteed. If you read the release note from FC6:


    12.2.2. GCC Compiler Collection

    This release of Fedora has been built with GCC 4.1, which is included
    with the distribution.

    12.2.2.1. Caveats

    Fedora developers have introduced changes in the ELF .hash section
    that provides symbols for dynamic linking. This new .gnu.hash section,
    which is produced with the new default --hash-style=gnu option for
    gcc, serves the same purpose as previous hash sections. It provides,
    however, an approximately 50% increase in dynamic linking speed.
    Binaries and libraries produced with the new hashing function are
    incompatible with older glibc and dynamic linker releases. To use the
    old-style hashing routines for compatibility with older glibc-based
    systems, pass the --hash-style=sysv option instead.


    See also:
    http://www.redhat.com/archives/fedor.../msg04133.html

    Hence, as I posted previously, you need at least to compile your
    program with the flag:
    '-Wl,--hash-style=sysv'.

    HTH,
    Loic.


+ Reply to Thread