Project

General

Profile

Actions

Bug #9363

closed

Add a workaround for Boost Spirit issue #688

Added by Roel Standaert over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
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 2 (0 open2 closed)

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
Actions #1

Updated by Roel Standaert over 2 years ago

  • Status changed from InProgress to Review
Actions #2

Updated by Roel Standaert over 2 years ago

  • Status changed from Review to Implemented @Emweb
Actions #3

Updated by Roel Standaert over 2 years ago

  • % Done changed from 0 to 100
Actions #4

Updated by Roel Standaert over 2 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #5

Updated by Bruce Toll over 2 years 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.

Actions #6

Updated by Roel Standaert over 2 years ago

It may affect those functions as well, indeed.

Actions #7

Updated by Roel Standaert over 2 years 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.

Actions #8

Updated by Roel Standaert over 2 years 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.

Actions #9

Updated by Roel Standaert over 2 years ago

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

Updated by Roel Standaert over 2 years ago

  • Status changed from Resolved to Closed
Actions #11

Updated by Roel Standaert almost 2 years ago

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

Also available in: Atom PDF