Re: BUG in 10.1 - dsa_area could not attach to a segment that has been freed

From: Alexander Voytsekhovskyy <young(dot)inbox(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG in 10.1 - dsa_area could not attach to a segment that has been freed
Date: 2017-11-29 16:23:49
Message-ID: CAPa4P2ZwSfGXZLjM5_666Lc2L1QG5MNBhRQyk42y0+2Xx4SDwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

thanks for detailed instructions!

Here it is:

Note: breakpoint 1 also set at pc 0x5560252c21f5.
Breakpoint 2 at 0x5560252c21f5: file
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/utils/mmgr/dsa.c,
line 1736.
(gdb) bt
#0 0x00007f53e538e9b3 in __epoll_wait_nocancel () at
../sysdeps/unix/syscall-template.S:84
#1 0x000055602516a791 in WaitEventSetWaitBlock (nevents=1,
occurred_events=0x7ffc2849a460, cur_timeout=-1, set=0x556026359498) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/storage/ipc/latch.c:1048
#2 WaitEventSetWait (set=0x556026359498, timeout=timeout(at)entry=-1,
occurred_events=occurred_events(at)entry=0x7ffc2849a460, nevents=nevents(at)entry=1,
wait_event_info=wait_event_info(at)entry=100663296) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/storage/ipc/latch.c:1000
#3 0x0000556025089767 in secure_read (port=0x55602639ddb0,
ptr=0x5560257195a0 <PqRecvBuffer>, len=8192) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/libpq/be-secure.c:166
#4 0x0000556025094f48 in pq_recvbuf () at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/libpq/pqcomm.c:963
#5 0x0000556025095c85 in pq_getbyte () at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/libpq/pqcomm.c:1006
#6 0x000055602518d350 in SocketBackend (inBuf=0x7ffc2849a620) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/tcop/postgres.c:328
#7 ReadCommand (inBuf=0x7ffc2849a620) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/tcop/postgres.c:501
#8 PostgresMain (argc=<optimized out>, argv=argv(at)entry=0x5560263a06e0,
dbname=0x5560263a05d8 "ddc_pvmrussia", username=<optimized out>) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/tcop/postgres.c:4030
#9 0x0000556024ec7fe9 in BackendRun (port=0x55602639ddb0) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/postmaster/postmaster.c:4357
#10 BackendStartup (port=0x55602639ddb0) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/postmaster/postmaster.c:4029
#11 ServerLoop () at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/postmaster/postmaster.c:1753
#12 0x000055602511d36b in PostmasterMain (argc=5, argv=<optimized out>) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/postmaster/postmaster.c:1361
#13 0x0000556024ec93e5 in main (argc=5, argv=0x556026358850) at
/build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../src/backend/main/main.c:228
(gdb)

On Wed, Nov 29, 2017 at 6:02 PM, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
wrote:

>
> On 11/29/2017 04:46 PM, Alexander Voytsekhovskyy wrote:
> > I see my fault
> >
> > here is GDB with correct symbols
> >
> > Program received signal SIGUSR1, User defined signal 1.
> > pagetable_insert (found=<synthetic pointer>, key=8192, tb=<optimized
> > out>) at
> > /build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../
> src/include/lib/simplehash.h:540
> > 540
> > /build/postgresql-10-qAeTPy/postgresql-10-10.1/build/../
> src/include/lib/simplehash.h:
> > No such file or directory.
> > Continuing.
> >
>
> I think you really need to do "handle SIGUSR1 noprint nostop" to
> eliminate the SIGUSR1 noise. That is absolutely irrelevant to the issue
> you're trying to investigate.
>
> Furthermore, this does not give us any sort of stack trace. You need to
> either set a breakpoint at the elog() call, which I believe is this one:
>
> https://github.com/postgres/postgres/blob/REL_10_STABLE/
> src/backend/utils/mmgr/dsa.c#L1736
>
> wait for it to get triggered, and then generate backtrace using 'bt'.
>
>
> So something like
>
> 1) gdb -p $PID
>
> 2) (gdb) handle SIGUSR1 noprint nostop
>
> 3) (gdb) break dsa.c:1736
>
> 4) run the query, gdb should interrupt at the breakpoint
>
> 5) (gdb) bt
>
> and then send us the output of that gdb command.
>
>
> regards
>
> --
> Tomas Vondra http://www.2ndQuadrant.com
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Skarsol 2017-11-29 18:01:02 RE: BUG #14891: Old cancel request presented by pgbouncer honored after skipping a query.
Previous Message Tomas Vondra 2017-11-29 16:02:01 Re: BUG in 10.1 - dsa_area could not attach to a segment that has been freed