Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPrrP-0000Dn-5w for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Jun 2017 14:52:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dPrrO-0003vw-Oq for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Jun 2017 14:52:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dPqRi-000300-59 for pgsql-bugs@postgresql.org; Tue, 27 Jun 2017 13:22:22 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dPqRe-0001yj-TR for pgsql-bugs@postgresql.org; Tue, 27 Jun 2017 13:22:20 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 08D6F2118B; Tue, 27 Jun 2017 09:22:18 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 27 Jun 2017 09:22:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=turelinckx.be; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Ytm pth3D+0hNnkwli76zjSSL+k1nXerXmw0V3rpbdgU=; b=c8cNra1kR++7LmLTVeX P7usSM6BHVbdF2dQiGMt/rfDbSnHejC4td8ofmJHZlWKu6vU3F3ubH6fkeUuOvnT uv1CU+J5vqAHTppKhWqMk8s+/LMVj+IpkCA6OlRxJvzDilvJbqAlKffxh2qoMa3B q1rYR/AxdMJohnaTyFR90g1c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=Ytmpth3D+0hNnkwli76zjSSL+k1nXerXmw0V3rpbdgU=; b=D+dsRTFy UGN4//34Ab0mk9648pcqQVjuajFlxgtRK4ril3L+NrI8ccuNsND/3iPuXc8XhgWS 2LSbCGMTsbv9s8xoyyJvsI4ajYFHJt2rdDJuDp3evsV6dzLik18YpDim5MZIBvZl 7YHQRGhMQdQlPpSdC+tWmqwvNRK340Z6MJO8ToO7cS/0YSWe74/2Xhu4gwrSL8f/ IxCjgmL0dyIViPY4O4nMHNohD67c7/jXKgR/DmreJKLV7XhyohWprz8wa2wR8Jc0 nTFFileTWnvHFKCkHaeSjY/cuz1mIqk/i6lwVg5+vYs7vZ3TzIdknfdBVICI2v59 YgXhbMC6/GNHpQ== X-ME-Sender: X-Sasl-enc: 8FdYtUjed2POi7ot54h9pmQoshQn47b36vUQAJLrVj/K 1498569737 Received: from tureltolaptop (213.219.188.53.adsl.dyn.edpnet.net [213.219.188.53]) by mail.messagingengine.com (Postfix) with ESMTPA id 57ACE7E74F; Tue, 27 Jun 2017 09:22:17 -0400 (EDT) From: "Tom Turelinckx" To: "'Tom Lane'" Cc: References: <006b01d2eaa2$d4317be0$7c9473a0$@turelinckx.be> <2069.1498062248@sss.pgh.pa.us> In-Reply-To: <2069.1498062248@sss.pgh.pa.us> Subject: Re: Bus error in formatting.c NUM_numpart_to_char (9.4.12, 9.6.3, sparc) Date: Tue, 27 Jun 2017 15:22:10 +0200 Message-ID: <00ac01d2ef48$6288c520$279a4f60$@turelinckx.be> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHt+Xivo1Vy1iljmvBavilwHB6KPwGVK25kofX0BhA= Content-Language: en-us 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 Tom Turelinckx wrote: > Switching to gcc-4.7 does not solve the alignment issue in 9.4.7 (resolve= d in 9.4.8) discussed here: >=20 > https://www.postgresql.org/message-id/20160413094117.GC21485@msg.credativ= .de >=20 > Tom Lane wrote: >=20 > > We never did get a clear explanation of why that crashed on Sparc. With gcc 4.7, against postgresql 9.4.7. Clean 9.4.7 fails contrib/test-decoding: LOG: server process (PID 18295) was terminated by signal 10: Bus error DETAIL: Failed process was running: SELECT data FROM pg_logical_slot_get_c= hanges('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xact= s', '1'); Reading symbols from /home/turelto/src/947/original/postgresql-9.4-9.4.7/bu= ild/src/backend/postgres...done. [New LWP 18295] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/sparc-linux-gnu/libthread_db.so.1". Core was generated by `postgres: turelto regression [local] SELECT = '. Program terminated with signal 10, Bus error. #0 ReorderBufferRestoreChange (data=3D0x5e1acf "", txn=3D0x6143a0, rb=3D0x= 614318) at /home/turelto/src/947/original/postgresql-9.4-9.4.7/build/../src/bac= kend/replication/logical/reorderbuffer.c:2327 2327 Size tuplelen =3D ((Heap= Tuple) data)->t_len; (gdb) l 2322 data +=3D tuplelen; 2323 } 2324 2325 if (change->data.tp.newtuple) 2326 { 2327 Size tuplelen =3D ((Heap= Tuple) data)->t_len; 2328 2329 change->data.tp.newtuple =3D 2330 ReorderBufferGetTupleBuf(rb= , tuplelen - offsetof(HeapTupleHeaderData, t_bits)); 2331 After applying this commit from 9.4.8 against 9.4.7, patched 9.4.7 passes a= ll tests: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D00= 45691 Assembly snippet around line 2327 before patching: .LBB695: .LBB694: .loc 3 52 0 mov 20, %o2 add %o0, 4, %o0 .LVL301: call memcpy, 0 add %l6, %l4, %l7 .LVL302: .LBE694: .LBE695: .loc 1 2318 0 ld [%l5+28], %g2 .LBB696: .LBB697: .loc 3 52 0 mov %l6, %o1 mov %l4, %o2 .LBE697: .LBE696: .loc 1 2318 0 add %g2, 35, %g1 and %g1, -8, %g1 .loc 1 2317 0 st %g1, [%g2+20] .LVL303: .loc 1 2321 0 ld [%l5+28], %g1 .LBB699: .LBB698: .loc 3 52 0 call memcpy, 0 ld [%g1+20], %o0 .LVL304: .LBE698: .LBE699: .LBE691: .loc 1 2325 0 ld [%l5+32], %g1 .L355: cmp %g1, 0 be,a,pn %icc, .L356 ld [%i1+84], %g2 .LBB700: .loc 1 2327 0 ld [%l7], %l6 .LVL305: .loc 1 2330 0 mov %i0, %o0 call ReorderBufferGetTupleBuf, 0 add %l6, -23, %o1 .LVL306: .loc 1 2329 0 st %o0, [%l5+32] .LVL307: .LBB701: .LBB702: .loc 3 52 0 mov %l7, %o1 mov 20, %o2 .LVL308: call memcpy, 0 add %o0, 4, %o0 .LVL309: .LBE702: .LBE701: .loc 1 2339 0 ld [%l5+32], %g1 .LBB703: .LBB704: .loc 3 52 0 add %l7, 20, %o1 .LVL310: mov %l6, %o2 .LBE704: .LBE703: .loc 1 2339 0 add %g1, 35, %g2 and %g2, -8, %g2 .loc 1 2338 0 st %g2, [%g1+20] .LVL311: .loc 1 2342 0 ld [%l5+32], %g1 .LBB706: .LBB705: .loc 3 52 0 call memcpy, 0 ld [%g1+20], %o0 .LVL312: .LBE705: .LBE706: .LBE700: .LBB707: .LBB708: Assembly snippet after patching: .LBB699: .LBB698: .loc 3 52 0 mov 20, %o2 add %o0, 4, %o0 .LVL301: call memcpy, 0 add %l6, %l4, %l7 .LVL302: .LBE698: .LBE699: .loc 1 2322 0 ld [%l5+28], %g2 .LBB700: .LBB701: .loc 3 52 0 mov %l6, %o1 mov %l4, %o2 .LBE701: .LBE700: .loc 1 2322 0 add %g2, 35, %g1 and %g1, -8, %g1 .loc 1 2321 0 st %g1, [%g2+20] .LVL303: .loc 1 2325 0 ld [%l5+28], %g1 .LBB703: .LBB702: .loc 3 52 0 call memcpy, 0 ld [%g1+20], %o0 .LVL304: .LBE702: .LBE703: .LBE695: .loc 1 2329 0 ld [%l5+32], %g1 .L355: cmp %g1, 0 be,a,pn %icc, .L356 ld [%i1+84], %g2 .LVL305: .LBB704: .LBB705: .LBB706: .loc 3 52 0 ldub [%l7], %g1 .LBE706: .LBE705: .loc 1 2338 0 mov %i0, %o0 .LBB708: .LBB707: .loc 3 52 0 stb %g1, [%fp-1036] .LVL306: ldub [%l7+1], %g1 stb %g1, [%fp-1035] ldub [%l7+2], %g1 stb %g1, [%fp-1034] ldub [%l7+3], %g1 stb %g1, [%fp-1033] .LBE707: .LBE708: .loc 1 2338 0 ld [%fp-1036], %o1 call ReorderBufferGetTupleBuf, 0 add %o1, -23, %o1 .LVL307: .loc 1 2337 0 st %o0, [%l5+32] .LVL308: .LBB709: .LBB710: .loc 3 52 0 mov %l7, %o1 mov 20, %o2 .LVL309: call memcpy, 0 add %o0, 4, %o0 .LVL310: .LBE710: .LBE709: .loc 1 2347 0 ld [%l5+32], %g1 .LBB711: .LBB712: .loc 3 52 0 add %l7, 20, %o1 .LVL311: ld [%fp-1036], %o2 .LBE712: .LBE711: .loc 1 2347 0 add %g1, 35, %g2 and %g2, -8, %g2 .loc 1 2346 0 st %g2, [%g1+20] .LVL312: .loc 1 2350 0 ld [%l5+32], %g1 .LBB714: .LBB713: .loc 3 52 0 call memcpy, 0 ld [%g1+20], %o0 .LVL313: .LBE713: .LBE714: .LBE704: .LBB715: .LBB716: Best regards, Tom Turelinckx --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs