Re: libpq problem

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq problem
Date: 2004-08-11 14:58:49
Message-ID: 411A3429.4000107@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andreas Pflug wrote:
> Some recent change in libpq seems to interfere with gtk.
>
> After I tested a new pgadmin3 version on linuy yesterday, I found that
> the GUI is hanging after PQconnectdb was called. After the call, the db
> connection is fully functional, but the GUI mouse will show "waiting"
> and the program doesn't react to mouse clicks any more; screen updates
> are not performed either.
>
> When I replace the 8.0 libpq.so* version with an older saved version
> (7.4.3 from debian installation) it works ok.

OK, I found out. Seems I didn't run make distclean for a longer time, so
I didn't realize earlier.

The reason is the sigpipe handling code. If the app (in this case: some
gtk internals) already installed a SIGPIPE handler, the thread_in_send
key is not created. pthread_setspecific calls will thus use an invalid
key, which screws up gtk.

The attached patch will implement two features:
1) unconditionally create thread_in_send
2) Always register our own SIGPIPE handler, chain to a previously
registered handler when the signal is thrown while not sending.

Regards,
Andreas

Attachment Content-Type Size
libpq.diff text/x-patch 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-11 15:01:39 Re: fsync, fdatasync, open_sync, and open_datasync, -- Linux insanity
Previous Message Robert Treat 2004-08-11 14:52:03 Re: Release notes for upgrading

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-08-11 15:54:36 Re: 8.0.0beta1: -lpthread missing
Previous Message Fabien COELHO 2004-08-11 14:25:18 more massaging on pgxs postresql extension infrastructure