dbTalk Databases Forums  

Re: [BUGS] [ADMIN] Repeatable crash in pg_dump (with -d2 info)

mailing.database.pgsql-admin mailing.database.pgsql-admin


Discuss Re: [BUGS] [ADMIN] Repeatable crash in pg_dump (with -d2 info) in the mailing.database.pgsql-admin forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] [ADMIN] Repeatable crash in pg_dump (with -d2 info) - 08-27-2012 , 08:58 AM






On Tue, Jan 17, 2012 at 04:46:50PM -0500, David Schnur wrote:
Quote:
I finally had time to test this further on a variety of systems, and was unable
to reproduce on any non-Windows platform. The dump even works fine on Windows
XP; just not Windows 7.

This prompted me to do a little more research, and this time I found this
thread from Sept. 2011:

http://postgresql.1045698.n5.nabble.com/
BUG-6233-pg-dump-hangs-with-Access-Violation-C0000005-td4851598.html

From Tom Lane in the above thread:


Hmm. I can see how that would happen if you're using one of the Windows
environments wherein malloc's done inside libpq have to be free'd inside
libpq. (The PQExpBuffer support code is in libpq...)



However, the flaw in that explanation is that it would basically mean
pg_dump doesn't work at all on Windows, at least not if you have any
user-defined functions, and probably some other cases too because there
seem to be multiple instances of the dubious coding. It's a bit hard to
believe that nobody's noticed that before.


This appears to describe exactly the issue I'm encountering, and my build is in
fact linked against the static runtime. I guess the reason this hasn't come up
sooner is because most Windows users either use the 'official' binaries rather
than compiling from source, or link against the dynamic runtime.

Is this something I could expect to be fixed in the near future, or is it
enough of an edge case that I should come up with some solution or work-around
on my own? Thanks,
Late reply, but I don't see any way we could fix this easily.

--
Bruce Momjian <bruce (AT) momjian (DOT) us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
  #2  
Old   
Robert Haas
 
Posts: n/a

Default Re: [BUGS] [ADMIN] Repeatable crash in pg_dump (with -d2 info) - 09-06-2012 , 01:45 PM






On Mon, Aug 27, 2012 at 9:58 AM, Bruce Momjian <bruce (AT) momjian (DOT) us> wrote:
Quote:
On Tue, Jan 17, 2012 at 04:46:50PM -0500, David Schnur wrote:
I finally had time to test this further on a variety of systems, and was unable
to reproduce on any non-Windows platform. The dump even works fine on Windows
XP; just not Windows 7.

This prompted me to do a little more research, and this time I found this
thread from Sept. 2011:

http://postgresql.1045698.n5.nabble.com/
BUG-6233-pg-dump-hangs-with-Access-Violation-C0000005-td4851598.html

From Tom Lane in the above thread:


Hmm. I can see how that would happen if you're using one of the Windows
environments wherein malloc's done inside libpq have to be free'd inside
libpq. (The PQExpBuffer support code is in libpq...)



However, the flaw in that explanation is that it would basically mean
pg_dump doesn't work at all on Windows, at least not if you have any
user-defined functions, and probably some other cases too because there
seem to be multiple instances of the dubious coding. It's a bit hard to
believe that nobody's noticed that before.


This appears to describe exactly the issue I'm encountering, and my build is in
fact linked against the static runtime. I guess the reason this hasn't come up
sooner is because most Windows users either use the 'official' binaries rather
than compiling from source, or link against the dynamic runtime.

Is this something I could expect to be fixed in the near future, or is it
enough of an edge case that I should come up with some solution or work-around
on my own? Thanks,

Late reply, but I don't see any way we could fix this easily.
To me it seems like mostly a case of chasing down all the places where
this happens. It's not impossible to do; it's just a bunch of work
that nobody's gotten excited about doing yet. We've fixed similar
issues in many other cases, IIUC.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] [ADMIN] Repeatable crash in pg_dump (with -d2 info) - 09-06-2012 , 03:02 PM



Robert Haas <robertmhaas (AT) gmail (DOT) com> writes:
Quote:
On Mon, Aug 27, 2012 at 9:58 AM, Bruce Momjian <bruce (AT) momjian (DOT) us> wrote:
From Tom Lane in the above thread:
Hmm. I can see how that would happen if you're using one of the Windows
environments wherein malloc's done inside libpq have to be free'd inside
libpq. (The PQExpBuffer support code is in libpq...)

Late reply, but I don't see any way we could fix this easily.

To me it seems like mostly a case of chasing down all the places where
this happens. It's not impossible to do; it's just a bunch of work
that nobody's gotten excited about doing yet. We've fixed similar
issues in many other cases, IIUC.
Well, the problem with what I suspect you're thinking of is that even
after we fixed all the existing trouble spots, it would keep on
breaking. Unless we found some mechanical way to warn about unsafe
coding; which in itself would be more work than I want to put into this.

However, a plan B occurs to me: what about preventing pg_dump from using
libpq's copy of PQExpBuffer? IIUC, a copy of the PQExpBuffer code
statically linked into pg_dump would be free of this problem. There's
not so much code there that this would be an intolerable price to pay.
(Besides, we could probably arrange for the extra copy to happen only on
Windows.)

regards, tom lane


--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.