On Saft, 30 Dec 2000, Thomas T. Thai wrote: i grabbed the CVS ball last night and tried to build it. i'm attaching a patch that made it possible to build -current on NetBSD/Alpha 1.5.1_ALPHA. i would appreciate it if you have cvs write access to integrate my patch back into the tree. after install, i did the regression test and it failed in the same way that 7.0.3+rkirkpat.patch did as described below (copy of my last post). > Date: Sat, 30 Dec 2000 01:42:11 -0600 (CST) > From: Thomas T. Thai <[EMAIL PROTECTED]> > To: Tom Lane <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED], Brent Verner <[EMAIL PROTECTED]>, > Ryan Kirkpatrick <[EMAIL PROTECTED]>, > Adriaan Joubert <[EMAIL PROTECTED]>, > Arrigo Triulzi <[EMAIL PROTECTED]> > Subject: NetBSD/Alpha and rkirkpat's patch [was Re: regress failed > tests.. SERIOUS?] > > On Fri, 29 Dec 2000, Tom Lane wrote: > > > Date: Fri, 29 Dec 2000 23:20:58 -0500 > > From: Tom Lane <[EMAIL PROTECTED]> > > To: Thomas T. Thai <[EMAIL PROTECTED]> > > Cc: PostgreSQL General <[EMAIL PROTECTED]> > > Subject: Re: regress failed tests.. SERIOUS? > > > > "Thomas T. Thai" <[EMAIL PROTECTED]> writes: > > > PLEASE NOTE: I'm brand new to PostgreSQL as of today. I've just moved from > > > MySQL because it's not stable on NetBSD/Alpha. I don't know enough about > > > pgsql to see if these failed test would make it unstable for production. > > > > Postgres 7.0.* will not work very well on Alpha unless you apply Ryan > > Kirkpatrick's patch set (I forget the URL offhand, but dig around in our > > archives and you'll find it). 7.1 should be a lot better. If you'd > > like to help out testing 7.1, please grab current sources from the CVS > > server, or grab a snapshot tarball dated tomorrow or later. > > i did just that. i applied the patch that is available at: > > http://www.rkirkpat.net/software/#linux-alpha > > to my NetBSD/Alpha 1.5.1_ALPHA PostgreSQL 7.0.3 package. compiled with out > errors. some warnings about casting wrong pointers types etc, but they > seem harmless. > > even though Kirkpatrick said his patch was for the Linux/Alpha, most of > his modifications weren't so Linux centric as it was Alpha > centric. consequently, the patch worked out well for NetBSD/Alpha as well. > > > with the above patch, the regression now only failed on 2 tests: > > $ grep failed regress.out > float8 .. failed > timestamp .. failed > horology .. failed > > float8 did pass, just diff format of the error message. 'timestamp' and > 'horology' not only failed but caused many 'Fatal User Traps' logged in > newsyslog '/var/log/messages': > > <cut> > Dec 30 01:22:33 ns01 /netbsd: fatal user trap: > Dec 30 01:22:33 ns01 /netbsd: > Dec 30 01:22:33 ns01 /netbsd: trap entry = 0x1 (arithmetic trap) > Dec 30 01:22:33 ns01 /netbsd: a0 = 0x2 > Dec 30 01:22:33 ns01 /netbsd: a1 = 0x40000000000 > Dec 30 01:22:33 ns01 /netbsd: a2 = 0xffffffffffffffff > Dec 30 01:22:33 ns01 /netbsd: pc = 0x1201449f8 > Dec 30 01:22:33 ns01 /netbsd: ra = 0x120029ca4 > Dec 30 01:22:33 ns01 /netbsd: curproc = 0xfffffc0023bb6c98 > Dec 30 01:22:33 ns01 /netbsd: pid = 1705, comm = postgres > </cut> > > the 'fatal user trap' errors seem to happen whenever there is a query > that resulted in SQL error message "ERROR: floating point exception! The > last floating point operation either exceeded legal ranges or was a > divide by zero." > > > for the 'strings' test, it passed but this line in 'strings.sql' > > SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL; > > caused these output on the console: > > <cut> > pid 1684 (postgres): unaligned access: va=0x1a007dd25 pc=0x12014bd10 > ra=0x12014b > cac op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dd26 pc=0x12014bd10 > ra=0x12014b > cac op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dd27 pc=0x12014bd10 > ra=0x12014b > cac op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dced pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dcee pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dcef pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dcf1 pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dcf2 pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dcf3 pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > pid 1684 (postgres): unaligned access: va=0x1a007dcf5 pc=0x12014bd10 > ra=0x12014b > ce4 op=ldl > </cut> > > (but nothing in '/var/log/messages'). > > i'm attaching the regression.diffs file. in addition, i'm going to move > this thread to pgsql-bugs instead of pgsql-general. >
diff -ru /usr/local/source/postgresql/pgsql/src/backend/main/main.c /usr/local/build/pgsql-current/src/backend/main/main.c --- /usr/local/source/postgresql/pgsql/src/backend/main/main.c Fri Nov 24 21:45:47 2000 +++ /usr/local/build/pgsql-current/src/backend/main/main.c Sat Dec 30 15:06:34 +2000 @@ -25,13 +25,14 @@ #include <locale.h> #endif -#if defined(__alpha) && !defined(linux) && !defined(__FreeBSD__) +#if defined(__alpha) && !defined(linux) && !defined(__FreeBSD__) && +!defined(__NetBSD__) #include <sys/sysinfo.h> #include "machine/hal_sysinfo.h" #define ASSEMBLER #include <sys/proc.h> #undef ASSEMBLER #endif +#include <sys/param.h> #include "miscadmin.h" #include "bootstrap/bootstrap.h" diff -ru /usr/local/source/postgresql/pgsql/src/include/port/netbsd.h /usr/local/build/pgsql-current/src/include/port/netbsd.h --- /usr/local/source/postgresql/pgsql/src/include/port/netbsd.h Sun Oct 29 07:17:34 2000 +++ /usr/local/build/pgsql-current/src/include/port/netbsd.h Sat Dec 30 14:59:06 +2000 @@ -1,43 +1,48 @@ #if defined(__i386__) #define NEED_I386_TAS_ASM #define HAS_TEST_AND_SET +typedef unsigned char slock_t; #endif #if defined(__sparc__) #define NEED_SPARC_TAS_ASM #define HAS_TEST_AND_SET +typedef unsigned char slock_t; #endif #if defined(__vax__) #define NEED_VAX_TAS_ASM #define HAS_TEST_AND_SET +typedef unsigned char slock_t; #endif #if defined(__ns32k__) #define NEED_NS32K_TAS_ASM #define HAS_TEST_AND_SET +typedef unsigned char slock_t; #endif #if defined(__m68k__) #define HAS_TEST_AND_SET +typedef unsigned char slock_t; #endif #if defined(__arm__) #define HAS_TEST_AND_SET +typedef unsigned char slock_t; #endif #if defined(__mips__) /* # undef HAS_TEST_AND_SET */ +typedef unsigned char slock_t; #endif -#if defined(__powerpc__) +#if defined(__alpha__) #define HAS_TEST_AND_SET +typedef unsigned long slock_t; #endif #if defined(__powerpc__) +#define HAS_TEST_AND_SET typedef unsigned int slock_t; - -#else -typedef unsigned char slock_t; - #endif diff -ru /usr/local/source/postgresql/pgsql/src/include/storage/s_lock.h /usr/local/build/pgsql-current/src/include/storage/s_lock.h --- /usr/local/source/postgresql/pgsql/src/include/storage/s_lock.h Fri Dec 29 20:34:56 2000 +++ /usr/local/build/pgsql-current/src/include/storage/s_lock.h Sat Dec 30 14:59:37 +2000 @@ -241,7 +241,17 @@ #if defined(NEED_NS32K_TAS_ASM) #define TAS(lock) tas(lock) +#if defined(__GNUC__) +/* + * GCC on the Alpha doesn't appear to handle inlining of assembly with + * %0 or %1 properly. This removes the inlining of the tas (test-and-set) + * function, which probably slows things down considerably, but correctness + * first! + */ +static int +#else static __inline__ int +#endif tas(volatile slock_t *lock) { register _res; diff -ru /usr/local/source/postgresql/pgsql/src/interfaces/odbc/psqlodbc.c /usr/local/build/pgsql-current/src/interfaces/odbc/psqlodbc.c --- /usr/local/source/postgresql/pgsql/src/interfaces/odbc/psqlodbc.c Fri Jul 14 11:40:40 2000 +++ /usr/local/build/pgsql-current/src/interfaces/odbc/psqlodbc.c Sat Dec 30 +14:50:31 2000 @@ -110,7 +110,7 @@ #else /* not __GNUC__ */ /* These two functions do shared library initialziation on UNIX, well at least - * on Linux. I don't know about other systems. + * on Linux and some of the BSDs. I don't know about other systems. */ BOOL _init(void)