Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roundtrip fail #7

Open
miloyip opened this issue Jan 24, 2016 · 1 comment
Open

Roundtrip fail #7

miloyip opened this issue Jan 24, 2016 · 1 comment

Comments

@miloyip
Copy link

miloyip commented Jan 24, 2016

Recently I encountered crash on some platform (Ubuntu/gcc-5) during a roundtrip of this JSON:

[-9223372036854775808]

I saved it in valid-0013.json and run the test, which reproduced the problem but did not crash on my machine (OS X El Capitan/clang):

...
Running test: valid-0013.json
measured len: 7
serialized len: 7
serialized:
[ -e ]
Failed to re-parse: 1:0: Expected digit after `e`

I found that several tests in test/main.cc are also failed. I make a note here as well.

...
Running test: valid-0003.json
measured len: 36
serialized len: 36
serialized:
{ "min": -1e+28.0, "max": 1e+28.0 }
Failed to re-parse: 1:0: Unexpected `.` in object
...
Running test: valid-0005.json
measured len: 106
serialized len: 106
serialized:
[ 12.0004, 1.7734, 15, -42, -1.7734, 1e+28.0, -1e+28.0, 1e-28.0, -1e-28.0, -18.3872, -2.1, -1.23457e+06 ]
Failed to re-parse: 1:0: Expected , before .
...
Running test: valid-0008.json
measured len: 59
serialized len: 59
serialized:
[ 400000.0, 4e-07.0, 400000.0, 4e+06.0, 4e-06.0, 4e+06.0 ]
Failed to re-parse: 1:0: Expected , before .
...

BTW, I discovered this during integrating Travis in https://github.com/miloyip/nativejson-benchmark .

@be5invis
Copy link

be5invis commented Jul 5, 2016

I've found some crashes either, especially when dealing with json_double values very close to an integer, which causes json_serialize_ex out-of-range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants