pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/21d36747d4fafe16539a0c55ebb91a01e4053e3c

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fd048e0cb5aa45ef67b5b2b0446f4b1b6bdefbf3

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bdc79ddd10790fcbaecc92e9ac3a64caa44d71e1

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/12a73f29ff7d00ea96ec4c5d1bef9acb5985d688

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f38b66ec056216a1efde6b7982ba582603262b0b

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/379c43bdad1d18786b87f38e8761f61a478b5875

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows.
@ 2020-10-24 17:13 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-10-24 17:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix ancient bug in ecpg's pthread_once() emulation for Windows.

We must not set the "done" flag until after we've executed the
initialization function.  Otherwise, other threads can fall through
the initial unlocked test before initialization is really complete.

This has been seen to cause rare failures of ecpg's thread/descriptor
test, and it could presumably cause other sorts of misbehavior in
threaded ECPG-using applications, since ecpglib relies on
pthread_once() in several places.

Diagnosis and patch by me, based on investigation by Alexander Lakhin.
Back-patch to all supported branches (the bug dates to 2007).

Discussion: https://postgr.es/m/16685-d6cd241872c101d3@postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/758b45e83b50b08a0bca03a9b5610a27ed7c7b09

Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2020-10-24 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>
2020-10-24 17:13 pgsql: Fix ancient bug in ecpg's pthread_once() emulation for Windows. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox