Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dO2zj-00045x-Oe for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Jun 2017 14:22:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dO2zi-0007kz-PW for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Jun 2017 14:22:02 +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 1dO2zi-0007kW-5q for pgsql-bugs@postgresql.org; Thu, 22 Jun 2017 14:22:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dO2zf-0004PO-LB for pgsql-bugs@postgresql.org; Thu, 22 Jun 2017 14:22:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v5MELwGv024676; Thu, 22 Jun 2017 10:21:58 -0400 From: Tom Lane To: "Tom Turelinckx" cc: pgsql-bugs@postgresql.org Subject: Re: Bus error in formatting.c NUM_numpart_to_char (9.4.12, 9.6.3, sparc) In-reply-to: <000101d2eb5e$60a7ab60$21f70220$@turelinckx.be> References: <006b01d2eaa2$d4317be0$7c9473a0$@turelinckx.be> <2069.1498062248@sss.pgh.pa.us> <000101d2eb5e$60a7ab60$21f70220$@turelinckx.be> Comments: In-reply-to "Tom Turelinckx" message dated "Thu, 22 Jun 2017 15:49:31 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24674.1498141318.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 22 Jun 2017 10:21:58 -0400 Message-ID: <24675.1498141318@sss.pgh.pa.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" writes: > But I need more information / pointers to documentation on how to find an= d provide the information you need, as I have no experience with looking at= assembly code. The way to get an assembly code file is to substitute -S for -c in the compile command, and also remove any "-o file" option. So on my machine, in an already built PG tree, I check what switches we're using: $ cd src/backend/utils/adt $ rm formatting.o $ make formatting.o gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statemen= t -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-a= liasing -fwrapv -g -O2 -I../../../../src/include -D_GNU_SOURCE -c -o for= matting.o formatting.c Now I copy-and-paste all the switches except -c and -o: $ gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statem= ent -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict= -aliasing -fwrapv -g -O2 -I../../../../src/include -D_GNU_SOURCE -S formatt= ing.c Note it's important that -g be one of the switches, else you don't get line number annotations in the assembly. Now I have a formatting.s file with contents like .L275: .LBE196: .LBB197: .LBB193: .loc 1 2320 0 leal -1(%rcx), %edi cmpl $1, %edi jbe .L278 .loc 1 2322 0 cmpl $3, %ecx .p2align 4,,2 je .L279 .LVL216: .L246: .loc 1 2325 0 movq (%rdx), %rax testq %rax, %rax je .L244 .loc 1 2331 0 leaq 1(%r14), %rdi movq %r14, 48(%rsp) movq %rbx, 64(%rsp) .loc 1 2325 0 xorl %r10d, %r10d .loc 1 2331 0 movq %rdx, %rbx The important part of this for your purposes is the ".loc" annotations, which indicate the source line number the following code was generated from. Notice that's not unusual for the compiler to rearrange code so that instructions from different lines are interspersed --- here we can see that lines 2325 and 2331 got mingled together. So there might not be only one .loc annotation for the line where the crash is being reported. Anyway, find those annotation(s) and send us all the text for that area and maybe a few dozen lines on either side. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs