Project

General

Profile

Bug #9363

Add a workaround for Boost Spirit issue #688

Added by Roel Standaert 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
11/23/2021
Due date:
% Done:

100%

Estimated time:

Description

Since Boost 1.76.0 there is a regression in the outputting of numbers: https://github.com/boostorg/spirit/issues/688

Wt depends on this to serialize doubles to JavaScript.


Related issues

Related to Bug #9572: Some JSON serializer tests fail with recent Boost versionsClosedRoel Standaert01/05/2022

Actions
Related to Bug #10320: Disable workarounds for issue #9363 and #9572 when using Boost 1.79.0 or higherClosedRoel Standaert05/11/2022

Actions
#1

Updated by Roel Standaert 6 months ago

  • Status changed from InProgress to Review
#2

Updated by Roel Standaert 6 months ago

  • Status changed from Review to Implemented @Emweb
#3

Updated by Roel Standaert 5 months ago

  • % Done changed from 0 to 100
#4

Updated by Roel Standaert 5 months ago

  • Status changed from Implemented @Emweb to Resolved
#5

Updated by Bruce Toll 5 months ago

Thanks for all of the work with upstream on this. I was wondering if the issue could also impact double_to_s and real_to_s in src/Wt/Dbo/backend/Postgres.C. I haven't had the opportunity to test with Boost 1.76+ yet.

#6

Updated by Roel Standaert 5 months ago

It may affect those functions as well, indeed.

#7

Updated by Roel Standaert 5 months ago

The bug occurs when it has to round the input up in order to fit into the given precision, so in our round_js_str we get a double as input, but ask it to output it with at most 7 decimals.

Our real_to_s function on the other hand gets a float as input, and thus already has less precision, so at the very least I can't reproduce the issue with the numbers I used to test round_js_str. That suggests we may also be able to work around the issue by sacrificing precision beforehand, or increasing precision where we use round_js_str.

If the bug affects Postgres.C as well, we're a lot less likely to trigger it. I will look further to see if there is any number that will trigger the bug.

#8

Updated by Roel Standaert 5 months ago

I tried to start from 9.999f and using nextafterf to near 10.f, and didn't notice the bug.

I did encounter another issue where stof would throw an exception, though.

#9

Updated by Roel Standaert 5 months ago

  • Related to Bug #9572: Some JSON serializer tests fail with recent Boost versions added
#10

Updated by Roel Standaert 5 months ago

  • Status changed from Resolved to Closed
#11

Updated by Roel Standaert 14 days ago

  • Related to Bug #10320: Disable workarounds for issue #9363 and #9572 when using Boost 1.79.0 or higher added

Also available in: Atom PDF