Unix Technical Forum

BUG #3867: PQconnectdb(NULL) cores instead of errors.

This is a discussion on BUG #3867: PQconnectdb(NULL) cores instead of errors. within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 3867 Logged by: Ken Lorber Email address: keni@stacksafe.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 12:14 PM
Ken Lorber
 
Posts: n/a
Default BUG #3867: PQconnectdb(NULL) cores instead of errors.


The following bug has been logged online:

Bug reference: 3867
Logged by: Ken Lorber
Email address: keni@stacksafe.com
PostgreSQL version: 8.3beta4
Operating system: Mac OSX
Description: PQconnectdb(NULL) cores instead of errors.
Details:

PQconnectdb(NULL) cores in strdup() in interfaces/libpq/fe-connect.c:3091
(conninfo_parse). Throwing an error would be more useful.

To reproduce:
1) configure, make, make install
2) set conninfo = NULL at line 38 of src/test/examples/testlibpq.c
3) make testlibpq
4) ./testlibpq
result should be a core or bus error or similar fatal error

gdb shows:
0x90013413 in strdup ()
(gdb) where
#0 0x90013413 in strdup ()
#1 0x0001cc37 in conninfo_parse ()
#2 0x0001d679 in connectOptions1 ()
#3 0x0001d9a1 in PQconnectStart ()
#4 0x0001d9e4 in PQconnectdb ()
#5 0x00001c2e in main ()

Thanks!

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 12:14 PM
Tom Lane
 
Posts: n/a
Default Re: BUG #3867: PQconnectdb(NULL) cores instead of errors.

"Ken Lorber" <keni@stacksafe.com> writes:
> PQconnectdb(NULL) cores in strdup() in interfaces/libpq/fe-connect.c:3091
> (conninfo_parse). Throwing an error would be more useful.


99% of library routines will core if you pass them a null for an
argument that that's not specifically documented to be allowed for.
If you're expecting otherwise, you should adjust your expectations.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:55 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com