BUG #1897: dmalloc memory error on PQconnectdb

Started by Wade Hamptonover 20 years ago4 messagesbugs
Jump to latest
#1Wade Hampton
wade.hampton@nsc1.net

The following bug has been logged online:

Bug reference: 1897
Logged by: Wade Hampton
Email address: wade.hampton@nsc1.net
PostgreSQL version: 8.0.3-1
Operating system: Fedora Core 4
Description: dmalloc memory error on PQconnectdb
Details:

I have a multithreaded application using Postgresql and am testing for
memory leaks. I compiled and linked with dmallocth. My PGconnect() is now
causing a dmalloc abort. The error appears to be a calloc of 0 elements of
40 bytes in libkrb5, called from libpq.

The connection is to: hostaddr = 127.0.0.1 dbname = mydb

The same code with dmalloc works fine with Fedora Core 2.0, Postgresql
7.4.7-3.

There was a report of a similar problem in earlier versions:

http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg08081.html

In reply to: Wade Hampton (#1)
problem start database

hi,

i have a problem when i run the initdb file, do you know anything?

bash-2.05b$ /usr/lib/postgresql/bin/initdb -D /var/lib/pgsql/data
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

fixing permissions on existing directory /var/lib/pgsql/data ... ok
creating directory /var/lib/pgsql/data/global ... ok
creating directory /var/lib/pgsql/data/pg_xlog ... ok
creating directory /var/lib/pgsql/data/pg_xlog/archive_status ... ok
creating directory /var/lib/pgsql/data/pg_clog ... ok
creating directory /var/lib/pgsql/data/pg_subtrans ... ok
creating directory /var/lib/pgsql/data/base ... ok
creating directory /var/lib/pgsql/data/base/1 ... ok
creating directory /var/lib/pgsql/data/pg_tblspc ... ok
selecting default max_connections ... 10
selecting default shared_buffers ... 50
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/data/base/1 ... FATAL: XX000:
failed to initialize lc_messages to ""
LOCATION: InitializeGUCOptions, guc.c:2389
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/pgsql/data"

thanks.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Wade Hampton (#1)
Re: BUG #1897: dmalloc memory error on PQconnectdb

"Wade Hampton" <wade.hampton@nsc1.net> writes:

I have a multithreaded application using Postgresql and am testing for
memory leaks. I compiled and linked with dmallocth. My PGconnect() is now
causing a dmalloc abort. The error appears to be a calloc of 0 elements of
40 bytes in libkrb5, called from libpq.

(1) Why is that a bug? calloc of 0 elements is explicitly allowed by
the Single Unix Spec:
http://www.opengroup.org/onlinepubs/007908799/xsh/calloc.html

(2) If you do think it's a bug, why are you complaining to us rather
than to the Kerberos people?

regards, tom lane

#4Devrim GÜNDÜZ
devrim@gunduz.org
In reply to: Ing. Jhon Carrillo - Caracas, Venezuela (#2)
Re: problem start database

Hi,

On Tue, 20 Sep 2005, Ing. Jhon Carrillo - Caracas, Venezuela wrote:

i have a problem when i run the initdb file, do you know anything?

bash-2.05b$ /usr/lib/postgresql/bin/initdb -D /var/lib/pgsql/data
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

<snipped>

creating directory /var/lib/pgsql/data/pg_tblspc ... ok
selecting default max_connections ... 10
selecting default shared_buffers ... 50
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/data/base/1 ... FATAL: XX000:
failed to initialize lc_messages to ""
LOCATION: InitializeGUCOptions, guc.c:2389

This reminded me a bug that was fixed in 7.4.2. Are you using 7.4 or
7.4.1?

Regards,
--
Devrim GUNDUZ
Kivi Bili�im Teknolojileri - http://www.kivi.com.tr
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org

From pgsql-bugs-owner@postgresql.org Wed Sep 21 13:14:53 2005

X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org
Received: from localhost (av.hub.org [200.46.204.144])
by svr1.postgresql.org (Postfix) with ESMTP id 30E38D99C0
for <pgsql-bugs-postgresql.org@localhost.postgresql.org>; Wed, 21 Sep 2005 12:30:04 -0300 (ADT)
Received: from svr1.postgresql.org ([200.46.204.71])
by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024)
with ESMTP id 09822-05
for <pgsql-bugs-postgresql.org@localhost.postgresql.org>;
Wed, 21 Sep 2005 15:29:52 +0000 (GMT)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130])
by svr1.postgresql.org (Postfix) with ESMTP id D6F4AD9AB5
for <pgsql-bugs@postgresql.org>; Wed, 21 Sep 2005 12:24:44 -0300 (ADT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j8LFOboK014710;
Wed, 21 Sep 2005 11:24:37 -0400 (EDT)
To: "Ing. Jhon Carrillo - Caracas, Venezuela" <jdigital@cantv.net>
Cc: "Wade Hampton" <wade.hampton@nsc1.net>, pgsql-bugs@postgresql.org
Subject: Re: problem start database
In-reply-to: <043901c5bde4$daaf93a0$1400a8c0@tgusta2>
References: <20050919181855.E3CFCF0B77@svr2.postgresql.org> <6734.1127230866@sss.pgh.pa.us> <043901c5bde4$daaf93a0$1400a8c0@tgusta2>
Comments: In-reply-to "Ing. Jhon Carrillo - Caracas, Venezuela" <jdigital@cantv.net>
message dated "Tue, 20 Sep 2005 09:11:42 -0400"
Date: Wed, 21 Sep 2005 11:24:37 -0400
Message-ID: <14709.1127316277@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
X-Virus-Scanned: by amavisd-new at hub.org
X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006]
X-Spam-Level:
X-Archive-Number: 200509/136
X-Sequence-Number: 12876

"Ing. Jhon Carrillo - Caracas, Venezuela" <jdigital@cantv.net> writes:

creating template1 database in /var/lib/pgsql/data/base/1 ... FATAL: XX000:
failed to initialize lc_messages to ""

What PG version is this exactly, what platform are you running it on,
and what locale environment are you running initdb in? (For the last
question, show the output of "locale", or if you don't have that
program then "env | grep ^L".)

regards, tom lane