FATAL: semctl(1672698088, 12, SETVAL, 0) failed

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: FATAL: semctl(1672698088, 12, SETVAL, 0) failed
Date: 2006-02-22 03:17:51
Message-ID: dtglar$15tv$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I encountered an error when I fast shutdown 8.1.1 on Win2k:

FATAL: semctl(1672698088, 12, SETVAL, 0) failed: A blocking operation
was interrupted by a call to WSACancelBlockingCall.

A similar error on 8.1/win2003 was reported on pgsql-general (sorry, I can't
dig out the
original post from our web archives):

From: Niederland
Date: Tues, Dec 13 2005 9:49 am

2005-12-12 20:30:00 FATAL: semctl(50884184, 15, SETVAL, 0) failed: A
non-blocking socket operation could not be completed immediately.

---

There are two problems here:

(1) Why a socket error?
In port/win32.h, we have

#undef EAGAIN
#undef EINTR
#define EINTR WSAEINTR
#define EAGAIN WSAEWOULDBLOCK

What's the rationale of doing so?

(2) What's happened here?
It may come from PGSemaphoreReset(), and win32 semop() looks like this:

ret = WaitForMultipleObjectsEx(2, wh, FALSE, (sops[0].sem_flg &
IPC_NOWAIT) ? 0 : INFINITE, TRUE);
...
else if (ret == WAIT_OBJECT_0 + 1 || ret == WAIT_IO_COMPLETION)
{
pgwin32_dispatch_queued_signals();
errno = EINTR;
}
else if (ret == WAIT_TIMEOUT)
errno = EAGAIN;

So it seems the EINTR is caused by an incoming signal, the EAGAIN is caused
by a TIMEOUT ... any ideas?

Regards,
Qingqing

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Dunlop 2006-02-22 07:44:00 Problem with dump/restore and inheritance
Previous Message Tom Lane 2006-02-21 18:11:24 Re: BUG #2274: Error in 'CREATE DOMAIN' SQL command in dump file