Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VDCJC-0006TR-Jr for pgsql-bugs@arkaria.postgresql.org; Sat, 24 Aug 2013 11:47:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VDCJC-000858-1u for pgsql-bugs@arkaria.postgresql.org; Sat, 24 Aug 2013 11:47:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VDCJB-000851-11 for pgsql-bugs@postgresql.org; Sat, 24 Aug 2013 11:47:09 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VDCJ7-0002y8-UH for pgsql-bugs@postgresql.org; Sat, 24 Aug 2013 11:47:08 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VDCJ7-0007Pp-3k for pgsql-bugs@postgresql.org; Sat, 24 Aug 2013 11:47:05 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1VDCJ1-0000Da-FR for pgsql-bugs@postgresql.org; Sat, 24 Aug 2013 11:46:59 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8397: pg_basebackup -x from new standby server sometimes causes Segmentation fault To: pgsql-bugs@postgresql.org From: harukat@sraoss.co.jp Message-Id: Date: Sat, 24 Aug 2013 11:46:59 +0000 X-Pg-Spam-Score: -2.8 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8397 Logged by: TAKATSUKA Haruka Email address: harukat@sraoss.co.jp PostgreSQL version: 9.2.4 Operating system: Linux (CentOS6) Description: Hi. I report a small bug. pg_basebackup -x from new standby server sometimes causes Segmentation fault. (1) create new standby server dir by pg_basebackup without -x (2) start new standby server (3) pg_basebackup from new standby server with -x (!) when new standby has no WAL files in pg_xlog, new standby's wal sender crash new standby server's core file: Core was generated by `postgres: wal sender process postgres ::1(55210) sending backup "pg_basebackup'. Program terminated with signal 11, Segmentation fault. #0 0x0000003b7368ac66 in __rawmemchr_sse2 () from /lib64/libc.so.6 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6.x86_64 libxml2-2.7.6-4.el6.x86_64 zlib-1.2.3-27.el6.x86_64 (gdb) bt #0 0x0000003b7368ac66 in __rawmemchr_sse2 () from /lib64/libc.so.6 #1 0x0000003b73675990 in _IO_str_init_static_internal () from /lib64/libc.so.6 #2 0x0000003b73669935 in vsscanf () from /lib64/libc.so.6 #3 0x0000003b736639a8 in sscanf () from /lib64/libc.so.6 #4 0x0000000000622351 in perform_base_backup (opt=0x7fffc2e22300, tblspcdir=0xd424c0) at basebackup.c:304 #5 0x0000000000622c50 in SendBaseBackup (cmd=) at basebackup.c:558 #6 0x000000000061f5b0 in HandleReplicationCommand () at walsender.c:482 #7 WalSndHandshake () at walsender.c:257 #8 WalSenderMain () at walsender.c:181 #9 0x0000000000650b12 in PostgresMain (argc=1, argv=, dbname=0xc82a90 "", username=0xc82a70 "postgres") at postgres.c:3715 #10 0x000000000060c4f1 in BackendRun () at postmaster.c:3614 #11 BackendStartup () at postmaster.c:3304 #12 ServerLoop () at postmaster.c:1367 #13 0x000000000060f031 in PostmasterMain (argc=, argv=) at postmaster.c:1127 #14 0x00000000005ae140 in main (argc=5, argv=0xc80bb0) at main.c:199 ./backend/replication/basebackup.c:304 XLogFromFileName(walFiles[0], &tli, &logid, &logseg); In this case, nWalFiles = 0 and walFiles[] palloced zero size. Though pg_basebackup does not have to work in this rare case, we should insert something like "if (nWalFiles <= 0) ereport(...);". regards, -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs