Re: BUG #14096: run pgbench, db crash

Lists: pgsql-bugs
From: zhaozp(at)uxsino(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14096: run pgbench, db crash
Date: 2016-04-18 09:32:44
Message-ID: 20160418093244.22924.55715@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토SQL : Postg토토SQL 메일 링리스트 : 2016-04-18 이후 PGSQL-BUGS

The following bug has been logged on the website:

Bug reference: 14096
Logged by: zpzhao
Email address: zhaozp(at)uxsino(dot)com
PostgreSQL version: 9.5.1
Operating system: centos7
Description:

PageAddItem中,phdr->pd_lower,pd_upper为0


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: zhaozp(at)uxsino(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14096: run pgbench, db crash
Date: 2016-04-18 19:09:42
Message-ID: 20160418190942.GA618994@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

zhaozp(at)uxsino(dot)com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14096
> Logged by: zpzhao
> Email address: zhaozp(at)uxsino(dot)com
> PostgreSQL version: 9.5.1
> Operating system: centos7
> Description:
>
> PageAddItem中,phdr->pd_lower,pd_upper为0

Please provide more details on the crash you see. This description is
not enough.

Thanks,

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


From: "zhaozp(at)uxsino(dot)com" <zhaozp(at)uxsino(dot)com>
To: "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14096: run pgbench, db crash
Date: 2016-04-19 03:02:49
Message-ID: 201604191102487130318@uxsino.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

core file :

#0 0x0000003e61e32625 in raise () from /lib64/libc.so.6
#1 0x0000003e61e33e05 in abort () from /lib64/libc.so.6
#2 0x0000000000a5680c in errfinish (dummy=<value optimized out>) at elog.c:551
#3 0x0000000000964fc7 in PageAddItem (page=<value optimized out>, item=0x261e900 "x'", size=121, offsetNumber=0, overwrite=<value optimized out>, is_heap=<value optimized out>) at bufpage.c:198
#4 0x0000000000750aca in RelationPutHeapTuple (relation=<value optimized out>, buffer=371, tuple=0x261e8e8, token=0 '\000') at hio.c:53
#5 0x000000000074b3a7 in heap_update (relation=0x7f1030085738, otid=<value optimized out>, newtup=0x261e8e8, cid=0, crosscheck=0x0, wait=1 '\001', hufd=0x7fff02d22b40, lockmode=0x7fff02d22b5c) at heapam.c:3870
#6 0x0000000000888a0f in ExecUpdate (tupleid=0x7fff02d22ca0, oldtuple=0x0, slot=0x261e268, planSlot=0x2616160, euxsqlstate=0x2614800, estate=0x2614510, canSetTag=1 '\001') at nodeModifyTable.c:884
#7 0x000000000088938a in ExecModifyTable (node=0x2614760) at nodeModifyTable.c:1444
#8 0x00000000008710a8 in ExecProcNode (node=0x2614760) at execProcnode.c:389
#9 0x000000000086f842 in ExecutePlan (queryDesc=0x260b840, direction=<value optimized out>, count=0) at execMain.c:1549

#3 0x0000000000964fc7 in PageAddItem (page=<value optimized out>, item=0x261e900 "x'", size=121, offsetNumber=0, overwrite=<value optimized out>, is_heap=<value optimized out>) at bufpage.c:198
if (phdr->pd_lower < SizeOfPageHeaderData ||
phdr->pd_lower > phdr->pd_upper ||
phdr->pd_upper > phdr->pd_special ||
phdr->pd_special > BLCKSZ)
pd_lower pd_upper pd_special members = 0

From: Alvaro Herrera
Date: 2016-04-19 03:09
To: zhaozp
CC: pgsql-bugs
Subject: Re: [BUGS] BUG #14096: run pgbench, db crash
zhaozp(at)uxsino(dot)com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14096
> Logged by: zpzhao
> Email address: zhaozp(at)uxsino(dot)com
> PostgreSQL version: 9.5.1
> Operating system: centos7
> Description:
>
> PageAddItem中,phdr->pd_lower,pd_upper为0

Please provide more details on the crash you see. This description is
not enough.

Thanks,

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


From: "zhaozp(at)uxsino(dot)com" <zhaozp(at)uxsino(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: postmaster.c ,have a warning: pg_getnameinfo_all() failed
Date: 2017-03-14 05:53:53
Message-ID: 201703141352529603355@uxsino.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


static void
4071 BackendInitialize(Port *port)
4072 {
4073 int status;
4074 int ret;
4075 char remote_host[NI_MAXHOST];
4076 char remote_port[NI_MAXSERV];
4077 char remote_ps_data[NI_MAXHOST];
4078

4129
4130 /*
4131 * Get the remote host name and port for logging and status display.
4132 */
4133 remote_host[0] = '\0';
4134 remote_port[0] = '\0';
4135 if ((ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
4136 remote_host, sizeof(remote_host),
4137 remote_port, sizeof(remote_port),
4138 (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)
4139 ereport(WARNING,
4140 (errmsg_internal("pg_getnameinfo_all() failed: %s",
4141 gai_strerror(ret))));

Modified below, correct?
4136 remote_host, NI_MAXHOST,
4137 remote_port, NI_MAXSERV,


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "zhaozp(at)uxsino(dot)com" <zhaozp(at)uxsino(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: postmaster.c ,have a warning: pg_getnameinfo_all() failed
Date: 2017-03-14 14:25:37
Message-ID: 28845.1489501537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"zhaozp(at)uxsino(dot)com" <zhaozp(at)uxsino(dot)com> writes:
> 4075 char remote_host[NI_MAXHOST];
> 4076 char remote_port[NI_MAXSERV];
> ...
> 4135 if ((ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
> 4136 remote_host, sizeof(remote_host),
> 4137 remote_port, sizeof(remote_port),
> 4138 (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)

> Modified below, correct?
> 4136 remote_host, NI_MAXHOST,
> 4137 remote_port, NI_MAXSERV,

Why do you think that's an improvement? The values should be the same,
but the existing code doesn't have a hazard of changing the array size
in one place and failing to change the other.

regards, tom lane