Re: Use of zlib

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use of zlib
Date: 2004-09-24 15:17:13
Message-ID: thhal-09tIvAmPc3EAX72+X4FtDEt23KlmQy0@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:

>
>
> Thomas Hallgren wrote:
>
>> Problem:
>> PL/Java use a JVM. On some platforms and with some JVM's (Sun's in
>> particular) a libzip.so is bundled that contains a 1.1.3 version of
>> functions also provided in zlib (why they do this is beyond me, but
>> they do so I'll have to live with it). PostgreSQL is linked with zlib
>> by default. This resuls in a conflict which resuls in a JVM crash.
>>
>> I can circumvein this crash by using LD_PRELOAD to force a load of
>> the JVM bundled libzip.so but I suspect that might result in a crash
>> as soon as PostgreSQL calls on zlib to do something. It's of course
>> possible to configure postgresql with --without-zlib also provided
>> you have accesst o the source.
>>
>> Question:
>> From what I can understand from the documentation, the only utility
>> in PostgreSQL that actually uses zlib is pg_dump? If so, why is the
>> postgres process linked with -lz?
>>
>>
>
> I did a small experiment by installing binutils 2.15 and adding
> -Wl,--as-needed to the LDFLAGS, as Tom had suggested might be useful.
>
> This seemed to work quite well and trimmed back the needed libs quite
> a bit. However, when you configure --with-openssl, libz is again
> linked in.

From PL/Javas standpoint, I think it would be great if this change
could be incorporated into the 8.0 release. The openssl issue is
something I'll have to investigate. Perhaps it works using the libzip
from the JRE if I use LD_PRELOAD. I'm happy to see that Sun has an open
bug on the subject in their Bug Database (bug 4953050 if anyone is
interested).

Regards,

Thomas Hallgren

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2004-09-24 15:26:42 Re: PostgreSQL 8.0 beta3 on Monday
Previous Message Joshua D. Drake 2004-09-24 15:15:22 Re: SQL-Invoked Procedures for 8.1