pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitriy Sarafannikov <dimon99901@mail.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject:  Re[2]: [BUGS] Re: [BUGS] Segfault in MemoryContextAlloc
Date: Fri, 11 Mar 2016 18:10:32 +0300
Message-ID: <1457709032.586784536@f131.i.mail.ru> (raw)
In-Reply-To: <1409.1457707327@sss.pgh.pa.us>
References: <1453890275.241158212@f404.i.mail.ru>
	<1457701413.865304335@f395.i.mail.ru>
	<1409.1457707327@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

> 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.

Thanks for the answer.

I create new local connection (not via connection pool)

postgres=# select 1;
 ?column? 
----------
        1
(1 row)

gdb shows 1 thread

(gdb) info thread
  Id   Target Id         Frame 
* 1    Thread 0x7f0e329d2740 (LWP 84804) "postgres" 0x00007f0e305e96cd 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:29


After that i execute something on plv8

postgres=# do $$ plv8.elog(NOTICE, 'bla-bla-bla') $$ language plv8;
NOTICE:  bla-bla-bla
DO

And then gdb shows 2 threads:

(gdb) info thread
  Id   Target Id         Frame 
  2    Thread 0x7f0e32827700 (LWP 85903) "SignalSender" sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
* 1    Thread 0x7f0e329d2740 (LWP 84804) "postgres" 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

(gdb) thread 2
[Switching to thread 2 (Thread 0x7f0e32827700 (LWP 85903))]
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
85	../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: No such file or directory.
(gdb) bt
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x00007f0c0ed0544d in v8::internal::LinuxSemaphore::Wait (this=0x7f0c080008c0) at ../src/platform-linux.cc:880
#2  0x00007f0c0ec235d8 in v8::internal::RuntimeProfiler::WaitForSomeIsolateToEnterJS () at ../src/runtime-profiler.cc:452
#3  0x00007f0c0ec23cf8 in WaitForSomeIsolateToEnterJS () at ../src/runtime-profiler.cc:451
#4  v8::internal::RuntimeProfilerRateLimiter::SuspendIfNecessary (this=this@entry=0x7f0e342642dc) at ../src/runtime-profiler.cc:499
#5  0x00007f0c0ed05690 in v8::internal::SignalSender::Run (this=0x7f0e342642b0) at ../src/platform-linux.cc:1160
#6  0x00007f0c0ed053a0 in v8::internal::ThreadEntry (arg=0x7f0e342642b0) at ../src/platform-linux.cc:756
#7  0x00007f0e2ef570a4 in start_thread (arg=0x7f0e32827700) at pthread_create.c:309
#8  0x00007f0e305e887d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

It turns out that plv8 creates thread.

-- 
Best regards,
Dmitriy Sarafannikov
-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (2+ messages)  latest in thread

Message-ID: <1457709032.586784536@f131.i.mail.ru>
Permalink:  ../1457709032.586784536@f131.i.mail.ru/
Also on:    postgresql.org/message-id/1457709032.586784536@f131.i.mail.ru

 · 

reply

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: dimon99901@mail.ru, tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: [BUGS] Re: [BUGS] Segfault in MemoryContextAlloc
  In-Reply-To: <1457709032.586784536@f131.i.mail.ru>
  References: <1453890275.241158212@f404.i.mail.ru> <1457701413.865304335@f395.i.mail.ru> <1409.1457707327@sss.pgh.pa.us> <1457709032.586784536@f131.i.mail.ru>

* 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