From owner-freebsd-arm@FreeBSD.ORG Fri Feb 19 12:52:21 2010 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC13106566B; Fri, 19 Feb 2010 12:52:21 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 390BB8FC1D; Fri, 19 Feb 2010 12:52:20 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o1JCqHLs002599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Feb 2010 13:52:18 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o1JCq6oR005249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Feb 2010 13:52:07 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o1JCq6TS091614; Fri, 19 Feb 2010 13:52:06 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o1JCq6JB091613; Fri, 19 Feb 2010 13:52:06 +0100 (CET) (envelope-from ticso) Date: Fri, 19 Feb 2010 13:52:06 +0100 From: Bernd Walter To: Grzegorz Bernacki Message-ID: <20100219125206.GG43625@cicely7.cicely.de> References: <20100218131010.GQ50403@deviant.kiev.zoral.com.ua> <20100219031200.GY43625@cicely7.cicely.de> <20100219033000.GZ43625@cicely7.cicely.de> <20100218.204739.680961627231021262.imp@bsdimp.com> <20100219041200.GC43625@cicely7.cicely.de> <20100219120754.GE43625@cicely7.cicely.de> <4B7E840F.2040709@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B7E840F.2040709@semihalf.com> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on spamd.cicely.de Cc: current@freebsd.org, ticso@cicely7.cicely.de, arm@freebsd.org, kostikbel@gmail.com, ticso@cicely.de Subject: Re: bind fails with sig11 on start / pthread failure on ARM? X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 12:52:21 -0000 On Fri, Feb 19, 2010 at 01:29:03PM +0100, Grzegorz Bernacki wrote: > Bernd Walter wrote: > >On Fri, Feb 19, 2010 at 05:12:06AM +0100, Bernd Walter wrote: > >>On Thu, Feb 18, 2010 at 08:47:39PM -0700, M. Warner Losh wrote: > >>>In message: <20100219033000.GZ43625@cicely7.cicely.de> > >>> Bernd Walter writes: > >>>: Warner - it names you in the copyright, so very likely you know this > >>>code. > >>>: I will build a debug version of bind, but as usual it will take some > >>>: time... > >>> > >>>Make sure that the code matches our current atomics code... > >>There are just 3 functions. > >>isc_atomic_xadd and isc_atomic_store just wrap to atomic_fetchadd_int and > >>atomic_store_rel_int > >>isc_atomic_cmpxchg is inline assembly, but I don't think we have such a > >>function in our ARM atomic.h - at least I can't find it. > > > >#0 0x0015521c in isc_atomic_cmpxchg (p=0x155214, cmpval=0, val=1) at > >atomic.h:75 > >75 } > >[New Thread 20804500 (LWP 100100)] > >[New Thread 208043c0 (LWP 100099)] > >[New Thread 20804280 (LWP 100098)] > >[New Thread 20804140 (LWP 100043)] > >(gdb) bt > >#0 0x0015521c in isc_atomic_cmpxchg (p=0x155214, cmpval=0, val=1) at > >atomic.h:75 > >#1 0x00155a20 in isc_rwlock_lock (rwl=0x1c0fd4, type=isc_rwlocktype_write) > > at > > /data/builder/arm-current/head/lib/bind/isc/../../../contrib/bind9/lib/isc/rwlock.c:325 > >#2 0x000f8144 in dns_db_register (name=0x173fe8 "_builtin", > >create=0x4d46c , driverarg=0x2092b078, > > mctx=0x2080e0c0, dbimp=0x2092b08c) at > > /data/builder/arm-current/head/lib/bind/dns/../../../contrib/bind9/lib/dns/db.c:821 > >#3 0x0004d0b4 in dns_sdb_register (drivername=0x173fe8 "_builtin", > >methods=Variable "methods" is not available. > >) > > at > > /data/builder/arm-current/head/lib/bind/dns/../../../contrib/bind9/lib/dns/sdb.c:239 > >#4 0x0000c96c in ns_builtin_init () at > >/data/builder/arm-current/head/usr.sbin/named/../../contrib/bind9/bin/named/builtin.c:296 > >#5 0x0001a97c in $a () at > >/data/builder/arm-current/head/usr.sbin/named/../../contrib/bind9/bin/named/main.c:741 > >#6 0x0001a97c in $a () at > >/data/builder/arm-current/head/usr.sbin/named/../../contrib/bind9/bin/named/main.c:741 > >(gdb) print p > >$1 = (isc_int32_t *) 0x155214 > >(gdb) print *p > >$2 = -498139128 > >(gdb) > > > >Initially it looks like a valid pointer. > >But it also looks like a pointer in codespace, which of course would be > >non-writeable and can't be updated. > > > > Hi, > > Some time ago we changed an address of RAS. Probably that's the problem. > Please try > with patch below. I will try, but if p really points to codespace it should be a problem in a any of the calling functions. > grzesiek > > diff --git a/contrib/bind9/lib/isc/arm/include/isc/atomic.h > b/contrib/bind9/lib/ > index 6a6e984..2f12921 100644 > --- a/contrib/bind9/lib/isc/arm/include/isc/atomic.h > +++ b/contrib/bind9/lib/isc/arm/include/isc/atomic.h > @@ -53,9 +53,9 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, > isc_int > > __asm __volatile("1:\n" > "adr %1, 1b\n" > - "mov %0, #0xe0000004\n" > + "mov %0, #0xffff1004\n" > "str %1, [%0]\n" > - "mov %0, #0xe0000008\n" > + "mov %0, #0xffff1008\n" > "adr %1, 2f\n" > "str %1, [%0]\n" > "ldr %1, [%2]\n" > @@ -63,10 +63,10 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, > isc_i > "streq %4, [%2]\n" > "2:\n" > "mov %3, #0\n" > - "mov %0, #0xe0000004\n" > + "mov %0, #0xffff1004\n" > "str %3, [%0]\n" > "mov %3, #0xffffffff\n" > - "mov %0, #0xe0000008\n" > + "mov %0, #0xffff1008\n" > "str %3, [%0]\n" > : "=r" (ras_start), "=r" (done) > ,"+r" (p), "+r" (cmpval), "+r" (val) : : "memory"); > > -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.