bugGPSD - Bugs: bug #53150, JSON parser can not handle a...

 
 

bug #53150: JSON parser can not handle a double that is a NaN

Submitted by:  Gary E. Miller <garyemiller>
Submitted on:  Tue 13 Feb 2018 11:32:57 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 26 Dec 2018 07:08:44 PM UTC, comment #3:

"Json.NET no longer serializes NaN and positive and negative infinity floating point values as symbols, which is invalid JSON. With 5.0 the new default is to serialize those values as strings, e.g. "NaN" instead of NaN. There is no change to serializing normal floating point numbers."

http://james.newtonking.com/archive/2013/04/07/json-net-5-0-release-1-net-4-5-biginteger-read-only-collections

Gary E. Miller <garyemiller>
Project Administrator
Wed 26 Dec 2018 07:07:09 PM UTC, comment #2:

> How does this come up? Who is passing NaNs to the parser?


Any float could be a NaN, +Inf or -Inf. We keep finding ones that are not properly checked before becoming JSON. isnan() is not a proper check.

Also some of the floating point math in gpsd could potentially raise a NaN.

Regardless of how, JSON should not crash on NaN, +Inf or -Inf. Those are valid values for a float. A lot of code could be removed if JSON handled NaN, +Inf and -Inf.

Gary E. Miller <garyemiller>
Project Administrator
Wed 26 Dec 2018 06:49:44 PM UTC, comment #1:

How does this come up? Who is passing NaNs to the parser?

Eric S. Raymond <esr>
Project Administrator
Tue 13 Feb 2018 11:32:57 PM UTC, original submission:

The JSON parser can not handle a double that is a NaN. This comes up in the new ECEF code.

Gary E. Miller <garyemiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by esr (Posted a comment)
  • -email is unavailable- added by garyemiller (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.4