BUG #14096: run pgbench, db crash

Started by zhaozp@uxsino.comalmost 10 years ago5 messagesbugs
Jump to latest
#1zhaozp@uxsino.com
zhaozp@uxsino.com

The following bug has been logged on the website:

Bug reference: 14096
Logged by: zpzhao
Email address: zhaozp@uxsino.com
PostgreSQL version: 9.5.1
Operating system: centos7
Description:

PageAddItem中,phdr->pd_lower,pd_upper为0

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

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: zhaozp@uxsino.com (#1)
Re: BUG #14096: run pgbench, db crash

zhaozp@uxsino.com wrote:

The following bug has been logged on the website:

Bug reference: 14096
Logged by: zpzhao
Email address: zhaozp@uxsino.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

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

#3zhaozp@uxsino.com
zhaozp@uxsino.com
In reply to: Alvaro Herrera (#2)
Re: BUG #14096: run pgbench, db crash

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@uxsino.com wrote:

The following bug has been logged on the website:

Bug reference: 14096
Logged by: zpzhao
Email address: zhaozp@uxsino.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

#4zhaozp@uxsino.com
zhaozp@uxsino.com
In reply to: zhaozp@uxsino.com (#1)
postmaster.c ,have a warning: pg_getnameinfo_all() failed

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,

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: zhaozp@uxsino.com (#4)
Re: postmaster.c ,have a warning: pg_getnameinfo_all() failed

"zhaozp@uxsino.com" <zhaozp@uxsino.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

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