From: pavel.bazika@kocovnici.cz
To: pgsql-bugs@postgresql.org
Cc: pavel.bazika@kocovnici.cz
Subject: BUG #14902: valgrind - problem in PQconnectdb - pqSaveParameterStatus reported
Date: Mon, 13 Nov 2017 11:27:19 +0000
Message-ID: <20171113112719.1468.57626@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14902
Logged by: Pavel Bazika
Email address: pavel.bazika@kocovnici.cz
PostgreSQL version: 10.1
Operating system: Arch Linux
Description:
Hi,
I'm testing my application with helgrind threading error detection tool
(part of valgrind) and it reports a problem in libpq, when I'm calling
PQconnectdb from two threads:
==25830== Possible data race during write of size 4 at 0x7D600CC by thread
#1
==25830== Locks held: none
==25830== at 0x7B2CFE4: pqSaveParameterStatus (fe-exec.c:1022)
==25830== by 0x7B35A01: getParameterStatus (fe-protocol3.c:1378)
==25830== by 0x7B36E77: pqParseInput3 (fe-protocol3.c:265)
==25830== by 0x7B2DD7D: PQisBusy (fe-exec.c:1738)
==25830== by 0x7B274D6: PQconnectPoll (fe-connect.c:2909)
==25830== by 0x7B2829D: connectDBComplete.part.9 (fe-connect.c:1931)
==25830== by 0x7B2B31F: connectDBComplete (fe-connect.c:589)
==25830==
==25830== This conflicts with a previous write of size 4 by thread #4
==25830== Locks held: none
==25830== at 0x7B2CFE4: pqSaveParameterStatus (fe-exec.c:1022)
==25830== by 0x7B35A01: getParameterStatus (fe-protocol3.c:1378)
==25830== by 0x7B36E77: pqParseInput3 (fe-protocol3.c:265)
==25830== by 0x7B2DD7D: PQisBusy (fe-exec.c:1738)
==25830== by 0x7B274D6: PQconnectPoll (fe-connect.c:2909)
==25830== by 0x7B2829D: connectDBComplete.part.9 (fe-connect.c:1931)
==25830== by 0x7B2B31F: connectDBComplete (fe-connect.c:589)
==25830== by 0x7B2B31F: PQconnectdb (fe-connect.c:590)
and
==25830== Possible data race during write of size 1 at 0x7D600C8 by thread
#1
==25830== Locks held: none
==25830== at 0x7B2CFC3: pqSaveParameterStatus (fe-exec.c:1027)
==25830== by 0x7B35A01: getParameterStatus (fe-protocol3.c:1378)
==25830== by 0x7B36E77: pqParseInput3 (fe-protocol3.c:265)
==25830== by 0x7B2DD7D: PQisBusy (fe-exec.c:1738)
==25830== by 0x7B274D6: PQconnectPoll (fe-connect.c:2909)
==25830== by 0x7B2829D: connectDBComplete.part.9 (fe-connect.c:1931)
==25830== by 0x7B2B31F: connectDBComplete (fe-connect.c:589)
==25830== by 0x7B2B31F: PQconnectdb (fe-connect.c:590)
==25830==
==25830== This conflicts with a previous write of size 1 by thread #4
==25830== Locks held: none
==25830== at 0x7B2CFC3: pqSaveParameterStatus (fe-exec.c:1027)
==25830== by 0x7B35A01: getParameterStatus (fe-protocol3.c:1378)
==25830== by 0x7B36E77: pqParseInput3 (fe-protocol3.c:265)
==25830== by 0x7B2DD7D: PQisBusy (fe-exec.c:1738)
==25830== by 0x7B274D6: PQconnectPoll (fe-connect.c:2909)
==25830== by 0x7B2829D: connectDBComplete.part.9 (fe-connect.c:1931)
==25830== by 0x7B2B31F: connectDBComplete (fe-connect.c:589)
==25830== by 0x7B2B31F: PQconnectdb (fe-connect.c:590)
Is this false positive, bug or am I doing something wrong? The problem
occurrs when those static variables are written in fe-exex.c.
Thanks
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pavel.bazika@kocovnici.cz
Subject: Re: BUG #14902: valgrind - problem in PQconnectdb - pqSaveParameterStatus reported
In-Reply-To: <20171113112719.1468.57626@wrigleys.postgresql.org>
References: <20171113112719.1468.57626@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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