Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id EF2EBB5DC1B for ; Tue, 26 Jul 2011 10:54:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 37526-02 for ; Tue, 26 Jul 2011 13:54:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.cs.helsinki.fi (courier.cs.helsinki.fi [128.214.9.1]) by mail.postgresql.org (Postfix) with ESMTP id 2497EB5DC08 for ; Tue, 26 Jul 2011 10:54:46 -0300 (ADT) Received: from roundcube.cs.helsinki.fi (svm-10.cs.helsinki.fi [128.214.11.79]) (AUTH: PLAIN noordsij, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Tue, 26 Jul 2011 16:54:45 +0300 id 0008D32B.4E2EC725.00007825 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Date: Tue, 26 Jul 2011 16:54:45 +0300 From: noordsij To: Stefan Kaltenbrunner Cc: Alvaro Herrera , Robert Haas , Pg Bugs Subject: Re: BUG #6086: Segmentation fault In-Reply-To: <4E2DA57D.5010100@kaltenbrunner.cc> References: <201106300732.p5U7W0Bj001711@wwwmaster.postgresql.org> <1311609295-sup-6784@alvh.no-ip.org> <4E2DA57D.5010100@kaltenbrunner.cc> Message-ID: X-Sender: noordsij@cs.helsinki.fi User-Agent: RoundCube Webmail/0.2.1 X-Mime-Autoconverted: from 8bit to 7bit by courier 0.53 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.091 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.191 X-Spam-Level: X-Archive-Number: 201107/177 X-Sequence-Number: 30789 After a few hours of watching strange things happening I finally stumbled on the cause. Very short summary: the postgres binary needs to be linked to libpthread, as this will ensure a special fork() inside libthr (the FreeBSD libpthread implementation/wrapper) is used which correctly deals with any pthread usage (I am guessing especially statically initialized pthread_X variables in for example libxml2). This can be accomplished by adding "-lpthread" to the LDFLAGS when building either libxml2 or postgresql itself, or by preloading libpthread.so when starting postgresql. Before advocating any particular solution, I'd like to throw this out first and see how strongly people feel about this. Cheers, and thanks to everyone who replied so far Dennis