Обсуждение: PgDatabase, on heap construction results in SIGSEGV.

Поиск
Список
Период
Сортировка

PgDatabase, on heap construction results in SIGSEGV.

От
JSavage@data-mate.com (Savage)
Дата:
I am having a problem constructing a PgDatabase object. If I create
the object on the stack (as a var local to a function) then it
constructs and connects to the DB ok. But, if I create and construct
the object on the heap, a SIGSEGV occurs within libpq++.so.4.

Has anyone got any ideas what could be causing this? I have only been
programming under linux for a month or so at this stage, but I've a
lot of Win32 experience. Any pointers to things that a Win32 to Linux
newbie would not be aware of would be much appreciated.

Thanks,
John


Re: PgDatabase, on heap construction results in SIGSEGV.

От
"Jeroen T. Vermeulen"
Дата:
On Tue, Oct 15, 2002 at 07:26:25PM -0700, Savage wrote:
> I am having a problem constructing a PgDatabase object. If I create
> the object on the stack (as a var local to a function) then it
> constructs and connects to the DB ok. But, if I create and construct
> the object on the heap, a SIGSEGV occurs within libpq++.so.4.

Are you sure that's exactly where and why it occurs?  I can't think of
any reason why libpq++ should care whether you use "PgDatabase Foo;" or
"PgDatabase *Bar = new PgDatabase;" - so could you post some minimal 
code sample that produces the problem?

(Gratuitous plug: you may also want to look at libpqxx, the more modern
replacement for libp++: http://gborg.postgresql.org/project/libpqxx/ )


Jeroen