Re: vsnprintf and 64-bit Solaris 7 (was: abnormal exits)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: vsnprintf and 64-bit Solaris 7 (was: abnormal exits)
Date: 2002-03-04 17:53:17
Message-ID: 5418.1015264397@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Sullivan <andrew(at)libertyrms(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-03-04 18:05:45 Re: pgaccess
Previous Message Joe Conway 2002-03-04 17:28:35 Re: [GENERAL] Which trigger execute which function?