Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id CC6F62E0074 for ; Wed, 23 Apr 2008 11:51:54 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58215-08 for ; Wed, 23 Apr 2008 11:51:51 -0300 (ADT) X-Greylist: delayed 00:23:10.483001 by SQLgrey-1.7.5 Received: from mail.zato.ru (mail.zato.ru [80.82.172.12]) by developer.postgresql.org (Postfix) with ESMTP id DE79D2E0063 for ; Wed, 23 Apr 2008 11:51:51 -0300 (ADT) Received: by mail.zato.ru (Postfix, from userid 9232) id 7CA08218D79; Wed, 23 Apr 2008 18:26:37 +0400 (MSD) Received: from [192.168.0.73] (luna.zato.ru [80.82.172.11]) by mail.zato.ru (Postfix) with ESMTP id 66056216DAB for ; Wed, 23 Apr 2008 18:26:37 +0400 (MSD) Message-ID: <480F46B4.5080102@zato.ru> Date: Wed, 23 Apr 2008 18:24:52 +0400 From: alexander lunyov User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Exceeded maximum lock level Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/8 X-Sequence-Number: 6719 Hello. Freebsd 6.2, Postgresql 8.3 from ports. I'm trying to add some features to threaded application, like sql logs. I've changed application according to examples of libpq usage (simple things - connect, inserts, disconnect), everything works for a little time (under 1 minute), then i get error: Fatal error 'Exceeded maximum lock level' at line 519 in file /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 844913743) This application compiled with -lpthread, and in #postgresql user RhodiumToad told me to use -pthread instead, but after changes in makefiles to use -pthread the same error comes up right after first use of sql functions (in the beginning some amount of data was actually inserted to DB before error comes up). For now i told this application not to use threads (it have command line key switching thread/fork behavior) and it works, but i think threads would be better under heavy load (i think in future there will be heavy load). If i start application with threads but not use sql functions (sql code is there but not used) i see no errors. Is it a problem of libpq? Compilation flags looks like this: CFLAGS=-O2 -fno-strict-aliasing -pipe -DFREEBSD -pthread -export-dynamic -I/usr/local/include -I . -shared -fPIC LIBS = -lpthread -L/usr/local/lib -lpq -- wbr, alexander