X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 133A1D1C925 for ; Tue, 5 Aug 2003 21:45:41 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 43884-02 for ; Tue, 5 Aug 2003 18:44:23 -0300 (ADT) Received: from gatefox.foxi.nl (a194-109-246-192.adsl.xs4all.nl [194.109.246.192]) by svr1.postgresql.org (Postfix) with ESMTP id 54F72D1C91C for ; Tue, 5 Aug 2003 18:45:28 -0300 (ADT) Received: from techfox.foxi (techfox.foxi [192.168.0.79]) by gatefox.foxi.nl (8.10.2/8.10.2) with ESMTP id h75LjML20955; Tue, 5 Aug 2003 23:45:23 +0200 From: Frank van Vugt Organization: Foxi Consultants in Technology BV To: Tom Lane Subject: Re: Multi-threaded user app segfaults when using libpq with separate connections Date: Tue, 5 Aug 2003 23:45:21 +0200 User-Agent: KMail/1.5.1 Cc: pgsql-interfaces@postgresql.org References: <200308041729.13212.ftm.van.vugt@foxi.nl> <200308050034.20405.ftm.van.vugt@foxi.nl> <13531.1060036862@sss.pgh.pa.us> In-Reply-To: <13531.1060036862@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308052345.21967.ftm.van.vugt@foxi.nl> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/19 X-Sequence-Number: 4373 > 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)