Re: Re: [BUGS] Segfault in MemoryContextAlloc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitriy Sarafannikov <dimon99901(at)mail(dot)ru>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re: [BUGS] Segfault in MemoryContextAlloc
Date: 2016-03-11 14:42:07
Message-ID: 1409.1457707327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?UTF-8?B?RG1pdHJpeSBTYXJhZmFubmlrb3Y=?= <dimon99901(at)mail(dot)ru> writes:
>> Both this and the other behavior you reported sure seem like "can't
>> happen" situations. I do have a theory though: I think you are doing
>> something that is spawning multiple threads inside the backend, and then
>> the backend logic goes nuts because it's expecting to be single-threaded.

> I caught another segfault, which is similar to previous.

Uh, well:

> (gdb) info threads
> Id Target Id Frame
> 2 Thread 0x7f0e329d2740 (LWP 46202) 0x00007f0e305e972b in __libc_recv (fd=13, buf=buf(at)entry=0x7f0e32a1b140 <PqRecvBuffer>, n=n(at)entry=8192, flags=-1, flags(at)entry=0)
> at ../sysdeps/unix/sysv/linux/x86_64/recv.c:33
> * 1 Thread 0x7f0e32820700 (LWP 46918) MemoryContextAlloc (context=0x0, size=120) at /build/postgresql-9.4-1wOG_M/postgresql-9.4-9.4.6/build/../src/backend/utils/mmgr/mcxt.c:584

There's not enough information here to disclose what it is that's creating
a second thread, but you need to find that and make it stop.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitriy Sarafannikov 2016-03-11 15:10:32 Re[2]: [BUGS] Re: [BUGS] Segfault in MemoryContextAlloc
Previous Message Nick Cleaton 2016-03-11 14:12:37 Re: streaming replication master can fail to shut down