pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Thompson <jamest@math.ksu.edu>
Cc: PgSQL Interfaces <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] Odd program behaviour
Date: Mon, 08 Mar 1999 02:29:36 -0500
Message-ID: <3912.920878176@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.GSO.4.05.9903071657210.22421-100000@noether.math.ksu.edu>

James Thompson <jamest@math.ksu.edu> writes:
> I'm desperate here.  I've got two days invested in this and have not made
> any progress at all.  I'm hoping someone has run into the following and
> might be able to give me a clue.
> Everything works fine when saving data but pulling data from the database
> results in a segfault when using the TCL/TK front end.
> [ segfault is evidently inside malloc ]

A fairly reliable rule is that a segfault inside malloc means your
program has trodden on malloc's data structures that keep track of free
and allocated space in the malloc arena.  Usually this means you have
written off the end of a chunk of malloc'd space.  (Whether this is a
bug in the code that calculated the amount of space to ask for or a bug
in the code using the space is for you to say, of course.)

If you don't have any direct insights into the problem, I'd suggest
building your app with a debugging malloc package that will detect
the corruption as soon as possible.  One I've had good luck with
for apps that don't require huge amounts of space is Electric Fence.
(No URL at hand, but poke around the web and you should find it.)

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <3912.920878176@sss.pgh.pa.us>
Permalink:  ../3912.920878176@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3912.920878176@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jamest@math.ksu.edu
  Subject: Re: [INTERFACES] Odd program behaviour
  In-Reply-To: <3912.920878176@sss.pgh.pa.us>

* 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