Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yccxj-0002C9-UY for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2015 16:54:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yccxj-00058K-Dx for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2015 16:54:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yccxi-00058E-MA for pgsql-bugs@postgresql.org; Mon, 30 Mar 2015 16:54:54 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yccxe-0000Bc-Vg for pgsql-bugs@postgresql.org; Mon, 30 Mar 2015 16:54:53 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 58F285F7B0; Mon, 30 Mar 2015 12:54:50 -0400 (EDT) Date: Mon, 30 Mar 2015 12:54:50 -0400 From: Stephen Frost To: Vladimir Borodin Cc: Tom Lane , pgsql-bugs@postgresql.org Subject: Re: BUG #12918: Segfault in BackendIdGetTransactionIds Message-ID: <20150330165450.GE3663@tamriel.snowman.net> References: <20150330162247.2492.923@wrigleys.postgresql.org> <17494.1427733227@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wJeYCwfJgfFvSPOo" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-46-generic (x86_64) X-Uptime: 12:53:05 up 10 days, 22:41, 4 users, load average: 0.06, 0.10, 0.08 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) 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 --wJeYCwfJgfFvSPOo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Vladimir Borodin (root@simply.name) wrote: >=20 > > 30 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., =D0=B2 19:33, Tom Lane = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): > >=20 > > root@simply.name writes: > >> After upgrading from 9.3.6 to 9.4.1 (both installed from packages on > >> yum.postgresql.org) we have started getting segfaults of different bac= kends. > >> Backtraces of all coredumps look similar: > >> (gdb) bt > >> #0 0x000000000066bf9b in BackendIdGetTransactionIds (backendID=3D >> optimized out>, xid=3D0x7f2a1b714798, xmin=3D0x7f2a1b71479c) at sinval= adt.c:426 > >> #1 0x00000000006287f4 in pgstat_read_current_status () at pgstat.c:28= 71 > >> #2 0x0000000000628879 in pgstat_fetch_stat_numbackends () at pgstat.c= :2342 > >=20 > > Hmm ... looks to me like BackendIdGetTransactionIds is simply busted. > > It supposes that there are no inactive entries in the sinval array > > within the range 0 .. lastBackend. But there can be, in which case > > dereferencing stateP->proc crashes. The reason it's hard to reproduce > > is the relatively narrow window between where pgstat_read_current_status > > saw the backend as active and where we're inspecting its sinval entry. >=20 > I=E2=80=99ve also tried to revert dd1a3bcc where this function appeared b= ut couldn=E2=80=99t do it :( If you would be able to make a build without t= his commit (if it is easier than fix it in right way), I could install it o= n several production hosts to test it. Hopefully a fix will be forthcoming shortly. Reverting it won't work though, no, as it included a catalog bump. Thanks, Stephen --wJeYCwfJgfFvSPOo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVGX/ZAAoJEO1sijiDR2RVocEP/javrC0QagRWHnsZNydhfyRg vvNr8BGEacSWSGY33iFwMsJOz8WcvyAGyM7hTry5E30I+ejbu0Wbvt84YEQTCQYt 7nO1ZcuJEqlUz+Gs1LCy/Snd2F2s39WyOpSbYDtw1RX5lvB34hfFZJbmhkWwCMKE u9+WrNitns4LANF3Dr1uWlsoxeQ0r6jWJF56y1IzXIDVwgJZ0ZpLyaM3AeKNEFi/ XBigZtzvHMaINSlv5BuhOOeSkpkcDNkvr5uHeL5d8itpGGxHiol4+TPwsZiTEOm5 7JB07rGWtp7rFHPh7+GB5BIH0x3eqmNEk3HJBn4mFwR76LXj4BGVt+cwGlJjHZhD H5zLAgLo6QEWjyZVf9W2DcTmNjwbv+Md40ETfUK6leFrtRmpxvKiuI/0LVuJAmSy emIwUT6zSays53Vm4CUteTqmbmORTFlHWBV5TuBEA8QgPaeM6Uo53ZTCXK7iVM3j 70ilMJo6z0+NktqQljkxsG2yw2CqANGiDU57Evrg6JfEjUOR1nP09gGou0/LtGfA T5aM27o4VJAkbcPfj3LrxBuqfw7/3Pd7loAPJMXcqLy89r3QvKw0WkMTJEJ0Jm6g jJ2fhW0ZjretHL/KEJtEYESSP4j3by1imVY/mJS4Aw0sOSw9RUbTXJF1eJ9yNLBT J7RzBjPKP3ReLD7ZZYNC =h7V4 -----END PGP SIGNATURE----- --wJeYCwfJgfFvSPOo--