Re: Trouble with plpgsql on 7.4.6

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: Trouble with plpgsql on 7.4.6
Дата
Msg-id 20041124065230.2b33beba.darcy@druid.net
обсуждение исходный текст
Ответ на Re: Trouble with plpgsql on 7.4.6  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Список pgsql-hackers
On Tue, 23 Nov 2004 07:25:17 -0500
"D'Arcy J.M. Cain" <darcy@druid.net> wrote:
> 
> #0  0x483cafeb in kill () from /usr/lib/libc.so.12
> #1  0x483cd0af in __libc_mutex_catchall_stub (m=1212478892)
>     at /usr/src/lib/libc/thread-stub/thread-stub.c:112
> #2  0x4843f0f7 in free (ptr=<incomplete type>)
>     at /usr/src/lib/libc/stdlib/malloc.c:1149
> #3  0x081b3efc in AllocSetDelete (context=<error type>) at aset.c:464
> #4  0x081b468a in MemoryContextDelete (context=<error type>) at
> #mcxt.c:192
> 
> In fact it is calling the thread stubs but the applicatino is
> threaded. At least, that's what I see from this code in NetBSD.
> 
> #define CHECK_NOT_THREADED_ALWAYS() \
> do {                    \
>     if (__isthreaded)       \
>         DIE();          \
> } while (/*CONSTCOND*/0)
> 
> #if 1
> #define CHECK_NOT_THREADED()    CHECK_NOT_THREADED_ALWAYS()
> #else
> #define CHECK_NOT_THREADED()    /* nothing */
> #endif 
> 
> I am going to follow up with the NetBSD team but I pass this on in
> case it suggests anything.  Note that this still only causes problems
> on 7.4.6 and not under 7.4.3.

OK, I have found the problem.  It turns out to be in the way that it is
built under the NetBSD pkgsrc system.  As soon as a module is loaded
that uses pthreads it sets a variable (__isthreaded) that causes the
above error.  The answer is to simply link PostgreSQL with -lpthread to
begin with.  We are making some changes to the pkgsrc system to do this
correctly with this and some other packages that could potentially have
the same problem.

Thanks for the help in finding this.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joachim Wieland
Дата:
Сообщение: Re: patch: plpgsql - access records with rec.(expr)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: lwlocks and starvation