public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libquadmath/99202] New: Undefined behaviour in libquadmath file rem_pio2q.c function __quadmath_rem_pio2q
@ 2021-02-22 15:55 zeccav at gmail dot com
  2021-02-23  9:01 ` [Bug libquadmath/99202] " marxin at gcc dot gnu.org
  2021-02-23 16:12 ` zeccav at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: zeccav at gmail dot com @ 2021-02-22 15:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99202

            Bug ID: 99202
           Summary: Undefined behaviour in libquadmath file rem_pio2q.c
                    function __quadmath_rem_pio2q
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libquadmath
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

! from dec_math.f90 
! must be compiled and run
! gfortran compiler needs not be sanitized
! must load sanitized libquadmath.so.0 as in ldd a.out -> libquadmath.so.0 =>
/home/vitti/local/gcc-150221-undefined/lib64/libquadmath.so.0
! ../../../gcc-150221/libquadmath/math/rem_pio2q.c:562:26: runtime error: left
shift of 4612846647631955497 by 23 places cannot be represented in type 'long
int'
! rem_pio2q.c:562 -> "tx [2] = (double)(((ix << 23) | (lx >> 41)) & 0xffffff);"
      real(16) :: q_i1,  q_oa

      q_i1 = 34.3774677078493908766176900826395_16

      q_oa = cotan (q_i1)

      end

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libquadmath/99202] Undefined behaviour in libquadmath file rem_pio2q.c function __quadmath_rem_pio2q
  2021-02-22 15:55 [Bug libquadmath/99202] New: Undefined behaviour in libquadmath file rem_pio2q.c function __quadmath_rem_pio2q zeccav at gmail dot com
@ 2021-02-23  9:01 ` marxin at gcc dot gnu.org
  2021-02-23 16:12 ` zeccav at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-23  9:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99202

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-02-23
                 CC|                            |fxcoudert at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
             Blocks|                            |63426

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, full back-trace:

LD_PRELOAD=/dev/shm/objdir2/x86_64-pc-linux-gnu/libsanitizer/ubsan/.libs/libubsan.so.1.0.0
./a.out 
/home/marxin/Programming/gcc2/libquadmath/math/rem_pio2q.c:562:26: runtime
error: left shift of 4612832830761346066 by 23 places cannot be represented in
type 'long int'
    #0 0x7ffff7193736 in __quadmath_rem_pio2q
/home/marxin/Programming/gcc2/libquadmath/math/rem_pio2q.c:562
    #1 0x7ffff71adfde in tanq
/home/marxin/Programming/gcc2/libquadmath/math/tanq.c:73
    #2 0x403e2d in MAIN__ (/home/marxin/Programming/testcases/a.out+0x403e2d)
    #3 0x404e50 in main (/home/marxin/Programming/testcases/a.out+0x404e50)
    #4 0x7ffff6fc9b24 in __libc_start_main (/lib64/libc.so.6+0x27b24)
    #5 0x40174d in _start (/home/marxin/Programming/testcases/a.out+0x40174d)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
[Bug 63426] [meta-bug] Issues found with -fsanitize=undefined

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libquadmath/99202] Undefined behaviour in libquadmath file rem_pio2q.c function __quadmath_rem_pio2q
  2021-02-22 15:55 [Bug libquadmath/99202] New: Undefined behaviour in libquadmath file rem_pio2q.c function __quadmath_rem_pio2q zeccav at gmail dot com
  2021-02-23  9:01 ` [Bug libquadmath/99202] " marxin at gcc dot gnu.org
@ 2021-02-23 16:12 ` zeccav at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: zeccav at gmail dot com @ 2021-02-23 16:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99202

--- Comment #2 from Vittorio Zecca <zeccav at gmail dot com> ---
I believe you need LD_PRELOAD if the object program uses the address sanitizer.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-23 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 15:55 [Bug libquadmath/99202] New: Undefined behaviour in libquadmath file rem_pio2q.c function __quadmath_rem_pio2q zeccav at gmail dot com
2021-02-23  9:01 ` [Bug libquadmath/99202] " marxin at gcc dot gnu.org
2021-02-23 16:12 ` zeccav at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).