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 BC0BCD1C91C for ; Mon, 4 Aug 2003 22:34:37 +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 53554-06 for ; Mon, 4 Aug 2003 19:33: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 2040BD1CA01 for ; Mon, 4 Aug 2003 19:34:26 -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 h74MYLL13086; Tue, 5 Aug 2003 00:34:21 +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 00:34:20 +0200 User-Agent: KMail/1.5.1 References: <200308041729.13212.ftm.van.vugt@foxi.nl> <2778.1060012055@sss.pgh.pa.us> In-Reply-To: <2778.1060012055@sss.pgh.pa.us> Cc: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200308050034.20405.ftm.van.vugt@foxi.nl> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/11 X-Sequence-Number: 4365 Hi Tom, > It seems highly unlikely that the above is a good idea. > The behavior complained of in the comment > is gone anyway in PG 7.3. I've conveyed the message, thanks. > You may care to try your test with CVS tip and see if it works better. I've retried this with a cvs-version of this afternoon (local time). The bu= ild=20 stranded in plpgsql (I seem to need a more recent bison), but at that point= =20 libpq was already finished. This still resulted in more or less the same ki= nd=20 of errors. I then retried with a cvs-version of 21:30 (utc), configured wit= h=20 enable-thread-safety and compiled with debug info / without optimization,= =20 along with a fresh compilation of Qt.=20 Results : same diff (see errors below). What more can I do to help out / find out what the problem is ? Best, Frank van Vugt =3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D+=3D #0 0x4063ab77 in QPSQLResult::reset(QString const&) (this=3D0x80c10f0,=20 query=3D@0xbf7ffa9c) at sql/drivers/psql/qsql_psql.cpp:477 477 int status =3D PQresultStatus( d->result ); (gdb) where #0 0x4063ab77 in QPSQLResult::reset(QString const&) (this=3D0x80c10f0,=20 query=3D@0xbf7ffa9c) at sql/drivers/psql/qsql_psql.cpp:477 #1 0x4060dd44 in QSqlQuery::exec(QString const&) (this=3D0xbf7ffa8c,=20 query=3D@0xbf7ffa9c) at sql/qsqlquery.cpp:358 #2 0x08050823 in PrintEngine::run() (this=3D0x809e2b8) at printengine.cpp:= 97 #3 0x402b4bf6 in QThreadInstance::start(void*) (_arg=3D0x809e31c) at=20 kernel/qthread_unix.cpp:120 #4 0x40b1dc60 in pthread_start_thread () from /lib/libpthread.so.0 (gdb) #0 0x40d8c85a in pqGetc (result=3D0xbf3ff81b "@8=BB=D9@=FC\031\216@D=F8?= =BF\035=AC=D8@\210",=20 conn=3D0x80d0088) at fe-misc.c:85 85 * write 1 char to the connection (gdb) where #0 0x40d8c85a in pqGetc (result=3D0xbf3ff81b "@8=BB=D9@=FC\031\216@D=F8?= =BF\035=AC=D8@\210",=20 conn=3D0x80d0088) at fe-misc.c:85 #1 0x40d90afe in pqParseInput2 (conn=3D0x80d0088) at fe-protocol2.c:384 #2 0x40d8ac1d in parseInput (conn=3D0x80d0088) at fe-exec.c:918 #3 0x40d8ac8f in PQgetResult (conn=3D0x80d0088) at fe-exec.c:955 #4 0x40d8b0ac in PQexecFinish (conn=3D0x80d0088) at fe-exec.c:1159 #5 0x40d8aec6 in PQexec (conn=3D0x80d0088, query=3D0x80d4270 "set transact= ion=20 isolation level SERIALIZABLE") at fe-exec.c:1047 #6 0x4063aab7 in QPSQLResult::reset(QString const&) (this=3D0x80d3d20,=20 query=3D@0xbf3ffa9c) at sql/drivers/psql/qsql_psql.cpp:473 #7 0x4060dd44 in QSqlQuery::exec(QString const&) (this=3D0xbf3ffa8c,=20 query=3D@0xbf3ffa9c) at sql/qsqlquery.cpp:358 #8 0x08050411 in PrintEngine::run() (this=3D0x80a1860) at printengine.cpp:= 85 #9 0x402b4bf6 in QThreadInstance::start(void*) (_arg=3D0x80bd4c4) at=20 kernel/qthread_unix.cpp:120 #10 0x40b1dc60 in pthread_start_thread () from /lib/libpthread.so.0 Current language: auto; currently c (gdb) #0 0x4061391d in QSqlDatabase::transaction() (this=3D0x80cc078) at=20 sql/qsqldatabase.cpp:760 760 if ( !d->driver->hasFeature( QSqlDriver::Transactions ) ) (gdb) where #0 0x4061391d in QSqlDatabase::transaction() (this=3D0x80cc078) at=20 sql/qsqldatabase.cpp:760 #1 0x080503db in PrintEngine::run() (this=3D0x80a70b8) at printengine.cpp:= 83 #2 0x402b4bf6 in QThreadInstance::start(void*) (_arg=3D0x80c0c3c) at=20 kernel/qthread_unix.cpp:120 #3 0x40b1dc60 in pthread_start_thread () from /lib/libpthread.so.0 (gdb) #0 0x40d89ea0 in PQclear (res=3D0x417974dd) at fe-exec.c:349 349 (gdb) where #0 0x40d89ea0 in PQclear (res=3D0x417974dd) at fe-exec.c:349 #1 0x40d89f12 in pqClearAsyncResult (conn=3D0x80cba10) at fe-exec.c:369 #2 0x40d89f7a in pqSaveErrorResult (conn=3D0x80cba10) at fe-exec.c:397 #3 0x40d8ad11 in PQgetResult (conn=3D0x80cba10) at fe-exec.c:984 #4 0x40d8b0ac in PQexecFinish (conn=3D0x80cba10) at fe-exec.c:1159 #5 0x40d8aec6 in PQexec (conn=3D0x80cba10, query=3D0x80d8178 "set transact= ion=20 isolation level SERIALIZABLE") at fe-exec.c:1047 #6 0x4063aab7 in QPSQLResult::reset(QString const&) (this=3D0x80d7f98,=20 query=3D@0xbf3ffa9c) at sql/drivers/psql/qsql_psql.cpp:473 #7 0x4060dd44 in QSqlQuery::exec(QString const&) (this=3D0xbf3ffa8c,=20 query=3D@0xbf3ffa9c) at sql/qsqlquery.cpp:358 #8 0x08050411 in PrintEngine::run() (this=3D0x80be3b0) at printengine.cpp:= 85 #9 0x402b4bf6 in QThreadInstance::start(void*) (_arg=3D0x80c0c44) at=20 kernel/qthread_unix.cpp:120 #10 0x40b1dc60 in pthread_start_thread () from /lib/libpthread.so.0 Current language: auto; currently c (gdb)