Re: BUG in 10.1 - dsa_area could not attach to a segment that hasbeen freed - Mailing list pgsql-bugs

From Alexander Voytsekhovskyy
Subject Re: BUG in 10.1 - dsa_area could not attach to a segment that hasbeen freed
Date
Msg-id CAPa4P2ZwSfGXZLjM5_666Lc2L1QG5MNBhRQyk42y0+2Xx4SDwQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG in 10.1 - dsa_area could not attach to a segment that hasbeen freed  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: BUG in 10.1 - dsa_area could not attach to a segment that hasbeen freed  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List 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@entry=-1, occurred_events=occurred_events@entry=0x7ffc2849a460, nevents=nevents@entry=1, wait_event_info=wait_event_info@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 , 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=, argv=argv@entry=0x5560263a06e0, dbname=0x5560263a05d8 "ddc_pvmrussia", username=) 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=) 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 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=, key=8192, tb= > 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 >

pgsql-bugs by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: BUG in 10.1 - dsa_area could not attach to a segment that hasbeen freed
Next
From: Skarsol
Date:
Subject: RE: BUG #14891: Old cancel request presented by pgbouncer honoredafter skipping a query.