Re: Thread-unsafe coding in ecpg
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Michael Meskes <meskes@postgresql.org>, pgsql-hackers@lists.postgresql.org
Date: 2019-01-20T02:00:37Z
Lists: pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes: > Would it help if we had non-locale-aware functions for both > floating-point output _and_ input? i.e. import a known-working strtod() > (allowing us to remove all the hacks that have grown up around it, for > special-case input and wonky error handling) with locale functionality > removed. Dunno, is there such a thing as a platform-independent strtod()? I'd have thought that, for instance, typical implementations would be pretty much in bed with the details of IEEE float format --- your example where strtof() is different from (float) strtod() makes it hard to believe that it can be written without assumptions about the hardware's float format. (Note that this concern is independent of whether we adopt the Ryu code, which IIUC also depends on IEEE floats. Our answer for anyone wanting to run on non-IEEE hardware can be to #ifdef out Ryu and use the existing float output code. But doing the equivalent thing on the input side wouldn't solve ecpg's problem.) regards, tom lane
Commits
-
Remove _configthreadlocale() calls in ecpg test suite.
- e3565fd61cee 12.0 landed
-
Remove infinite-loop hazards in ecpg test suite.
- d5a1fde39726 12.0 landed
- fbf5395cb1ea 9.5.16 landed
- 6d6333745b11 9.4.21 landed
- adc2553b7069 9.6.12 landed
- 5b5cb3b0eb31 10.7 landed
- 28868f77b6cb 11.2 landed
-
Blind attempt to fix _configthreadlocale() failures on MinGW.
- 773f594408b9 9.4.21 landed
- 7ac0e71aa623 9.5.16 landed
- 1d334ab6e0b5 9.6.12 landed
- dd815a94ccf5 10.7 landed
- b620cf2d4762 11.2 landed
- 2cf91ccb73ce 12.0 landed
-
Avoid thread-safety problem in ecpglib.
- f305e8457d1e 11.2 landed
- eb3e90cad1e4 9.6.12 landed
- c9ff6cbfc472 9.4.21 landed
- 844d91fd6496 9.5.16 landed
- 6106f9dd71ff 10.7 landed
- 8eb4a9312c95 12.0 landed
-
Second try at fixing ecpglib thread-safety problem.
- ee27584c4a40 12.0 landed