vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, While i'm working on a ecpg patch I found a bug in ecpg code. The simple program above could reproduce it. But basically it crashes (segfault) because it's trying to use a inexistent connection when we're preparing a statement. Don't know if it deserves a ecpg_log() message. A possible fix is attached. #include <stdio.h> exec sql whenever sqlerror sqlprint; int main(void) { exec sql begin declare section; char cmd[128]; exec sql end declare section; exec sql connect to euler as main; sprintf(cmd, "select * from foo"); exec sql prepare f from :cmd; exec sql disconnect; return 0; } (gdb) bt #0 0xb7ebd9cd in find_prepared_statement (name=0x8048819 "f", con=0x0, prev_=0xbfccc6dc) at /a/pgsql/dev/pgsql/src/interfaces/ecpg/ecpglib/prepare.c:187 #1 0xb7ebd79f in ECPGprepare (lineno=15, connection_name=0x0, questionmarks=0, name=0x8048819 "f", variable=0xbfccc72c "select * from foo limit 1,2") at /a/pgsql/dev/pgsql/src/interfaces/ecpg/ecpglib/prepare.c:128 #2 0x0804865d in main () -- Euler Taveira de Oliveira http://www.timbira.com/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| On Sat, May 10, 2008 at 12:14:57AM -0300, Euler Taveira de Oliveira wrote: > While i'm working on a ecpg patch I found a bug in ecpg code. The simple > program above could reproduce it. But basically it crashes (segfault) > because it's trying to use a inexistent connection when we're preparing > a statement. Don't know if it deserves a ecpg_log() message. A possible > fix is attached. Let me dig into this some more before committing this fix. I wonder if the same problem holds for other use cases. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| ||||
| On Sat, May 10, 2008 at 12:14:57AM -0300, Euler Taveira de Oliveira wrote: > While i'm working on a ecpg patch I found a bug in ecpg code. The simple > program above could reproduce it. But basically it crashes (segfault) It appeared that the whole error checking code was missing. Fixed now. Thanks for reporting this. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |