From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8587 invoked by alias); 8 Feb 2011 09:39:08 -0000 Received: (qmail 8577 invoked by uid 22791); 8 Feb 2011 09:39:07 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_IB X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Feb 2011 09:39:02 +0000 From: "mexas at bristol dot ac.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47642] New: real(kind=16) - libquadmath - segfault on amd64 FreeBSD X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mexas at bristol dot ac.uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 08 Feb 2011 09:56:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00973.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47642 Summary: real(kind=16) - libquadmath - segfault on amd64 FreeBSD Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: mexas@bristol.ac.uk BUZI> uname -a FreeBSD zzz 9.0-CURRENT FreeBSD 9.0-CURRENT #4 r217412: Fri Jan 14 22:09:57 GMT 2011 root@zzz:/usr/obj/usr/src/sys/BUZI amd64 BUZI> cat tmp.f90 program z implicit none real(kind=16) :: q q=1.0e48_16 write(*,*)q write(*,*)nearest(q,1.0) write(*,*)nearest(q,1.0)-q end program z BUZI> gfortran46 -Wl,-rpath=/usr/local/lib/gcc46 tmp.f90 BUZI> ./a.out 1.00000000000000000000000000000000000E+0048 1.00000000000000000000000000000000014E+0048 140737488355328.00000000000000000000 BUZI> This is fine, however, changing the constant to 1e38 gives segfault: BUZI> cat tmp.f90 program z implicit none real(kind=16) :: q q=1.0e38_16 write(*,*)q write(*,*)nearest(q,1.0) write(*,*)nearest(q,1.0)-q end program z BUZI> gfortran46 -Wl,-rpath=/usr/local/lib/gcc46 tmp.f90 BUZI> ./a.out 1.00000000000000000000000000000000000E+0038 Segmentation fault (core dumped) BUZI> Same with 1e39: BUZI> cat tmp.f90 program z implicit none real(kind=16) :: q q=1.0e39_16 write(*,*)q write(*,*)nearest(q,1.0) write(*,*)nearest(q,1.0)-q end program z BUZI> gfortran46 -Wl,-rpath=/usr/local/lib/gcc46 tmp.f90 BUZI> ./a.out 1.00000000000000000000000000000000000E+0039 Segmentation fault (core dumped) BUZI> Then 1e29 works correct again BUZI> cat tmp.f90 program z implicit none real(kind=16) :: q q=1.0e29_16 write(*,*)q write(*,*)nearest(q,1.0) write(*,*)nearest(q,1.0)-q end program z BUZI> gfortran46 -Wl,-rpath=/usr/local/lib/gcc46 tmp.f90 BUZI> ./a.out 100000000000000000000000000000.00000 100000000000000000000000000000.00002 1.52587890625000000000000000000000000E-0005 BUZI> >>From debugger: BUZI> gdb a.out a.out.core GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)... Core was generated by `a.out'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/local/lib/gcc46/libgfortran.so.3...done. Loaded symbols for /usr/local/lib/gcc46/libgfortran.so.3 Reading symbols from /lib/libm.so.5...done. Loaded symbols for /lib/libm.so.5 Reading symbols from /usr/local/lib/gcc46/libgcc_s.so.1...done. Loaded symbols for /usr/local/lib/gcc46/libgcc_s.so.1 Reading symbols from /usr/local/lib/gcc46/libquadmath.so.0...done. Loaded symbols for /usr/local/lib/gcc46/libquadmath.so.0 Reading symbols from /lib/libc.so.7...done. Loaded symbols for /lib/libc.so.7 Reading symbols from /libexec/ld-elf.so.1...done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x00000008010ba0ae in memset () from /lib/libc.so.7 (gdb) (gdb) bt #0 0x00000008010ba0ae in memset () from /lib/libc.so.7 #1 0x0000000800d98a27 in quadmath_flt128tostr (s=0x7fffffffd250 '0' ..., size=47, n=37, x=Variable "x" is not available. ) at ../.././../gcc-4.6-20110205/libquadmath/quadmath_io.c:95 #2 0x3030303030303030 in ?? () #3 0x3030303030303030 in ?? () #4 0x3030303030303030 in ?? () #5 0x3030303030303030 in ?? () #6 0x3030303030303030 in ?? () #7 0x3030303030303030 in ?? () *skip lots of identical lines* #968 0x3030303030303030 in ?? () #969 0x3030303030303030 in ?? () #970 0x3030303030303030 in ?? () #971 0x3030303030303030 in ?? () #972 0x3030303030303030 in ?? () #973 0x3030303030303030 in ?? () ---Type to continue, or q to quit--- #974 0x3030303030303030 in ?? () Cannot access memory at address 0x7ffffffff000 (gdb)