pg_test_fsync crashes on systems with POSIX signal handling - Mailing list pgsql-hackers

From Tom Lane
Subject pg_test_fsync crashes on systems with POSIX signal handling
Date
Msg-id 25651.1363374354@sss.pgh.pa.us
Whole thread Raw
Responses Re: pg_test_fsync crashes on systems with POSIX signal handling  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On my old HPUX box:

$ ./pg_test_fsync
2 seconds per test
Direct I/O is not supported on this platform.

Compare file sync methods using one 8kB write:
(in wal_sync_method preference order, except fdatasync
is Linux's default)       open_datasync                     165.122 ops/sec (  6056 microsecs/op)       fdatasync
               Alarm call
 
$ echo $?
142        -- that's SIGALRM

The reason it's failing is that according to the traditional (not BSD)
definition of signal(2), the signal handler is reset to SIG_DFL when the
signal is delivered.  So the second occurrence of SIGALRM doesn't call
the signal handler but just crashes the process.

The quick-and-dirty fix for this is to just copy pqsignal() into
pg_test_fsync, and use that instead of calling signal() directly.
I wonder though if we shouldn't move that function into libpgport.
Thoughts?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strange Windows problem, lock_timeout test request
Next
From: Kevin Grittner
Date:
Subject: Re: Materialized view assertion failure in HEAD