Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 68C482E2ED2 for ; Tue, 11 Dec 2007 11:28:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 19646-07 for ; Tue, 11 Dec 2007 11:28:36 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id EFFB12E2ED1 for ; Tue, 11 Dec 2007 11:28:44 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-76-117.bk5-dsl.surnet.cl [200.126.76.117]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id lBBFSddm005792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Dec 2007 07:28:42 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 101B147C85; Tue, 11 Dec 2007 12:28:39 -0300 (CLST) Date: Tue, 11 Dec 2007 12:28:39 -0300 From: Alvaro Herrera To: Craig James Cc: pgsql-performance@postgresql.org Subject: Re: libgcc double-free, backend won't die Message-ID: <20071211152838.GH4708@alvh.no-ip.org> References: <4728FB3E.3070709@shaw.ca> <472978BE.9@hagander.net> <4729B1E9.2080306@gmail.com> <475E4133.5080009@emolecules.com> <20071211112128.GB4708@alvh.no-ip.org> <475EA754.1090307@emolecules.com> <20071211151416.GD10710@alvh.no-ip.org> <475EA9FD.9000706@emolecules.com> <20071211152010.GE10710@alvh.no-ip.org> <475EAB69.9@emolecules.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <475EAB69.9@emolecules.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Tue, 11 Dec 2007 07:28:42 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/138 X-Sequence-Number: 27954 Craig James wrote: > Alvaro Herrera wrote: >> Craig James wrote: >>> Alvaro Herrera wrote: >>>> Craig James wrote: >>>> >>>>> Here is my guess -- and this is just a guess. My functions use a >>>>> third-party library which, of necessity, uses malloc/free in the >>>>> ordinary way. I suspect that there's a bug in the Postgres palloc() >>>>> code that's walking over memory that regular malloc() allocates. The >>>>> third-party library (OpenBabel) has been tested pretty thoroughly by >>>>> me an others and has no memory corruption problems. All malloc's are >>>>> freed properly. Does that seem like a possibility? >>>> Not really. palloc uses malloc underneath. >>> But some Postgres code could be walking off the end of a malloc'ed >>> block, even if palloc() is allocating and deallocating correctly. >>> Which is why I was hoping to use valgrind to see what's going on. >> >> I very much doubt it. Since you've now shown that OpenBabel is >> multithreaded, then that's a much more likely cause. > > Can you elaborate? Are multithreaded libraries not allowed to be > linked to Postgres? Absolutely not. -- Alvaro Herrera http://www.flickr.com/photos/alvherre/ "La gente vulgar solo piensa en pasar el tiempo; el que tiene talento, en aprovecharlo"