pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ecpg runtime problem
3+ messages / 3 participants
[nested] [flat]

* ecpg runtime problem
@ 2000-02-28 12:42  Sirish Kumar <sirishk@noida.hclt.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Sirish Kumar @ 2000-02-28 12:42 UTC (permalink / raw)
  To: pgsql-interfaces

Hi,
   I am using ecpg version 2.4.4. I am checking my code with purify to
remove any run time problems.
Following simple ecpg code gives core dump (when compiled with purify*).

.....
#include <stdio.h>

void main()
{
exec sql connect cdata;
}
.....

The report says
IPR: Invalid pointer read:
  * This is occurring while in:
        makeEmptyPGconn [libecpg.so.2.6.2]
        PQsetdbLogin   [libecpg.so.2.6.2]
        main           [t4.o]
        _start         [crt1.o]
  * Reading 4 bytes from 0xef7a2218 between the heap and the stack.

****  Purify instrumented a.out (pid 18232)  ****
COR: Fatal core dump:
  * This is occurring while in:
        makeEmptyPGconn [libecpg.so.2.6.2]
        PQsetdbLogin   [libecpg.so.2.6.2]
        main           [t4.o]
        _start         [crt1.o]
  * Received signal 11 (SIGSEGV - Segmentation Fault)
  * Faulting address = 0xef7a2218
  * Signal mask: (SIGSEGV)
  * Pending signals:
........

Please help.
Thanks in advance.

Best Regards
Sirish Kumar

*purify is a product from Rational Software and checks run-time problems.

----------------------------------------
Best Regards
Sirish Kumar
HCL Technologies (India) Pvt. Ltd.
Ph : +91-11-8-510813/701/702 Ext.1107
Fax : +91-11-8-510713
----------------------------------------




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] ecpg runtime problem
@ 2000-02-28 13:37  Ivo Simicevic <ivo@ultra.hr>
  parent: Sirish Kumar <sirishk@noida.hclt.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Ivo Simicevic @ 2000-02-28 13:37 UTC (permalink / raw)
  To: Sirish Kumar <sirishk@noida.hclt.com>; +Cc: pgsql-interfaces

On Mon, Feb 28, 2000 at 06:12:54PM +0530, Sirish Kumar wrote:
> Hi,
>    I am using ecpg version 2.4.4. I am checking my code with purify to
> remove any run time problems.
> Following simple ecpg code gives core dump (when compiled with purify*).
> 
> .....
> #include <stdio.h>
> 
> void main()
> {
> exec sql connect cdata;
> }
> .....
> 

What is cdata : database name or variable containing database name?
If it is database name try enclosing it in double quotes like "cdata"
If cdata is variable it should be listed in DECLARE section
Also try using CONNECT TO database.

Good luck,

Ivo.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] ecpg runtime problem
@ 2000-03-01 07:31  Michael Meskes <meskes@postgreSQL.org>
  parent: Sirish Kumar <sirishk@noida.hclt.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Meskes @ 2000-03-01 07:31 UTC (permalink / raw)
  To: Sirish Kumar <sirishk@noida.hclt.com>; +Cc: pgsql-interfaces

On Mon, Feb 28, 2000 at 06:12:54PM +0530, Sirish Kumar wrote:
>    I am using ecpg version 2.4.4. I am checking my code with purify to
> remove any run time problems.

Could you please try a newer version. 2.4.4 is rather old.

> exec sql connect cdata;

The connect syntax was changed. I'm not sure what it was like with version
2.4.4. The correct syntax is EXEC SQL CONNECT TO <dbname>. 

Is 'cdata' your database name? Could you please tell me how the statement
was translated? Just look into the corresponding .c file for cdata. This
should be particularly interesting since the purify message talked about
some libpq functions called from libecpg.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-03-01 07:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-02-28 12:42 ecpg runtime problem Sirish Kumar <sirishk@noida.hclt.com>
2000-02-28 13:37 ` Ivo Simicevic <ivo@ultra.hr>
2000-03-01 07:31 ` Michael Meskes <meskes@postgreSQL.org>

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