json icon indicating copy to clipboard operation
json copied to clipboard

Serialization of double type data gets stuck

Open zhaoyuRobotics opened this issue 1 month ago • 3 comments

Description

hello, i meet a trouble when i use json , serializing double-type data will cause the process to freeze in grisu2. ,are you solve it ?

VERSION 3.9.1

Image

Reproduction steps

Transmit double floating-point numbers

Expected vs. actual results

No stuck

Minimal code example


Error messages


Compiler and operating system

armv8 ubuntu16.04

Library version

3.9.1

Validation

zhaoyuRobotics avatar Nov 20 '25 09:11 zhaoyuRobotics

Please provide some additional information:

  • What did you try to do? json::parse("-4.503")? Please provide a minimal code example.
  • Please try with the current release version (3.12.0) or the develop branch version. We will not be able to backport fixes to older releases.

nlohmann avatar Nov 20 '25 09:11 nlohmann

Thank you for your reply.

I'm sorry, I can't provide a reproducible example; this is an occasional occurrences. What I'm trying to do is return data of type vector<vector<double>>, which will be processed by this library to generate JSON-RPC formatted data.

Have you seen a similar stack trace? I suspect that Grisu2 might be stuck in an infinite loop due to a precision check not being met.

zhaoyuRobotics avatar Nov 20 '25 12:11 zhaoyuRobotics

No, I never saw any issue with Grisu2.

nlohmann avatar Nov 20 '25 12:11 nlohmann