From: noordsij <noordsij@cs.helsinki.fi>
To: Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6086: Segmentation fault
Date: Tue, 26 Jul 2011 16:54:45 +0300
Message-ID: <f82ce27210f51a2faf8879d4f14e5cab@cs.helsinki.fi> (raw)
In-Reply-To: <4E2DA57D.5010100@kaltenbrunner.cc>
References: <201106300732.p5U7W0Bj001711@wwwmaster.postgresql.org>
<CA+Tgmob6iFkry0Vg+whf2ALUaxYZAiSWCo8aDD5SH+9dzXad8A@mail.gmail.com>
<e2e7673675e48059cf6712462467f4f6@cs.helsinki.fi>
<CA+TgmoYo3BGBf1hh43FNyQ976HA4k_w5jexZnki8EEL+mHHhXw@mail.gmail.com>
<1311609295-sup-6784@alvh.no-ip.org>
<4E2DA57D.5010100@kaltenbrunner.cc>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noordsij@cs.helsinki.fi, stefan@kaltenbrunner.cc, alvherre@commandprompt.com, robertmhaas@gmail.com
Subject: Re: BUG #6086: Segmentation fault
In-Reply-To: <f82ce27210f51a2faf8879d4f14e5cab@cs.helsinki.fi>
References: <201106300732.p5U7W0Bj001711@wwwmaster.postgresql.org> <CA+Tgmob6iFkry0Vg+whf2ALUaxYZAiSWCo8aDD5SH+9dzXad8A@mail.gmail.com> <e2e7673675e48059cf6712462467f4f6@cs.helsinki.fi> <CA+TgmoYo3BGBf1hh43FNyQ976HA4k_w5jexZnki8EEL+mHHhXw@mail.gmail.com> <1311609295-sup-6784@alvh.no-ip.org> <4E2DA57D.5010100@kaltenbrunner.cc> <f82ce27210f51a2faf8879d4f14e5cab@cs.helsinki.fi>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox