Home > Archive > PostgreSQL Bugs > November 2005 > BUG #2059: PGConnect fails when used in a thread









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author BUG #2059: PGConnect fails when used in a thread
Chris Storah

2005-11-21, 9:24 am


The following bug has been logged online:

Bug reference: 2059
Logged by: Chris Storah
Email address: chris.storah@orionsmg.com
PostgreSQL version: 8.0.3
Operating system: Linux - Fedora Core 4 x86_64 version
Description: PGConnect fails when used in a thread
Details:

fe-connect.c in the src/interfaces/libpq directory is segfaulting when a
PQconnectdb is called from a thread (works when called from the main
application).

fe-connect.c - parseServiceInfo is failing because no service option is
being used in the connection string so service is NULL. The line that fails
is the 'snprintf(serviceFil
e, MAXPGPATH, "%s/pg_service.conf", ...) line. If
this is moved into the 'if (service != NULL)' section of code, everything
works fine (as it is never called when no service is specified).

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Tom Lane

2005-11-21, 9:24 am

"Chris Storah" <chris.storah@orionsmg.com> writes:
> fe-connect.c - parseServiceInfo is failing because no service option is
> being used in the connection string so service is NULL. The line that fails
> is the 'snprintf(serviceFil
e, MAXPGPATH, "%s/pg_service.conf", ...) line.


Huh? That statement doesn't use 'service', so your analysis makes no
sense. I agree it's a bit inefficient as coded, but I can't see that it
would crash. You have other problems to look for.

regards, tom lane

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

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com