Re: [HACKERS] s_lock.h problem on S/Linux

From: dg(at)illustra(dot)com (David Gould)
To: emkxp01(at)mtcc(dot)demon(dot)co(dot)uk
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] s_lock.h problem on S/Linux
Date: 1998-06-21 20:50:45
Message-ID: 9806212050.AA05492@hawk.illustra.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> David,
>
> After making your suggested changes and then doing a "make s_lock_test"
> I get the following error messages.
>
>
> [postgres(at)sparclinux buffer]$ make s_lock_test
> gcc -g -I../../../include -I../../../backend -O2 -I../.. -DS_LOCK_TEST=1
> s_lock.c -o s_lock_test
> /tmp/cca10794.s: Assembler messages:
> /tmp/cca10794.s:290: Error: Bad expression
> /tmp/cca10794.s:290: Error: Missing ')' assumed
> /tmp/cca10794.s:290: Error: Bad expression
> /tmp/cca10794.s:290: Error: Missing ')' assumed
> /tmp/cca10794.s:290: Error: Illegal operands
> /tmp/cca10794.s:440: Error: Bad expression
> /tmp/cca10794.s:440: Error: Missing ')' assumed
> /tmp/cca10794.s:440: Error: Bad expression
> /tmp/cca10794.s:440: Error: Missing ')' assumed
> /tmp/cca10794.s:440: Error: Illegal operands
> make: *** [s_lock_test] Error 1
>
> If I compile with -save-temps and look at the s_lock.s file I see, on
> line 290:-
>
> .stabn 68,0,131,.LM9-s_lock
> .LM9:
> .LL45:
> ldstub [[%i0]], %o0 <-------
> .stabn 68,0,134,.LM10-s_lock
> .LM10:
> and %o0,0xff,%o0
>
>
> The double square braces look strange to me so I removed the single
> braces in s_lock.h.
>
> The modified file compiles OK and in s_lock.s I can see:-
>
> .stabn 68,0,131,.LM9-s_lock
> .LM9:
> .LL45:
> ldstub [%i0], %o0
> .stabn 68,0,134,.LM10-s_lock
> .LM10:
> and %o0,0xff,%o0
>
> Now I know absoloutely nothing whatsoever about SPARC (or gnu)
> assembler so the code changes could result in nothing like a
> test and set function but...
>
> [postgres(at)sparclinux buffer]$ make s_lock_test
> gcc -g -I../../../include -I../../../backend -O2 -I../.. -DS_LOCK_TEST=1
> s_lock.c -o s_lock_test
> ./s_lock_test
> S_LOCK_TEST: this will hang for a few minutes and then abort
> with a 'stuck spinlock' message if S_LOCK()
> and TAS() are working.
>
> FATAL: s_lock(00020be8) at s_lock.c:215, stuck spinlock. Aborting.
>
> FATAL: s_lock(00020be8) at s_lock.c:215, stuck spinlock. Aborting.
> make: *** [s_lock_test] IOT trap/Abort (core dumped)
> make: *** Deleting file `s_lock_test'
>
> Running s_lock_test does result in a hang for a few minutes
> and then a "stuck spinlock" message so perhaps it's not all
> that bad. (Not sure about the core dump though :-( )
>
> Keith.

The core dump is expected. When a stuck spinlock is detected abort() is called
which makes the core dump. So it looks like it is working.

If you would, please send me the s_lock.s file and a diff for you changes
I will look at the generated code and if it looks ok will submit the patch.

Thanks,

-dg

David Gould dg(at)illustra(dot)com 510.628.3783 or 510.305.9468
Informix Software (No, really) 300 Lakeside Drive Oakland, CA 94612
"Don't worry about people stealing your ideas. If your ideas are any
good, you'll have to ram them down people's throats." -- Howard Aiken

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message lj644f 1998-06-22 01:40:01
Previous Message Bruce Momjian 1998-06-21 16:38:55 Re: [BUGS] About failed compile on BSDI 2.1