From owner-freebsd-arm@FreeBSD.ORG Fri Jun 20 15:10:25 2014 Return-Path: Delivered-To: arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC3C590A for ; Fri, 20 Jun 2014 15:10:25 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED812AD9 for ; Fri, 20 Jun 2014 15:10:25 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s5KFAO0P072805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 20 Jun 2014 08:10:24 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s5KFAOOW072804 for arm@FreeBSD.org; Fri, 20 Jun 2014 08:10:24 -0700 (PDT) (envelope-from jmg) Date: Fri, 20 Jun 2014 08:10:24 -0700 From: John-Mark Gurney To: arm@FreeBSD.org Subject: Re: AVILA getting close! Message-ID: <20140620151023.GZ31367@funkthat.com> Mail-Followup-To: arm@FreeBSD.org References: <20140618225808.GG31367@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140618225808.GG31367@funkthat.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 20 Jun 2014 08:10:24 -0700 (PDT) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 15:10:25 -0000 John-Mark Gurney wrote this message on Wed, Jun 18, 2014 at 15:58 -0700: > So, w/ the recent couple of patches that alc has provided, I no longer > receive kernel panics on my AVILA board! > > $ uname -a > FreeBSD avila.funkthat.com 11.0-CURRENT FreeBSD 11.0-CURRENT #27 r267333:267349M: Wed Jun 11 09:57:58 PDT 2014 jmg@carbon.funkthat.com:/usr/obj/arm.armeb/usr/src.avila/sys/AVILA arm > $ uptime > 12:15AM up 1 day, 15 mins, 2 users, load averages: 0.13, 0.11, 0.08 > > This survived a portsnap extract... This is all over NFS... > > Though the issue that I'm now having is that some binaries (newsyslog) > and sometimes other binaries (awk, grep) core dump... > > I believe this is an issue w/ rtld, or related... If I compile newsyslog > -static, it works fine... Otherwise I get a SIGILL, and that is > because it jumps off into the weeds.. Though gdb on arm isn't very > useful.. ok, so the SIGILL only occures under gdb, and this is because single stepping into a RAS sequence doesn't work very well... If you set a break point on the return (after the RAS sequence), you can get past this... I got to the point in rtld.c code: if (obj->pltrel) rel = (const Elf_Rel *) ((caddr_t) obj->pltrel + reloff); else rel = (const Elf_Rel *) ((caddr_t) obj->pltrela + reloffand was seeing gdb try to execute the pltrela line, but: i; and was seeing gdb try to execute the pltrela line, but: (gdb) print * (const Elf_Rel *) ((caddr_t) obj->pltrela + reloff) Error accessing memory address 0x118: Bad address. (gdb) print/x obj->pltrela $4 = 0x0 (gdb) print /x reloff $5 = 0x118 (gdb) print obj->pltrel $6 = (const Elf_Rel *) 0x94e8 Hun? obj->pltrel is non-zero, so it should have executed the other line... I recompiled rtld w/ -O0, and sure enough, newsyslog runs fine... If I compile w/o -O, or w/ -O1, it fails... Comments or suggestions? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."