Re: Postgres gets stuck

Поиск
Список
Период
Сортировка
От Craig A. James
Тема Re: Postgres gets stuck
Дата
Msg-id 4463EE89.8010103@modgraph-usa.com
обсуждение исходный текст
Ответ на Re: Postgres gets stuck  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Postgres gets stuck  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Tom Lane wrote:
> >My suspicion is that it's an incompatibility between malloc()
> >libraries.
>
> On Linux there's only supposed to be one malloc, ie, glibc's version.
> On other platforms I'd be worried about threaded vs non-threaded libc
> (because the backend is not threaded), but not Linux.

I guess I misinterpreted the Postgress manual, which says (in 31.9, "C Language Functions"),

    "When allocating memory, use the PostgreSQL functions palloc and pfree
    instead of the corresponding C library functions malloc and free."

I imagined that perhaps palloc/pfree used mutexes for something.  But if I understand you, palloc() and pfree() are
justwrappers around malloc() and free(), and don't (for example) make their own separate calls to brk(2), sbrk(2), or
theirkin.  If that's the case, then you answered my question - it's all ordinary malloc/free calls in the end, and
that'snot the source of the problem. 

> There may be a more basic threading problem here, though, rooted in the
> precise fact that the backend isn't threaded.  If you're trying to use
> any libraries that assume they can have multiple threads, I wouldn't be
> at all surprised to see things go boom.

No threading anywhere.  None of the libraries use threads or mutexes.  It's just plain old vanilla C/C++ scientific
algorithms.

>  C++ exception handling could be problematic too.

No C++ exceptions are thrown anywhere in the code, 'tho I suppose one of the I/O libraries could throw an exception,
e.g.when reading from a file.  But there's no evidence of this after millions of identical operations succeeded.  In
addition,the stack trace shows it to be stuck in a memory operation, not an I/O operation. 

> Or it could be a garden variety glibc bug.  How up-to-date is your
> platform?

I guess this is the next place to look.  From the few answers I've gotten, it sounds like this isn't a known Postgres
issue,and my stack trace doesn't seem to be familiar to anyone on this forum.  Oh well... thanks for your help. 

Craig

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres gets stuck
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgres gets stuck