public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16961] New: nan function incorrect handling of bad sequences
@ 2014-05-19 15:19 jsm28 at gcc dot gnu.org
  2014-05-19 15:37 ` [Bug math/16961] " schwab@linux-m68k.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-05-19 15:19 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

            Bug ID: 16961
           Summary: nan function incorrect handling of bad sequences
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org

The nan function does:

  if (tagp[0] != '\0')
    {
      char buf[6 + strlen (tagp)];
      sprintf (buf, "NAN(%s)", tagp);
      return strtod (buf, NULL);
    }

If the argument starts with an n-char-sequence, but is not one in its entirety,
the return value is determined by that n-char-sequence.  But according to ISO
C, "If tagp does not point to an n-char sequence or an empty string, the call
is equivalent to strtod("NAN", (char**) NULL).", so the initial characters
should have no effect on the return value.  The same applies to nanf and nanl.

(n-char-sequences are sequences of ASCII letters, digits and underscores.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16961] nan function incorrect handling of bad sequences
  2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
@ 2014-05-19 15:37 ` schwab@linux-m68k.org
  2014-05-19 15:41 ` jsm28 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2014-05-19 15:37 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
strtod will do the right thing by ignoring the non-n-char-sequence.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16961] nan function incorrect handling of bad sequences
  2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
  2014-05-19 15:37 ` [Bug math/16961] " schwab@linux-m68k.org
@ 2014-05-19 15:41 ` jsm28 at gcc dot gnu.org
  2014-05-19 15:47 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-05-19 15:41 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
We're talking about arguments such as "1)", where strtod sees an initial
substring "NAN(1)" of its argument "NAN(1))" and processes that (but the
semantics of the nan function mean the whole string should be ignored).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16961] nan function incorrect handling of bad sequences
  2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
  2014-05-19 15:37 ` [Bug math/16961] " schwab@linux-m68k.org
  2014-05-19 15:41 ` jsm28 at gcc dot gnu.org
@ 2014-05-19 15:47 ` schwab@linux-m68k.org
  2014-05-19 15:57 ` jsm28 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2014-05-19 15:47 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
Still not a problem, since the bits of a bare NAN are not specified.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16961] nan function incorrect handling of bad sequences
  2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-05-19 15:47 ` schwab@linux-m68k.org
@ 2014-05-19 15:57 ` jsm28 at gcc dot gnu.org
  2014-05-19 16:03 ` schwab@linux-m68k.org
  2014-06-12 19:18 ` fweimer at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-05-19 15:57 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #4 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
As a matter of quality of implementation, strtod("NAN"), and everything
equivalent to it, should produce the (architecture-specific) default quiet NaN
rather than some other NaN.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16961] nan function incorrect handling of bad sequences
  2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-05-19 15:57 ` jsm28 at gcc dot gnu.org
@ 2014-05-19 16:03 ` schwab@linux-m68k.org
  2014-06-12 19:18 ` fweimer at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2014-05-19 16:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16961] nan function incorrect handling of bad sequences
  2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-05-19 16:03 ` schwab@linux-m68k.org
@ 2014-06-12 19:18 ` fweimer at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-06-12 19:18 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16961

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-06-12 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19 15:19 [Bug math/16961] New: nan function incorrect handling of bad sequences jsm28 at gcc dot gnu.org
2014-05-19 15:37 ` [Bug math/16961] " schwab@linux-m68k.org
2014-05-19 15:41 ` jsm28 at gcc dot gnu.org
2014-05-19 15:47 ` schwab@linux-m68k.org
2014-05-19 15:57 ` jsm28 at gcc dot gnu.org
2014-05-19 16:03 ` schwab@linux-m68k.org
2014-06-12 19:18 ` fweimer at redhat 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).