On 7/14/06, Tom Lane <[EMAIL PROTECTED]> wrote:
I wrote:
> Applied, thanks. What I now see is that pgp-pubkey-decrypt passes on
> a 32-bit machine but dumps core on a 64-bit machine, with SIGSEGV here:
Addendum: seems it only fails without openssl.
iMath's protability checks failed. Attached patch drops them
and expects postgres.h to give correct types.
Also enable asserts to fail earlier.
--
marko
Index: contrib/pgcrypto/imath.c
===================================================================
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/imath.c,v
retrieving revision 1.1
diff -u -c -r1.1 imath.c
*** contrib/pgcrypto/imath.c 13 Jul 2006 04:15:24 -0000 1.1
--- contrib/pgcrypto/imath.c 15 Jul 2006 01:12:52 -0000
***************
*** 33,39 ****
#include "imath.h"
#undef assert
! #define assert(TEST)
#define TRACEABLE_CLAMP 0
#define TRACEABLE_FREE 0
--- 33,39 ----
#include "imath.h"
#undef assert
! #define assert(TEST) Assert(TEST)
#define TRACEABLE_CLAMP 0
#define TRACEABLE_FREE 0
Index: contrib/pgcrypto/imath.h
===================================================================
RCS file: /opt/cvs/pgsql/contrib/pgcrypto/imath.h,v
retrieving revision 1.1
diff -u -c -r1.1 imath.h
*** contrib/pgcrypto/imath.h 13 Jul 2006 04:15:24 -0000 1.1
--- contrib/pgcrypto/imath.h 15 Jul 2006 01:15:02 -0000
***************
*** 39,49 ****
typedef unsigned int mp_size;
typedef int mp_result;
#ifdef USE_LONG_LONG
! typedef unsigned int mp_digit;
! typedef unsigned long long mp_word;
#else
! typedef unsigned short mp_digit;
! typedef unsigned int mp_word;
#endif
typedef struct mpz {
--- 39,53 ----
typedef unsigned int mp_size;
typedef int mp_result;
#ifdef USE_LONG_LONG
! typedef uint32 mp_digit;
! typedef uint64 mp_word;
! #define MP_DIGIT_MAX 0xFFFFFFFFULL
! #define MP_WORD_MAX 0xFFFFFFFFFFFFFFFFULL
#else
! typedef uint16 mp_digit;
! typedef uint32 mp_word;
! #define MP_DIGIT_MAX 0xFFFFUL
! #define MP_WORD_MAX 0xFFFFFFFFUL
#endif
typedef struct mpz {
***************
*** 70,90 ****
#define MP_DIGIT_BIT (sizeof(mp_digit) * CHAR_BIT)
#define MP_WORD_BIT (sizeof(mp_word) * CHAR_BIT)
- #ifdef USE_LONG_LONG
- # ifndef ULONG_LONG_MAX
- # ifdef ULLONG_MAX
- # define ULONG_LONG_MAX ULLONG_MAX
- # else
- # error "Maximum value of unsigned long long not defined!"
- # endif
- # endif
- # define MP_DIGIT_MAX (ULONG_MAX * 1ULL)
- # define MP_WORD_MAX ULONG_LONG_MAX
- #else
- # define MP_DIGIT_MAX (USHRT_MAX * 1UL)
- # define MP_WORD_MAX (UINT_MAX * 1UL)
- #endif
-
#define MP_MIN_RADIX 2
#define MP_MAX_RADIX 36
--- 74,79 ----
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings