Re: bind fails with sig11 on start / pthread failure on ARM?

From: Bernd Walter <ticso_at_cicely7.cicely.de>
Date: Fri, 19 Feb 2010 22:38:11 +0100
On Fri, Feb 19, 2010 at 05:49:59PM +0100, Olivier Houchard wrote:
> > 
> > Strange:
> 
> 
> Not so much, the first values for ras_start/end were chosen to be immediate
> values, so you could just mov them, but the new one aren't.
> Try something like the patch attached instead (untested, I have no arm setup
> here, but you'll get the idea).

I just got an idea in wqhich direction to look, just to see a lot of fog
there, but that's my problem.
I'm not very good with ARM assembly and inline assembly, although I did
know a goo amount of alpha, 6502, 68k, ... assembly.

Anyway - your patch works (with minor fix):
[213]Please.tell.me.who.am.I# host -a www.freebsd.org 127.0.0.1
Trying "www.freebsd.org"
Using domain server:
Name: 10.1.1.9
Address: 10.1.1.9#53
Aliases: 

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26655
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 3, ADDITIONAL: 5

;; QUESTION SECTION:
;www.freebsd.org.               IN      ANY

;; ANSWER SECTION:
www.freebsd.org.        3600    IN      MX      0 .
www.freebsd.org.        3600    IN      AAAA    2001:4f8:fff6::21
www.freebsd.org.        3600    IN      A       69.147.83.33

;; AUTHORITY SECTION:
freebsd.org.            2019    IN      NS      ns3.isc-sns.info.
freebsd.org.            2019    IN      NS      ns2.isc-sns.com.
freebsd.org.            2019    IN      NS      ns1.isc-sns.net.

;; ADDITIONAL SECTION:
ns3.isc-sns.info.       2019    IN      A       63.243.194.1
ns3.isc-sns.info.       2019    IN      AAAA    2001:5a0:10::1
ns2.isc-sns.com.        19745   IN      A       38.103.2.1
ns1.isc-sns.net.        19745   IN      A       72.52.71.1
ns1.isc-sns.net.        19745   IN      AAAA    2001:470:1a::1

Received 284 bytes from 10.1.1.9#53 in 355 ms
[214]Please.tell.me.who.am.I# 

> 
> Regards,
> 
> Olivier

> Index: contrib/bind9/lib/isc/arm/include/isc/atomic.h
> ===================================================================
> --- contrib/bind9/lib/isc/arm/include/isc/atomic.h	(revision 203777)
> +++ contrib/bind9/lib/isc/arm/include/isc/atomic.h	(working copy)
> _at__at_ -49,26 +49,22 _at__at_
>  static inline isc_int32_t
>  isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val)
>  {
> -	register int done, ras_start;
> +	register int done, ras_start = #0xffff1004;

I had to remove the '#' in this line:
	register int done, ras_start = 0xffff1004;


>  
>  	__asm __volatile("1:\n"
>  	    "adr	%1, 1b\n"
> -	    "mov	%0, #0xe0000004\n"
>  	    "str	%1, [%0]\n"
> -	    "mov	%0, #0xe0000008\n"
>  	    "adr	%1, 2f\n"
> -	    "str	%1, [%0]\n"
> +	    "str	%1, [%0, #4]\n"
>  	    "ldr	%1, [%2]\n"
>  	    "cmp	%1, %3\n"
>  	    "streq	%4, [%2]\n"
>  	    "2:\n"
>  	    "mov	%3, #0\n"
> -	    "mov	%0, #0xe0000004\n"
>  	    "str	%3, [%0]\n"
>  	    "mov	%3, #0xffffffff\n"
> -	    "mov	%0, #0xe0000008\n"
> -	    "str	%3, [%0]\n"
> -	    : "=r" (ras_start), "=r" (done)
> +	    "str	%3, [%0, #4]\n"
> +	    : "+r" (ras_start), "=r" (done)
>  	    ,"+r" (p), "+r" (cmpval), "+r" (val) : : "memory");
>  	return (done);
>  


-- 
B.Walter <bernd_at_bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
Received on Fri Feb 19 2010 - 20:38:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:01 UTC