Re: Solaris ASM problem

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Theo Schlossnagle <jesus(at)omniti(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Solaris ASM problem
Date: 2006-04-29 11:58:18
Message-ID: 200604291158.k3TBwId09203@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Theo Schlossnagle wrote:
> Kris Jurka wrote:
>
> >
> >
> > On Fri, 28 Apr 2006, Theo Schlossnagle wrote:
> >
> >> Kris Jurka wrote:
> >>
> >>> Anyway the test exits with
> >>> Stuck spinlock (80618e9) detected at ./s_lock.c:355.
> >>>
> >>> on a linux gcc build this exits with
> >>> Stuck spinlock (0x5013ad) detected at ./s_lock.c:402.
> >>
> >>
> >> This seems like a different problem, no? The patch I sent in didn't
> >> touch any of the linux assembly bits. The linux test should pass to
> >> the end without an issue right?
> >>
> >
> > No, that's the desired ending. It prints:
> >
> > S_LOCK_TEST: this will print 1000 stars and then
> > exit with a 'stuck spinlock' message
> > if S_LOCK() and TAS() are working.
> >
> > The solaris version is just getting stuck before at another point before
> > the expected stuck point.
>
> I downloaded and tested this on my box. The first thing I noticed is
> that when compiling tas.s on Solaris 10 the -P flag was omitted (which
> is needed to have the #ifdef's process correctly). I did an: as -P
> tas.s by hand and then was able to repeat your problem.

You should see in backend/port/Makfile:

$(CC) $(CFLAGS) -c -P $<

Perhaps you didn't get that version yet.

> Looks like part of my patch wasn't applied (or I neglected to send it
> all). The cas operations are all word operations so the slock_t _MUST_
> be changed to a word.

Sorry, yes, that is my fault. I had to modify the macro test you
defined from __amd64 to __x86_64__, and didn't see the change in the
typedef. Fix applied.

---------------------------------------------------------------------------

>
> In src/include/storage/s_lock.h in the sun section, the slock_t must be
> an unsigned int:
>
> ; cvs diff -u src/include/storage/s_lock.h
> Index: src/include/storage/s_lock.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/include/storage/s_lock.h,v
> retrieving revision 1.151
> diff -u -r1.151 s_lock.h
> --- src/include/storage/s_lock.h 28 Apr 2006 03:43:19 -0000
> 1.151
> +++ src/include/storage/s_lock.h 29 Apr 2006 02:48:45 -0000
> @@ -765,7 +765,7 @@
>
> #if defined(__sun) && (defined(__i386) || defined(__x86_64__) ||
> defined(__sparc__) || defined(__sparc))
> #define HAS_TEST_AND_SET
> -typedef unsigned char slock_t;
> +typedef unsigned int slock_t;
>
> extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with,
>
> slock_t cmp);
>
>

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Hallgren 2006-04-29 13:42:13 stdout when running as a Windows service
Previous Message Martijn van Oosterhout 2006-04-29 10:39:04 Re: Exports from postgres