=?UTF-8?B?RG1pdHJpeSBTYXJhZmFubmlrb3Y=?= <dimon99901@mail.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@entry=0x7f0e32a1b140
<PqRecvBuffer>,n=n@entry=8192, flags=-1, flags@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