From: Frank van Vugt <ftm.van.vugt@foxi.nl>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Multi-threaded user app segfaults when using libpq with separate connections
Date: Tue, 5 Aug 2003 23:45:21 +0200
Message-ID: <200308052345.21967.ftm.van.vugt@foxi.nl> (raw)
In-Reply-To: <13531.1060036862@sss.pgh.pa.us>
References: <200308041729.13212.ftm.van.vugt@foxi.nl>
<200308050034.20405.ftm.van.vugt@foxi.nl>
<13531.1060036862@sss.pgh.pa.us>
> I get the impression that
> something is clobbering memory with abandon. Do you have any
> Purify-like tools to look for memory stomp problems?
In addition to my post of this morning containing the regular Valgrind output,
I'm including here the relevant parts of a valgrind run using the 'helgrind'
skin, which detects possible data race conditions.
I hope the info is of some use,
best,
Frank van Vugt
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
==14670==
==14670== Thread 2:
==14670== Possible data race writing variable at 0x43C561A8
==14670== at 0x40EB48D7: enlargePQExpBuffer (pqexpbuffer.c:152)
==14670== by 0x40EB4994: printfPQExpBuffer (pqexpbuffer.c:203)
==14670== by 0x40EB168B: pqReadData (fe-misc.c:449)
==14670== by 0x40EAF334: PQgetResult (fe-exec.c:1337)
==14670== Address 0x43C561A8 is 456 bytes inside a block of size 16384
alloc'd by thread 3
==14670== at 0x4001CA2C: malloc (vg_replace_malloc.c:153)
==14670== by 0x40EABF44: makeEmptyPGconn (fe-connect.c:1881)
==14670== by 0x40EAA319: PQconnectStart (fe-connect.c:273)
==14670== by 0x40EAA2D5: PQconnectdb (fe-connect.c:235)
==14670== Previous state: shared RO, no locks
==14670==
==14670== Thread 2:
==14670== Possible data race writing variable at 0x43C561B0
==14670== at 0x40EB48DF: enlargePQExpBuffer (pqexpbuffer.c:153)
==14670== by 0x40EB4994: printfPQExpBuffer (pqexpbuffer.c:203)
==14670== by 0x40EB168B: pqReadData (fe-misc.c:449)
==14670== by 0x40EAF334: PQgetResult (fe-exec.c:1337)
==14670== Address 0x43C561B0 is 464 bytes inside a block of size 16384
alloc'd by thread 3
==14670== at 0x4001CA2C: malloc (vg_replace_malloc.c:153)
==14670== by 0x40EABF44: makeEmptyPGconn (fe-connect.c:1881)
==14670== by 0x40EAA319: PQconnectStart (fe-connect.c:273)
==14670== by 0x40EAA2D5: PQconnectdb (fe-connect.c:235)
==14670== Previous state: shared RO, no locks
==14670==
==14670== Thread 2:
==14670== Possible data race reading variable at 0x40D45614
==14670== at 0x4000700D: _dl_lookup_versioned_symbol_internal (in
/lib/ld-2.3.2.so)
==14670== by 0x4000AE8E: fixup (in /lib/ld-2.3.2.so)
==14670== by 0x4000B05F: _dl_runtime_resolve (in /lib/ld-2.3.2.so)
==14670== by 0x40EB168B: pqReadData (fe-misc.c:449)
==14670== Address 0x40D45614 is not stack'd, malloc'd or free'd
==14670== Previous state: shared RW, locked by:0x432F7440
==14670==
==14670== Thread 2:
==14670== Possible data race writing variable at 0x43C561AC
==14670== at 0x40EB497F: printfPQExpBuffer (pqexpbuffer.c:198)
==14670== by 0x40EB168B: pqReadData (fe-misc.c:449)
==14670== by 0x40EAF334: PQgetResult (fe-exec.c:1337)
==14670== by 0x40EAF510: PQexec (fe-exec.c:1441)
==14670== Address 0x43C561AC is 460 bytes inside a block of size 16384
alloc'd by thread 3
==14670== at 0x4001CA2C: malloc (vg_replace_malloc.c:153)
==14670== by 0x40EABF44: makeEmptyPGconn (fe-connect.c:1881)
==14670== by 0x40EAA319: PQconnectStart (fe-connect.c:273)
==14670== by 0x40EAA2D5: PQconnectdb (fe-connect.c:235)
==14670== Previous state: shared RO, no locks
==14670==
==14670== Thread 2:
==14670== Possible data race writing variable at 0x43C56198
==14670== at 0x40EAE3CC: saveErrorResult (fe-exec.c:632)
==14670== by 0x40EAF348: PQgetResult (fe-exec.c:1344)
==14670== by 0x40EAF510: PQexec (fe-exec.c:1441)
==14670== by 0x407870D2: QPSQLDriver::beginTransaction()
(sql/drivers/psql/qsql_psql.cpp:698)
==14670== Address 0x43C56198 is 440 bytes inside a block of size 16384
alloc'd by thread 3
==14670== at 0x4001CA2C: malloc (vg_replace_malloc.c:153)
==14670== by 0x40EABF44: makeEmptyPGconn (fe-connect.c:1881)
==14670== by 0x40EAA319: PQconnectStart (fe-connect.c:273)
==14670== by 0x40EAA2D5: PQconnectdb (fe-connect.c:235)
==14670== Previous state: shared RO, no locks
accessed distinguished 2ndary map! 0x350034
read distinguished 2ndary map! 0x350034
Segmentatie fout (core dumped)
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: ftm.van.vugt@foxi.nl, tgl@sss.pgh.pa.us
Subject: Re: Multi-threaded user app segfaults when using libpq with separate connections
In-Reply-To: <200308052345.21967.ftm.van.vugt@foxi.nl>
* 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