Re: segfault which isn't supposed to happen (including example code) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: segfault which isn't supposed to happen (including example code)
Date
Msg-id 4725.1026228989@sss.pgh.pa.us
Whole thread Raw
In response to segfault which isn't supposed to happen (including example code)  (eric <plukje@gmx.net>)
List pgsql-bugs
eric <plukje@gmx.net> writes:
> this segfault is all about PQclear();

If you pass an uninitialized pointer to a library routine, it's likely
to segfault.  This is *your* bug, not the library's, because the library
routine has no way to know that you gave it a random pointer value
instead of something that actually points to valid data.

You might want to adjust your compiler switches so that the compiler
warns about uses of uninitialized variables.  In gcc, "-O -Wall" is
a pretty good combination.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Insert aborted, but Sequence increased
Next
From: Stephan Szabo
Date:
Subject: Re: Insert aborted, but Sequence increased