buserror on osx.4

Igor Sysoev is at rambler-co.ru
Thu Dec 21 11:47:03 MSK 2006


On Thu, 21 Dec 2006, Franklin Kingma wrote:

> On Dec 21, 2006, at 8:04 AM, Igor Sysoev wrote:
>
>> On Tue, 19 Dec 2006, Franklin Kingma wrote:
>> 
>>>> I could not reproduce the bug. I have tried on two Mac's and POWER5 
>>>> Linux.
>>>> What Mac and CPU do you use ? Has the CPU 64-bit mode ?
>>> 
>>> My mac is a 12" powerbook G4 1,33Ghz, with 1,25GB mem, so no 64 bit mode..
>> 
>> Could you do following:
>> 
>> echo 'int main() {}' > q.c
>> cc -o q q.c
>> gdb q
>> b main
>> run
>> disassemble ___compare_and_swap32
>
> (gdb) b main
> Breakpoint 1 at 0x1dd8
> (gdb) run
> Starting program: /Users/franklin/q
> Reading symbols for shared libraries . done
>
> Breakpoint 1, 0x00001dd8 in main ()
> (gdb) disassemble ___compare_and_swap32
> Dump of assembler code for function ___compare_and_swap32:
> 0xffff8080 <___compare_and_swap32+0>:   lwarx   r7,0,r5
> 0xffff8084 <___compare_and_swap32+4>:   cmplw   r7,r3
> 0xffff8088 <___compare_and_swap32+8>:   bne-    0xffff809c 
> <___compare_and_swap32+28>
> 0xffff808c <___compare_and_swap32+12>:  stwcx.  r4,0,r5
> 0xffff8090 <___compare_and_swap32+16>:  bne-    0xffff8080 
> <___compare_and_swap32>
> 0xffff8094 <___compare_and_swap32+20>:  li      r3,1
> 0xffff8098 <___compare_and_swap32+24>:  blr
> 0xffff809c <___compare_and_swap32+28>:  li      r3,0
> 0xffff80a0 <___compare_and_swap32+32>:  blr
> 0xffff80a4 <___compare_and_swap32+36>:  .long 0x0
> 0xffff80a8 <___compare_and_swap32+40>:  .long 0x0
> 0xffff80ac <___compare_and_swap32+44>:  .long 0x0
> 0xffff80b0 <___compare_and_swap32+48>:  .long 0x0
> 0xffff80b4 <___compare_and_swap32+52>:  .long 0x0
> 0xffff80b8 <___compare_and_swap32+56>:  .long 0x0
> 0xffff80bc <___compare_and_swap32+60>:  .long 0x0
> End of assembler dump.

OK, then I will do atomic operation using MacOSX builtin
OSAtomicCompareAndSwap32Barrier()


Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list