pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: benny@hegne.de
To: pgsql-bugs@postgresql.org
Subject: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions
Date: Wed, 18 Sep 2013 10:05:44 +0000
Message-ID: <E1VMEdk-00031c-R3@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8461
Logged by:          Benjamin Wassermann
Email address:      benny@hegne.de
PostgreSQL version: 9.3.0
Operating system:   Windows
Description:        

Hi!


We are trying to build our own PostgreSQL 9.3 using Visual Studio 2005 on
Windows XP.


If we use the created pg_dump we get some “Heap Corruptions” and no database
dump will be created.
When we use the precomiled binaries from PostgreSQL 9.3 and use this pg_dump
we do NOT get any heap corruption and it works as expected.


To reproduce the bug you need a Microsoft Visual Studio 2005 with Version
8.0.50727.42.


Buildsteps:
1. Download the postgresql sources 9.3
2. Open a visual studio commandline and change to folder
"postgresql-9.2.3\src\tools\msvc". Execute the command "perl mkvcbuild.pl"
(make sure "ActivePerl" is installed, where using version "5.12.2 Build
1202").
3. In the root folder is now a pgpsql.sln, which u can open in visual
studio
4. Now change the "Build-Target" to Release
5. Now build the Projects in following steps and configuartions
	libpgport: 
		General > Use of MFC: "Use MFC in a Static Libary"
		Libarian: Ingore Specific Libary "Nafxcwd.lib" and "Libcmtd.lib"
		-> Build
	libpqtypes:
		General > Use of MFC: "Use MFC in a Static Libary"
		-> Build
	libpq:
		General > Use of MFC: "Use MFC in a Static Libary"
		Linker > Additional Dependencies: "ShFolder.lib" and "Advapi32.lib"
		-> Build
	libecpg:
		General > Use of MFC: "Use MFC in a Static Libary"
		-> Build
	libpgcommon:
		General > Use of MFC: "Use MFC in a Static Libary"
		-> Build
	psql:
		General > Use of MFC: "Use MFC in a Static Libary"
		Linker > Additional Dependencies: "Advapi32.lib"
		Rename the Function _dosmaperr to _test_dosmaperr
		-> Build
			If there is a error like: "ERROR: psqlscan.c could not be found" just do
the following:
			Open a commandline and call "flex.exe "<Path to
sources>\postgresql-9.2.3\src\bin\psql\psqlscan.l"
(http://gnuwin32.sourceforge.net/install.html). Now copy the created file to
"\postgresql-9.2.3\src\bin\psql\psqlscan.c".
		-> Build
	pg_dump:
		General > Use of MFC: "Use MFC in a Static Libary"
		Linker > Additional Dependencies: "Advapi32.lib" and "zlib.lib" (path
example with default installation: "C:\Programme\GnuWin32\lib\zlib.lib")
		C/C++ > Preprocessor Definitions: "HAVE_LIBZ"
		C/C++ > Additional Include Directories: C:\Programme\GnuWin32\include 
		-> Build
		
Now we have installed a PostgreSQL Server 9.3 on the same machine.


In Visual Studio we defined as "Command Arguments" the following:
"-h "localhost" -p 5432 -U postgres -f "C:\test.bak" -F c test"


Now start debugging and u will get the Heap corruption in Visual Studio.


Exactly u will get the following ASSERTION:


---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!


Program: ...
File: dbgheap.c
Line: 1252


Expression: _CrtIsValidHeapPointer(pUserData)


For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.


(Press Retry to debug the application)
---------------------------
Abbrechen   Wiederholen   Ignorieren   
---------------------------


Which is caused from the Function "dumpFunc" at line 9942 ff.


...
	free(funcsig);
...


Hope you can reproduce this Bug.
	Is there a workaround we could use?


Regards


Benjamin




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



view thread (5+ messages)  latest in thread

Message-ID: <E1VMEdk-00031c-R3@wrigleys.postgresql.org>
Permalink:  ../E1VMEdk-00031c-R3@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1VMEdk-00031c-R3@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: benny@hegne.de
  Subject: Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions
  In-Reply-To: <E1VMEdk-00031c-R3@wrigleys.postgresql.org>
  References: <E1VMEdk-00031c-R3@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox