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?
Regards,
Thomas Hallgren
---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings
Peter Eisentraut 23 September 2004 15:12:29 [ permanent link ]
Am Donnerstag, 23. September 2004 13:02 schrieb Thomas Hallgren:> 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?
Because we are too lazy to fine-tune the build system for cases like this. The best solution would be to build zlib with symbol versioning.
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
Thomas Hallgren 23 September 2004 15:19:03 [ permanent link ]
Peter Eisentraut wrote:
Because we are too lazy to fine-tune the build system for cases like > this.>
The best solution would be to build zlib with symbol versioning.>
I'm not so sure. I think zlib is a commodity on most systems. You don't want to build it at all. Perhaps if I submit a patch that takes care of the fine-tuning?
- thomas
---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
Andrew Dunstan 23 September 2004 16:44:50 [ permanent link ]
Peter Eisentraut wrote:
Am Donnerstag, 23. September 2004 13:02 schrieb Thomas Hallgren:>
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?>>
Because we are too lazy to fine-tune the build system for cases like this. >The best solution would be to build zlib with symbol versioning.>
Or to be less lazy Is it such a huge task? There have been complaints before about our maximal linking.
cheers
andrew
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster
Peter Eisentraut <peter_e@gmx.net> writes:> Am Donnerstag, 23. September 2004 13:02 schrieb Thomas Hallgren:>> 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?
Because we are too lazy to fine-tune the build system for cases like this.
I was just reading about a linker option (--as-needed or something like that) that exists in more recent versions of the GNU linker. It means "only link the libraries actually referenced". Applying this or local equivalent where available would seem like a fairly painless way to solve the problem, at least on some platforms.
I agree that trying to keep track of the set of libraries really needed for each executable would be a hopeless task, but if we can make the linker fix it for us ...
regards, tom lane
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
Andrew Dunstan 23 September 2004 18:41:16 [ permanent link ]
Tom Lane wrote:
Peter Eisentraut <peter_e@gmx.net> writes:>
Am Donnerstag, 23. September 2004 13:02 schrieb Thomas Hallgren:>>
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?>>>
Because we are too lazy to fine-tune the build system for cases like this. >>
I was just reading about a linker option (--as-needed or something like>that) that exists in more recent versions of the GNU linker. It means>"only link the libraries actually referenced". Applying this or local>equivalent where available would seem like a fairly painless way to>solve the problem, at least on some platforms.>
I agree that trying to keep track of the set of libraries really needed>for each executable would be a hopeless task, but if we can make the>linker fix it for us ...>
|--no-as-needed| This option affects ELF DT_NEEDED tags for dynamic libraries mentioned on the command line after the |--as-needed| option. Normally, the linker will add a DT_NEEDED tag for each dynamic library mentioned on the command line, regardless of whether the library is actually needed. |--as-needed| causes DT_NEEDED tags to only be emitted for libraries that satisfy some reference from regular objects. |--no-as-needed| restores the default behaviour.
I'm not sure I understand why keeping track of what we need for each executable is such a difficult task, though. I count 23 executables and a handful of libraries. Is this such a herculean task?
cheers
andrew
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
Andrew Dunstan 24 September 2004 17:12:59 [ permanent link ]
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.
Not sure where that leaves us.
cheers
andrew
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Thomas Hallgren 24 September 2004 18:17:13 [ permanent link ]
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
---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
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.>
Not sure where that leaves us.>
cheers>
andrew>
---------------------------(end of broadcast)---------------------------> TIP 2: you can get off all lists at once with the unregister command> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)>
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
Now, to see the things postgres really needs, as opposed to things other libraries need or that we just throw in for good measure in case somebody needs them, run this:
LDFLAGS=-Wl,--as-necessary ./configure
without any third-party options (like pam, openssl, kerberos ...), Alternatively, you can set the flag in src/Makefile.global
This should work on FC2, which I believe has binutils 2.15.
Almost every line above will disappear.
cheers
andrew
---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Now, to see the things postgres really needs, as opposed to things > other libraries need or that we just throw in for good measure in case > somebody needs them, run this:>
LDFLAGS=-Wl,--as-necessary ./configure>
without any third-party options (like pam, openssl, kerberos ...), > Alternatively, you can set the flag in src/Makefile.global>
This should work on FC2, which I believe has binutils 2.15.>
Almost every line above will disappear.>
cheers>
andrew>
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
If you would like to report an abuse of our service, such as a spam message, please . Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .