Re: [INTERFACES] Odd program behaviour - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] Odd program behaviour
Date
Msg-id 3912.920878176@sss.pgh.pa.us
Whole thread Raw
In response to Odd program behaviour  (James Thompson <jamest@math.ksu.edu>)
List pgsql-interfaces
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

pgsql-interfaces by date:

Previous
From: "Ken J. Wright"
Date:
Subject: Re: [INTERFACES] copy command & null datetime
Next
From: Tom Lane
Date:
Subject: Re: [INTERFACES] copy command & null datetime