Re: share library version problems - Mailing list pgsql-general

From Bryan White
Subject Re: share library version problems
Date
Msg-id 44EB7C31.1070809@arcamax.com
Whole thread Raw
In response to Re: share library version problems  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: share library version problems
List pgsql-general
Tom Lane wrote:
> Bryan White <bryan@arcamax.com> writes:
>> I am having problems with my libpq programs crashing.  This seems to be
>> a version incompatibility and I want to find out how to best proceed.
>
>> My main database is running Fedora Core 5 with the supplied PostgreSQL
>> 8.1.4.
>
>> My web server is running Fedora Core 4 with the supplied PostgreSQL 8.0.8.
>
>> My dev server was running the same setup as the web server.  The
>> difference is that it acts as its own database server.  I was
>> uncomfortable running an older version of the server on my test system
>> then on the live system.  So yesterday I removed the OS supplied
>> PostgreSQL RPMs and installed 8.1.4 from RPMs on the PostgreSQL download
>> site.
>
>> Today I discovered that programs that I compile on my dev server will
>> segfault when run on the live web server.
>
> Can you get a core dump and provide a gdb backtrace from the segfault?
> Right offhand I see no difference in the claimed API of 8.0 and 8.1
> libpq except that 8.1 adds lo_create(), which I suppose you're not
> using.  So while this isn't good practice in general, I don't see
> why it wouldn't work in this particular case.

I have used both gdp and valgrind with full debug builds.  The segfault
does not seem to occur in Postgres related code.  It occurs before any
database connection is established.  If it makes a difference, the code
is all written in C++.

The reason I suspect the Postgres lib is because there have been no
changes to this code.  After upgrading the dev server yesterday, I
rolled out a small fix this morning and started seeing the segfault.
Reverting the change did not fix it.  Compiling a clean subversion
checkout on both boxes confirmed that code compiled on the dev box will
not run on the web server but code compiled on the web server runs on
either box.

> One thing you should check is whether both libs were built with the same
> options (compare pg_config --configure output from the 8.0 and 8.1
> installations).

I think that might be the problem.  These are the differences in
pg_config --configure output:

dev server:
  '--host=i686-redhat-linux-gnu'
  '--build=i686-redhat-linux-gnu'
  '--target=i686-redhat-linux'
  '--with-includes=/usr/include'
  '--with-libraries=/usr/lib'
  'CFLAGS=-O2 -g -march=i686 -I/usr/include/et'
  'CPPFLAGS= -I/usr/include/et'
  'build_alias=i686-redhat-linux-gnu'
  'host_alias=i686-redhat-linux-gnu'
  'target_alias=i686-redhat-linux'

web server:
  '--build=i386-redhat-linux'
  '--host=i386-redhat-linux'
  '--target=i386-redhat-linux-gnu'
  '--with-tcl'
  '--with-tclconfig=/usr/lib'
  '--enable-thread-safety'
  'CFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32
-march=i386 -mtune=pentium4 -fasynchronous-unwind-tables'
  'build_alias=i386-redhat-linux'
  'host_alias=i386-redhat-linux'
  'target_alias=i386-redhat-linux-gnu'

I note that Postgres is packaged in the following RPMS:
postgresql-devel
postgresql-libs
postgresql-server
postgresql

Does it work to install the postgresql-server RPM from the 8.1 version
and the others from the Fedora 4 included 8.0 version?

--
Bryan White, ArcaMax Publishing Inc.



pgsql-general by date:

Previous
From: Don Isgitt
Date:
Subject: pl/R problem
Next
From: Bryan White
Date:
Subject: Re: share library version problems