Re: vsnprintf and 64-bit Solaris 7 (was: abnormal exits) - Mailing list pgsql-general

From Tom Lane
Subject Re: vsnprintf and 64-bit Solaris 7 (was: abnormal exits)
Date
Msg-id 5418.1015264397@sss.pgh.pa.us
Whole thread Raw
In response to vsnprintf and 64-bit Solaris 7 (was: abnormal exits)  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-general
Andrew Sullivan <andrew@libertyrms.info> writes:
> [ 64-bit build on Solaris 7 fails ]

> The answer is to edit src/backend/port/Makefile and add "snprintf.o"
> to OBJS.

While updating FAQ_Solaris I realized that the above is not sufficient:
it will cause the backend to include the corrected vsnprintf(), but the
client libraries and utilities need it too.  So you need to also change
src/Makefile.global.  I've added the following entry to FAQ_Solaris:

----------
5) Why does my 64-bit build sometimes crash?

On Solaris 7 and older, the 64-bit version of libc has a buggy vsnprintf
routine, which leads to erratic core dumps in PostgreSQL.  The simplest known
workaround is to force PostgreSQL to use its own version of vsnprintf rather
than the library copy.  To do this, after you run 'configure' edit two files
produced by configure:

(1) In src/Makefile.global, change the line
    SNPRINTF =
to read
    SNPRINTF = snprintf.o

(2) In src/backend/port/Makefile, add "snprintf.o" to OBJS.  (Skip this
step if you see "$(SNPRINTF)" already listed in OBJS.)

Then build as usual.
----------

(The parenthetical remark is because I've fixed current sources so that
the port makefile won't need to be edited separately.  But in 7.2 you
need to hit both files.)

            regards, tom lane

pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: Which trigger execute which function?
Next
From: Oliver Elphick
Date:
Subject: Re: pgaccess