From owner-freebsd-ppc@freebsd.org Thu Sep 27 19:20:09 2018 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 16DC110B69B5 for ; Thu, 27 Sep 2018 19:20:09 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-14.consmr.mail.bf2.yahoo.com (sonic314-14.consmr.mail.bf2.yahoo.com [74.6.132.124]) (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 B5AFE72E66 for ; Thu, 27 Sep 2018 19:20:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: pCCAqBkVM1kpv2r_3mB3SESMYjGJOM3AdK7GTPRNGQYIrAOjBx2MKD7jYc6nsUT vd5hMM4BATzQeCksXjzMIOOLydmvi0K8VtVVutzlJqcvqgzuhj4GsrbRvzc5O_6Mc9sdT3lxlju2 svG3GT0m596UsmJKQU4PC8vBg7B.U8x.cSBCl_GJBMIsh.SRqQa7Q6WE1bktFXGH_kk6kmremArq 0KWTlJnNKC5NfhJP6oA0eE74maBMSZRV2DVM67S9gT_MCUFWlRz.e1QGB4fLpbhZZAEGU67FweTz v8fN2jKyugCW6dxYnJiCZwr8sqTbDPby9YIBkvcxY9nR9E55cc_oBVr3DIBzBGRrpZRxW.fdSuAr .W9GdWtVhZcwPavJsgCwYP1.in8itBo8iOwgMqWa1e72L.gZXc1_trJvb.O0w.I5pEpK0M5VjXt8 HTh6FHCrudNnHpo3OsJra_D96SFbZGS8vmgHEhn1beSejuJHkiNku.EhyBLK0KB5x4bTWqrVCs17 pfFmn92MVKGWiphNzInGWTrsWMgElQzB.XDsuMVsHm.bpzsgsFjbDOjQ6I9O1hhAww1mmmkMY2xU EH0D3okYyJ31_WOcUYpe_gOZLDpcs5E7nqAwZfQ98rNvTeMvnXIlvt3.3tHWL9qfo5trM8qnzIg_ bZ2uWIo.tuHZmH7RUgwRVJg_aE304Z63reyASB_itmLSUPGidzhHLEDVP0d_8W6s2oWiIYfosHku 9xnZ_waOmW9e7rU_r.IINenCRbHwLK1nox8oyIk5sykmlmZ3Yl1KYauXF6jIoIf0dJF7boD5K4Rp f_bu0MmxzGdfQ4Vs.TLFUd8xv6q58o6Gl3LhKSKEcdlpvpKRn_k_rmVn6Jhdzm7y0VTV.w59ZKkO HbSQ6DDIj93s26Q66bcpkdODA.wrlXjEZ86q_ZneWJGwlqZmmOt4tljFioTAXrwzpcn66jKMh14U DEgNT8qVBSYlBUuE6xLRZgd.e_YtLBBS1VJv3OHX81VBZnYqHaAjTwY6eIUCxN.Pkkg9kQ.d7piN oZVs- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Thu, 27 Sep 2018 19:20:01 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp420.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 20c402149209a57057061f96c62a9870 for ; Thu, 27 Sep 2018 19:20:00 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Fwd: svn commit: r338930 - head/libexec/rtld-elf/powerpc Message-Id: Date: Thu, 27 Sep 2018 12:19:58 -0700 To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 19:20:09 -0000 The below is basically a forward of a powerpc-tied svn-src-head report for reference: Michael Tuexen tuexen at freebsd.org wrote on=20 Thu Sep 27 18:49:04 UTC 2018 : > > On 25. Sep 2018, at 21:29, Andreas Tobler = wrote: > >=20 > > Author: andreast > > Date: Tue Sep 25 19:29:35 2018 > > New Revision: 338930 > > URL: https://svnweb.freebsd.org/changeset/base/338930 > >=20 > > Log: > > Bring the 32-bit powerpc (PowerMac) back to live. The commit 338486 = reworked > > some TLS bits. This broke operation on the PowerMac. Namely one = could not login. > > At login the screen/shell was giving back lots of backslashes and = the login > > shell dumped core. > >=20 > > The fix to this issue is to revert the powerpc commit from 338486 = and to > > increase the TLS_TCB_SIZE to 16. > > Reverting only did not help, login was possible but userland = applications > > aborted with strange messages. > >=20 > > I tested this patch with world/kernel builds and with port = upgrades. > > Additionally a full gcc8 bootstrap was successfully completed. > >=20 > > Reviewed by: jhibbits@ > > Approved by: re (Glen) > >=20 > > Modified: > > head/libexec/rtld-elf/powerpc/rtld_machdep.h > >=20 > > Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h > > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > > --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Tue Sep 25 = 18:54:18 2018 (r338929) > > +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Tue Sep 25 = 19:29:35 2018 (r338930) > > @@ -69,12 +69,12 @@ void _rtld_powerpc_pltcall(void); > >=20 > > #define TLS_TP_OFFSET 0x7000 > > #define TLS_DTV_OFFSET 0x8000 > > -#define TLS_TCB_SIZE 8 > > +#define TLS_TCB_SIZE 16 > >=20 > > #define round(size, align) \ > > (((size) + (align) - 1) & ~((align) - 1)) > > #define calculate_first_tls_offset(size, align) \ > > - TLS_TCB_SIZE > > + round(8, align) > > #define calculate_tls_offset(prev_offset, prev_size, size, align) \ > > round(prev_offset + prev_size, align) > > #define calculate_tls_end(off, size) ((off) + (size)) > >=20 > After performing a buildworld/buildkernel and running r338956 on a = 32-bit powerpc machine (G4 Mac Mini), > the following program: >=20 > #include > #include > #include >=20 > void * > f(void * arg) > { > return (arg); > } >=20 > int > main(void) > { > void *res; > pthread_t tid; > int err; >=20 > if ((err =3D pthread_create(&tid, NULL, f, NULL)) !=3D 0) { > fprintf(stderr, "pthread_create: %s\n", strerror(err)); > } > if ((err =3D pthread_join(tid, &res)) !=3D 0) { > fprintf(stderr, "pthread_join: %s\n", strerror(err)); > } > return (0); > } >=20 > is killed: >=20 > tuexen at bsd5:~ % ./test > ld-elf.so.1: assert failed: = /usr/home/tuexen/head/libexec/rtld-elf/rtld.c:4753 > Abort (core dumped) >=20 > gdb shows: >=20 > tuexen at bsd5:~ % gdb -c test.core test > GNU gdb (GDB) 8.1 [GDB v8.1 for FreeBSD] > Copyright (C) 2018 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later = > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show = copying" > and "show warranty" for details. > This GDB was configured as "powerpc-portbld-freebsd12.0". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from test...done. > [New LWP 100112] > Core was generated by `./test'. > Program terminated with signal SIGABRT, Aborted. > #0 0x41829a58 in thr_kill () at thr_kill.S:3 > 3 RSYSCALL(thr_kill) > (gdb) bt > #0 0x41829a58 in thr_kill () at thr_kill.S:3 > #1 0x41829378 in __raise (s=3D6) > at /usr/home/tuexen/head/lib/libc/gen/raise.c:52 > #2 0x41823b84 in abort () at = /usr/home/tuexen/head/lib/libc/stdlib/abort.c:67 > #3 0x41813f58 in allocate_tls (objs=3D0x41843000, oldtcb=3D,=20 > tcbsize=3D8, tcbalign=3D) > at /usr/home/tuexen/head/libexec/rtld-elf/rtld.c:4753 > #4 0x41813fc0 in _rtld_allocate_tls (oldtls=3D0x0, tcbsize=3D8, = tcbalign=3D16) > at /usr/home/tuexen/head/libexec/rtld-elf/rtld.c:5030 > #5 0x41877438 in _tcb_ctor (thread=3D0x41a8d300, initial=3D) > at /usr/home/tuexen/head/lib/libthr/thread/thr_ctrdtr.c:45 > #6 0x41876ebc in _thr_alloc (curthread=3D0x41a8d000) > at /usr/home/tuexen/head/lib/libthr/thread/thr_list.c:172 > #7 0x41867118 in _pthread_create (thread=3D0xffffdc10, attr=3D0x0,=20 > start_routine=3D0x180073c , arg=3D0x0) > at /usr/home/tuexen/head/lib/libthr/thread/thr_create.c:81 > #8 0x01800798 in main () > (gdb) quit >=20 > Any idea what is wrong? >=20 > Best regards > Michael >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)