From owner-freebsd-ppc@freebsd.org Wed Jan 23 03:20:02 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614A214B8E85 for ; Wed, 23 Jan 2019 03:20:02 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-21.consmr.mail.gq1.yahoo.com (sonic306-21.consmr.mail.gq1.yahoo.com [98.137.68.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37FF38767D for ; Wed, 23 Jan 2019 03:20:01 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: jKqgsdkVM1lAHnRmSprULodtxzrMoXq2fPK235mZ7Kla1vNr.yU5T7VPg3V9Jtd bnuo7MS9..PH_0Uxtf2eM4XM0KKfC2N0Z91z74ofJ47yGaUqJ66rGUBA573SNollv3n9kZi2caln B_ODOnydFtXp_o9ZnUGPAgiDAvt44s_6m14.RPbxJVFG3iYkLV0y5vO03G_XoI5XhJPB7bKHRUXq DNk75dXUe9zlrGR5WBu9CCE6MvXmibqKd.EL0MkpLtvj4RiO0Pq3wcSqGz5TUryBi4nAMsw2OhIU 5pl1Y8vqK933safG0kG.boAk4tN3pqZp52C1AisxWkEulYPcm7Sla7GPueUOpNbrXsPQ0tJEnODe qf5RXZ_b2I79Fwo1iKHFYyKNAyP1be4hBUoTpMI6YHGtu04XhtSOQwE5lro8gEV_OTyiU85bzt9_ 2FUb0rYBdZhISu3LTCsJDxSV8cqcqELcD80EnmbLV03VQr1jxNE3OxOi.p2Vg8y6E.2u_9ojYVxx kDtcXJoX0nmN5GEUd1dpWjBX8V7iT.Ho6eUCTPVVXBJrNWYjJg4.IVFFpbRt6ht9nZvZVEkDYhyk FdkMQaa.8ADN.RG2uMc2IB_1aBWihK.jXBx1sbouOSpIybDOJPsr9pzypm7c2oOobpGibI4Omo48 Pa13YVhERX7YjqEP6nP5XOMvHXK0doMoflrdIeuNm5dX8k9UsRYYCtKZdenRJs0EFEW3C1ij68uv pffkCyM79MxomV.5NfFVIHCixr9qGpj4JaQhXK2CtOxevZMOS4.f8hivEgpdKRISpMCx4MhEXVtB Gc.9bVOFs7nsrY1N7iqTjH2jwODP8dWTq7PIIYyCQAAxR2OcIlFqtEpsQTVAXAejLCjZW3BE3qos UrtY4PgvYQSl1C7pfIuTh4peZrOnI912CjKUauNAULJ8lwTYx.ihxL5lJiQf0p9HjS9KcD5qirZM kgbxUNmNKI6k.xWFBV2wDjrLrylY1Yu1ps9Sk.IaC_C_ZGBsm.44rao.hIGrWtpJBJ8sVl0RmrPQ OcnPiMDAJMl0mj.XHgqg3PfgGtTyz4_SnQlcMKgfb6TS3sm4GoOysRZzF.lEAolJ6cZ_C Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Wed, 23 Jan 2019 03:19:54 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.102]) ([67.170.167.181]) by smtp420.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f40e541575bf573a5444b8a7409496a7; Wed, 23 Jan 2019 03:19:52 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: GDB TLS testing [actually running some tests finally but these tests fail] From: Mark Millard In-Reply-To: <2AAC9738-73BD-475A-888A-252EE853A5C6@yahoo.com> Date: Tue, 22 Jan 2019 19:19:51 -0800 Cc: "freebsd-ppc@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <493AC0BE-3EC6-42B7-B027-FFB6454761B5@yahoo.com> References: <19343397-859C-4629-A4A5-B0DCDE25957B@yahoo.com> <5AA68ED2-2615-438B-A6AE-406CBD8E49F7@yahoo.com> <20027C29-0093-4001-A135-23783F8B87F3@yahoo.com> <4048D2A4-7E14-481C-9B5D-00567BCF4463@yahoo.com> <2AAC9738-73BD-475A-888A-252EE853A5C6@yahoo.com> To: John Baldwin X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 37FF38767D X-Spamd-Bar: - X-Spamd-Result: default: False [-1.96 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.30)[0.304,0]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.23)[ipnet: 98.137.64.0/21(0.69), asn: 36647(0.55), country: US(-0.08)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[84.68.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 03:20:02 -0000 On 2019-Jan-22, at 18:32, Mark Millard wrote: > On 2019-Jan-22, at 17:06, Mark Millard wrote: >=20 >=20 >=20 > . . . > So I'm trying: >=20 > # git clean -f > # rm */config.cache */*/config.cache > # env CPATH=3D/usr/local/include ./configure > . . . > # env CPATH=3D/usr/local/include gmake > . . . >=20 > in order to try to add paths after the command line -I paths. >=20 > . . . This looks like it built. I've not used the build yet. >=20 Looking at a *.core did not go well for my context: # cc -g -O2 tls_gdb_test.c=20 tls_gdb_test.c:16:2: warning: indirection of non-volatile null pointer = will be deleted, not trap [-Wnull-dereference] *(char *)NULL =3D 1; ^~~~~~~~~~~~~ tls_gdb_test.c:16:2: note: consider using __builtin_trap() or qualifying = pointer with 'volatile' 1 warning generated. FBSDG5L# ./a.out main: PID 70304 id =3D 70304 (0x810054020) Trace/BPT trap (core dumped) # ppc64_tls_git/gdb/gdb a.out a.out.70304.core=20 GNU gdb (GDB) 8.2.50.20190115-git Copyright (C) 2019 Free Software Foundation, Inc. . . . Reading symbols from a.out... [New LWP 100166] Core was generated by `./a.out'. Program terminated with signal SIGTRAP, Trace/breakpoint trap. #0 main (ac=3D, av=3D) at = tls_gdb_test.c:16 16 *(char *)NULL =3D 1; (gdb) bt #0 main (ac=3D, av=3D) at = tls_gdb_test.c:16 (gdb) p id Cannot find thread-local storage for LWP 100166, executable file = /root/c_tests/a.out: Cannot fetch runtime linker structure offsets (gdb) p &id Cannot find thread-local storage for LWP 100166, executable file = /root/c_tests/a.out: Cannot fetch runtime linker structure offsets (gdb)=20 Trying running under the gdb variant got stuck with gdb looping = indefinately: 70322 root 1 103 0 30M 20M 0 CPU2 2 3:12 = 101.06% ppc64_tls_git/gdb/gdb a.out That was for: # ppc64_tls_git/gdb/gdb a.out GNU gdb (GDB) 8.2.50.20190115-git Copyright (C) 2019 Free Software Foundation, Inc. . . . But I was able to ^C to get back to a (gdb) prompt and: (gdb) p id Cannot find thread-local storage for LWP 100111 of process 70323, = executable file /root/c_tests/a.out: Cannot fetch runtime linker structure offsets (gdb) p &id Cannot find thread-local storage for LWP 100111 of process 70323, = executable file /root/c_tests/a.out: Cannot fetch runtime linker structure offsets (gdb) info threads Id Target Id Frame=20 * 1 LWP 100111 of process 70323 main (ac=3D, = av=3D) at tls_gdb_test.c:16 So it looks to me to not be working with system-clang based compiles of = the example test from the original E-mail. But, looking around and using stepi ( with display/i $pc ) the code is = trying a trap instruction over and over: (gdb) disass Dump of assembler code for function main: 0x0000000010000adc <+0>: mflr r0 0x0000000010000ae0 <+4>: std r31,-8(r1) 0x0000000010000ae4 <+8>: std r0,16(r1) 0x0000000010000ae8 <+12>: stdu r1,-128(r1) 0x0000000010000aec <+16>: mr r31,r1 0x0000000010000af0 <+20>: std r30,112(r31) 0x0000000010000af4 <+24>: bl 0x10000600 = <00000017.plt_call.getpid@@FBSD_1.0> 0x0000000010000af8 <+28>: ld r2,40(r1) 0x0000000010000afc <+32>: mr r4,r3 0x0000000010000b00 <+36>: addis r3,r2,-2 0x0000000010000b04 <+40>: addi r3,r3,31952 0x0000000010000b08 <+44>: bl 0x100005e0 = <00000017.plt_call.printf@@FBSD_1.0> 0x0000000010000b0c <+48>: ld r2,40(r1) 0x0000000010000b10 <+52>: bl 0x10000600 = <00000017.plt_call.getpid@@FBSD_1.0> 0x0000000010000b14 <+56>: ld r2,40(r1) 0x0000000010000b18 <+60>: mr r30,r3 0x0000000010000b1c <+64>: nop 0x0000000010000b20 <+68>: nop 0x0000000010000b24 <+72>: addi r3,r13,4096 0x0000000010000b28 <+76>: nop 0x0000000010000b2c <+80>: addis r3,r3,0 0x0000000010000b30 <+84>: mr r4,r30 0x0000000010000b34 <+88>: stw r30,-32768(r3) 0x0000000010000b38 <+92>: addi r5,r3,-32768 0x0000000010000b3c <+96>: addis r3,r2,-2 0x0000000010000b40 <+100>: addi r3,r3,31966 0x0000000010000b44 <+104>: bl 0x100005e0 = <00000017.plt_call.printf@@FBSD_1.0> 0x0000000010000b48 <+108>: ld r2,40(r1) 0x0000000010000b4c <+112>: nop 0x0000000010000b50 <+116>: nop 0x0000000010000b54 <+120>: ld r3,-32728(r2) 0x0000000010000b58 <+124>: ld r4,-32720(r2) 0x0000000010000b5c <+128>: lwz r3,0(r3) 0x0000000010000b60 <+132>: cmplwi r3,0 0x0000000010000b64 <+136>: ld r3,0(r4) 0x0000000010000b68 <+140>: bne 0x10000b8c 0x0000000010000b6c <+144>: lwz r4,8(r3) 0x0000000010000b70 <+148>: addi r5,r4,-1 0x0000000010000b74 <+152>: cmpwi r4,0 0x0000000010000b78 <+156>: stw r5,8(r3) 0x0000000010000b7c <+160>: bgt 0x10000b98 0x0000000010000b80 <+164>: bl 0x10000620 = <00000017.plt_call.__srget@@FBSD_1.0> 0x0000000010000b84 <+168>: ld r2,40(r1) =3D> 0x0000000010000b88 <+172>: trap 0x0000000010000b8c <+176>: bl 0x10000640 = <00000017.plt_call.getc@@FBSD_1.0> 0x0000000010000b90 <+180>: ld r2,40(r1) 0x0000000010000b94 <+184>: trap 0x0000000010000b98 <+188>: ld r4,0(r3) 0x0000000010000b9c <+192>: addi r4,r4,1 0x0000000010000ba0 <+196>: std r4,0(r3) 0x0000000010000ba4 <+200>: trap 0x0000000010000ba8 <+204>: .long 0x0 0x0000000010000bac <+208>: .long 0x0 0x0000000010000bb0 <+212>: .long 0x0 End of assembler dump. I do not know if my context being a head -r341836 variant might = contribute (too old?). I may try some fairly modern gcc* variant(s) instead to see if that = makes a difference. For reference: the compile of the test was based on using -g -O2 . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)