Re: [HACKERS] libpq problem

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] libpq problem
Date: 2004-08-17 23:43:21
Message-ID: 41229819.3030202@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> OK, I like your idea of chaining on to any existing SIGPIPE handler
> rather than just do it if none is installed. I also see your fix for
> the uninitialized thread-specific variable.
>
> I added some comments to the patch, renamed the pipeheader variable so
> it was pg_* to avoid namespace conflicts, and updated the documentation.
>
> Patch attached and applied.

At a glance, this looks like it will break applications that pass
SA_SIGINFO in sa_flags for their SIGPIPE handlers. This changes the
expected signal handler signature to a three-arg form; the extra two
args provide context about where the signal occurred. The libpq handler,
however, doesn't pass those args when chaining to the next handler.

The Sun JVM under linux is one example of an app that does1 this. I've
seen a similar problem to this before with a version of libnss_ldap that
did not correctly restore the entire sigaction state when restoring the
SIGPIPE handler before returning from libnss_ldap .. the next SIGPIPE
that arrives would crash the JVM. See
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4630104 for more
details (requires registration)

-O

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-08-18 00:33:57 Re: 8.0.0beta1: Ownership of implicit sequences after dump/restore
Previous Message Tom Lane 2004-08-17 23:28:23 Re: stop the presses (Re: 7.4.4 packaged ...)

Browse pgsql-patches by date

  From Date Subject
Next Message Greg Sabino Mullane 2004-08-18 00:06:17 Re: Allow psql to work against non-tablespace servers (e.g.
Previous Message Bruce Momjian 2004-08-17 20:26:02 Re: Allow psql to work against non-tablespace servers (e.g.