From owner-freebsd-arm@freebsd.org Sat Aug 27 10:42:17 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC5EA93FFD for ; Sat, 27 Aug 2016 10:42:17 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D063A0B for ; Sat, 27 Aug 2016 10:42:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 11037 invoked from network); 27 Aug 2016 10:36:22 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 27 Aug 2016 10:36:22 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.00.0) with SMTP; Sat, 27 Aug 2016 06:35:38 -0400 (EDT) Received: (qmail 18782 invoked from network); 27 Aug 2016 10:35:34 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 27 Aug 2016 10:35:34 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 4F9751C4379; Sat, 27 Aug 2016 03:35:29 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: Time to enable partial relro [a stable/11 -r304029 armv6 "PT2MAP abort" (copyout+0x2c4) panic possibly related to enabling RELRO?] Date: Sat, 27 Aug 2016 03:35:29 -0700 Message-Id: <1178F89E-F1A3-4B72-8906-EFB8EFCE9F7D@dsl-only.net> Cc: FreeBSD Current To: FreeBSD Toolchain , freebsd-arm , freebsd-stable@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 10:42:17 -0000 [I've no solid evidence of what the panic is tied to. = OPTIONS_FILE_SET+=3DRELRO ise is just what was new/unusual in the = portmaster -DKa that was going on when the rpi2 had the panic.] The console history shows (the cc quoted just gives a ball park for = where it was in the binutils build): > cc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include = -pipe -mcpu=3Dcortex-a7 -I/usr/local/include -g -fno-strict-aliasing = -DENABLE_PLUGINS -DLOCAL > EDIR=3D"\"/usr/local/share/locale\"" -mcpu=3Dcortex-a7 -W -Wall = -Wstrict-prototypes -Wmissing-prototypes -Wshadow = -DELF_LIST_OPTIONS=3DTRUE -DELF_SHLIB_LIST_OPTIONS=3DT > RUE -DELF_PLT_UNWIND_LIST_OPTIONS=3DTRUE -pipe -mcpu=3Dcortex-a7 = -I/usr/local/include -g -fno-strict-aliasing -MT eavrxmega2.o -MD -MP = -MF .deps/eavrxmega2.Tpo -c=20 > -o eavrxmega2.o eavrxmega2.c > panic: pmap_fault: PT2MAP abort > cpuid =3D 3 > KDB: stack backtrace: > db_trace_self() at db_trace_self > pc =3D 0xc06b2ad0 lr =3D 0xc014edf4 = (db_trace_self_wrapper+0x30) > sp =3D 0xed27c880 fp =3D 0xed27c998 > db_trace_self_wrapper() at db_trace_self_wrapper+0x30 > pc =3D 0xc014edf4 lr =3D 0xc0336968 (vpanic+0x13c) > sp =3D 0xed27c9a0 fp =3D 0xed27c9c0 > r4 =3D 0x00000100 r5 =3D 0xc4125a50 > r6 =3D 0xc076ab91 r7 =3D 0x00000001 > vpanic() at vpanic+0x13c > pc =3D 0xc0336968 lr =3D 0xc033682c (vpanic) > sp =3D 0xed27c9c8 fp =3D 0xed27c9cc > r4 =3D 0xc0991ba0 r5 =3D 0x00000000 > r6 =3D 0xbfefefe8 r7 =3D 0x00000007 > r8 =3D 0x00000013 r9 =3D 0x00000007 > r10 =3D 0xc41daf44 > vpanic() at vpanic > pc =3D 0xc033682c lr =3D 0xc06ce40c (pmap_fault+0x638) > sp =3D 0xed27c9d4 fp =3D 0xed27ca08 > r4 =3D 0x00000007 r5 =3D 0x00000013 > r6 =3D 0x00000007 r7 =3D 0xc41daf44 > r8 =3D 0xed27c9cc r9 =3D 0xc033682c > r10 =3D 0xed27c9d4 > pmap_fault() at pmap_fault+0x638 > pc =3D 0xc06ce40c lr =3D 0xc06d30f8 (abort_handler+0xbc) > sp =3D 0xed27ca10 fp =3D 0xed27caa0 > r4 =3D 0xc0991ba0 r5 =3D 0x00000007 > r6 =3D 0x00000000 r7 =3D 0x00000007 > r8 =3D 0x00000013 r9 =3D 0xc4125a50 > r10 =3D 0xed27caa8 > abort_handler() at abort_handler+0xbc > pc =3D 0xc06d30f8 lr =3D 0xc06b53b8 (exception_exit) > sp =3D 0xed27caa8 fp =3D 0xed27cb60 > r4 =3D 0xc0991ba0 r5 =3D 0x00000000 > r6 =3D 0xbfbfaa04 r7 =3D 0x00000006 > r8 =3D 0xc41daf54 r9 =3D 0x00000806 > r10 =3D 0xc41daf44 > exception_exit() at exception_exit > pc =3D 0xc06b53b8 lr =3D 0xc03131e8 (__mtx_lock_sleep+0x220) > sp =3D 0xed27cb38 fp =3D 0xed27cb60 > r0 =3D 0x002fefe8 r1 =3D 0xbfc00000 > r2 =3D 0xc41daf44 r3 =3D 0x00000001 > r4 =3D 0xc0991ba0 r5 =3D 0x00000000 > r6 =3D 0xbfbfaa04 r7 =3D 0x00000006 > r8 =3D 0xc41daf54 r9 =3D 0x00000806 > r10 =3D 0xc41daf44 r12 =3D 0xed27ca78 > pmap_fault() at pmap_fault+0x1b4 > pc =3D 0xc06cdf88 lr =3D 0xc06d30f8 (abort_handler+0xbc) > sp =3D 0xed27cb68 fp =3D 0xed27cbf8 > r4 =3D 0x00000030 r5 =3D 0x00000006 > r6 =3D 0x00000000 r7 =3D 0x00000806 > r8 =3D 0x00000013 r9 =3D 0xc4125a50 > r10 =3D 0xed27cc00 > abort_handler() at abort_handler+0xbc > pc =3D 0xc06d30f8 lr =3D 0xc06b53b8 (exception_exit) > sp =3D 0xed27cc00 fp =3D 0x00000000 > r4 =3D 0x00000030 r5 =3D 0x00000000 > r6 =3D 0x00000000 r7 =3D 0xed27ccb4 > r8 =3D 0xed27ce00 r9 =3D 0x00000000 > r10 =3D 0xed27cea0 > exception_exit() at exception_exit > pc =3D 0xc06b53b8 lr =3D 0xc06ad77c (copyout+0x9c) > sp =3D 0xed27cc94 fp =3D 0x00000000 > r0 =3D 0xed27ccb8 r1 =3D 0xbfbfaa04 > r2 =3D 0x00000000 r3 =3D 0x00000000 > r4 =3D 0x00000030 r5 =3D 0x00000000 > r6 =3D 0x00000000 r7 =3D 0xed27ccb4 > r8 =3D 0xed27ce00 r9 =3D 0x00000000 > r10 =3D 0xed27cea0 r12 =3D 0x00000000 > copyout() at copyout+0x2c4 > pc =3D 0xc06ad9a4 lr =3D 0xc06ad77c (copyout+0x9c) > sp =3D 0xed27cc94 fp =3D 0x00000000 > copyout() at copyout+0x9c > pc =3D 0xc06ad77c lr =3D 0xc06ad77c (copyout+0x9c) > sp =3D 0xed27cc94 fp =3D 0x00000000 > Unwind failure (no registers changed) > KDB: enter: panic > [ thread pid 54457 tid 100158 ] > Stopped at $d.6: ldrb r15, [r15, r15, ror r15]! > db>=20 The portmaster -DKa attempt to rebuild binutils-2.27 on the rpi2 got my = first armv6 stable/11 panic (and it has been much longer then that since = I've gotten a 11.0-CURRENT panic). I was not around when the panic = happened but it is still sitting at the db> serial console prompt and I = can enter commands if appropriate. FreeBSD 11.0 context: The rpi2 was/is at /usr/src/ stable/11 -r304029 : = it has been a while since I've updated to track stable/11 . The few = differences in my /usr/src are mostly for powerpc and powerpc64 specific = changes: I normally use the same tree content everywhere that I build = FreeBSD. The build used -mcpu=3Dcortex-a7 as I've been doing since I = started tracking the clang 3.8.0 project before it was merged. Ports context: I had not updated by ports on the rpi2 in a while and I = "svnlite updated" my /usr/ports to -r420950, picking the newer option to = enable RELRO by default for things that have it. I enabled those = defaults. (Doing similarly on amd64 first has had no troubles for me so = far, not that I've done much after the portmaster -DKa .) =46rom the amd64 environment that I did an /usr/ports/ portmaster -DKa = update to first, also tied to -r420950: > # more /var/db/ports/devel_binutils/options > # This file is auto-generated by 'make config'. > # Options for binutils-2.27,1 > _OPTIONS_READ=3Dbinutils-2.27,1 > _FILE_COMPLETE_OPTIONS_LIST=3DNLS RELRO > OPTIONS_FILE_SET+=3DNLS > OPTIONS_FILE_SET+=3DRELRO > # svnlite info /usr/ports | grep Re[lv][ai:] > Relative URL: ^/head > Revision: 420950 > Last Changed Rev: 420950 > # more /etc/make.conf > WANT_QT_VERBOSE_CONFIGURE=3D1 > # > DEFAULT_VERSIONS+=3Dperl5=3D5.22 > WRKDIRPREFIX=3D/usr/obj/portswork > WITH_DEBUG=3D > WITH_DEBUG_FILES=3D > MALLOC_PRODUCTION=3D If I remember right the above are accurate for the rpi2 as well. I'll note that arm-none-eabi-binutils-2.27,1 built and installed fine = earlier in the portmaster -DKa activity. As did pkgconf-1.0.1 and = sqlite3-3.14.1 . (The console history goes not go back to earlier then = that. (sqlite3 is via dependencies, not something I directly select to = build.) =3D=3D=3D Mark Millard markmi at dsl-only.net