Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 776FE2E0067 for ; Thu, 24 Apr 2008 11:12:43 -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 39140-06 for ; Thu, 24 Apr 2008 11:12:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id B35882E0037 for ; Thu, 24 Apr 2008 11:12:40 -0300 (ADT) Received: from perhan.alvh.no-ip.org (200-126-123-196.bk8-dsl.surnet.cl [200.126.123.196]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m3OEDIpl004693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Apr 2008 07:13:20 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 2012E47C59; Thu, 24 Apr 2008 10:12:35 -0400 (CLT) Date: Thu, 24 Apr 2008 10:12:35 -0400 From: Alvaro Herrera To: alexander lunyov Cc: pgsql-interfaces@postgresql.org Subject: Re: Exceeded maximum lock level Message-ID: <20080424141235.GE5593@alvh.no-ip.org> References: <480F46B4.5080102@zato.ru> <20080423145510.GA6572@alvh.no-ip.org> <48101BDB.6080501@zato.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48101BDB.6080501@zato.ru> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 24 Apr 2008 07:13:21 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/11 X-Sequence-Number: 6722 alexander lunyov wrote: > Alvaro Herrera wrote: >>> Fatal error 'Exceeded maximum lock level' at line 519 in file >>> /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 844913743) >> >> This is clearly not a PG problem -- I'd think there's a bug in your own >> code. > > This is very helpful :) > > My code is just this: > I didn't touch any mutex (i don't even sure about what is mutex). While > not calling any of sql functions, application works just fine. In > non-threaded mode it is working with sql functions. Where did i go wrong? Well, there are still many things left out, like how many times you call this function before it fails. Even then, I suspect the bug is in the pthread code that comes with your operating system -- or perhaps on the patches that the port applies to Postgres. (For the record, I filled the missing pieces in your program and made SQLLog loop 100000 times, which it did without a hitch. Next time, please submit a complete program, not just pieces of it.) -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.