forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1f655fd
committed
Fix race condition in gettext() initialization in libpq and ecpglib.
In libpq and ecpglib, multiple threads can concurrently enter theinitialization logic for message localization. Since we set theits-done flag before actually doing the work, it'd be possiblefor some threads to reach gettext() before anyone has calledbindtextdomain(). Barring bugs in libintl itself, this would notresult in anything worse than failure to localize some earlymessages. Nonetheless, it's a bug, and an easy one to fix.Noted while investigating bug #17299 from Clemens Zeidler(much thanks to Liam Bowen for followup investigation on that).It currently appears that that actually *is* a bug in libintl itself,but that doesn't let us off the hook for this bit.Back-patch to all supported versions.Discussion:https://postgr.es/m/17299-7270741958c0b1ab@postgresql.orgDiscussion:https://postgr.es/m/CAE7q7Eit4Eq2=bxce=Fm8HAStECjaXUE=WBQc-sDDcgJQ7s7eg@mail.gmail.com1 parent1fabec7 commit1f655fd
2 files changed
+18
-4
lines changedLines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
491 | 491 |
| |
492 | 492 |
| |
493 | 493 |
| |
494 |
| - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
495 | 502 |
| |
496 | 503 |
| |
497 | 504 |
| |
| |||
503 | 510 |
| |
504 | 511 |
| |
505 | 512 |
| |
506 |
| - | |
507 | 513 |
| |
508 | 514 |
| |
509 | 515 |
| |
510 | 516 |
| |
511 | 517 |
| |
| 518 | + | |
512 | 519 |
| |
513 | 520 |
| |
514 | 521 |
| |
|
Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1239 | 1239 |
| |
1240 | 1240 |
| |
1241 | 1241 |
| |
1242 |
| - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1243 | 1250 |
| |
1244 | 1251 |
| |
1245 | 1252 |
| |
| |||
1251 | 1258 |
| |
1252 | 1259 |
| |
1253 | 1260 |
| |
1254 |
| - | |
1255 | 1261 |
| |
1256 | 1262 |
| |
1257 | 1263 |
| |
1258 | 1264 |
| |
1259 | 1265 |
| |
| 1266 | + | |
1260 | 1267 |
| |
1261 | 1268 |
| |
1262 | 1269 |
| |
|
0 commit comments
Comments
(0)