Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-740

INFINITY config test outputs the different _RWSTD_LDBL_SNAN_BITS values per different runs

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.1.2, 4.1.3, 4.1.4, 4.2.0
    • 4.2.1
    • Configuration
    • None
    • gcc/Linux/i386

    • Patch Available
    • Incorrect Behavior

    Description

      When I ran the INFINITY config test several times I found that the _RWSTD_LDBL_SNAN_BITS values are different from time to time.

      Below is the result of 5 runs of the INFINITY test:

      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, 0, '\x80', '\xff', '\x7f', '\xf9', '\xbf' }
      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, 0, '\x80', '\xff', '\x7f', '\xfd', '\xbf' }
      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, 0, '\x80', '\xff', '\x7f', '\xf7', '\xbf' }
      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, 0, '\x80', '\xff', '\x7f', '\xf2', '\xbf' }
      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, 0, '\x80', '\xff', '\x7f', '\xe8', '\xbf' }
      

      I suppose that actually used 80 bits from 96 bits of long double (sizeof (long double) == 12) and the latest two bytes contains the garbage from stack.

      I think we need fill by zero values the bits fields of the flt_bits, dbl_bits and ldbl_bits unions (i.e. in union ctor).

      Attachments

        1. INFINITY.cpp.diff
          1.0 kB
          Farid Zaripov

        Issue Links

          Activity

            People

              farid Farid Zaripov
              farid Farid Zaripov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h

                  Slack

                    Issue deployment