Re: psql bug - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: psql bug
Date
Msg-id 4FB6C427.9000407@sigaev.ru
Whole thread Raw
In response to Re: psql bug  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: psql bug
List pgsql-hackers
> Seems system() call cleanups sigaction state on FreeBSD.

The root of problem is a threading library. In FreeBSD there are two versions of 
sigaction() (system() and others) depending on thread enabled. libpq library is 
compiled  by default with -pthread switch but psql is linked without that.
This mixed linkage is a reason why system() call for external program loses 
signal handler.

Next, configure script correctly sets PTHREAD_* variables but PTHREAD_LIBS is 
not used for psql linking.

What is the best way to fix that? I suggest to add PTHREAD_LIBS to linking psql 
at least. Although, suppose, it could be a reason for other cryptic bugs.

I didn't test this solution on other OSes, but, suppose, it will work.
-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: read() returns ERANGE in Mac OS X
Next
From: Stephen Frost
Date:
Subject: Re: Pre-alloc ListCell's optimization