Re: statistics process shutting down

Lists: pgsql-hackers-win32
From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Win 32 hackers PGSQL" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: statistics process shutting down
Date: 2004-11-30 21:01:48
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A7547@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32


> > Maybe Magnus might comment here. This doesn't explain why the read
call
> > is failing but I'm pretty sure the error code is not being properly
> > returned.
>
> I recall a lot of angst about whether the encoding of
WSAGetLastError()
> is compatible with errno values, but I forget what the conclusion was.
> Can we just assign to errno like that, or do we need a mapping
function?

Ah. My bad.
/backend/prot/win32/socket.c

static void
TranslateSocketError(void) etc. This puts the value in errno like it is
suppoed to be. MS recv() does not (I checked) so this is definately a
bug in pipe.c, since it is reasonable for the caller to expect errno to
be set to something.

Also, recv() and read() return completely different error codes :-). So
any caller has to be careful not to make assumptions about errno.

Merlin


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: "Win 32 hackers PGSQL" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: statistics process shutting down
Date: 2004-11-30 21:34:34
Message-ID: 24867.1101850474@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32

"Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:
> Ah. My bad.
> /backend/port/win32/socket.c

> static void
> TranslateSocketError(void) etc. This puts the value in errno like it is
> suppoed to be.

Hmm. I am strongly tempted to remove src/port/pipe.c and put it into
src/backend/port/win32/socket.c, so it can share this function.

> MS recv() does not (I checked) so this is definately a
> bug in pipe.c, since it is reasonable for the caller to expect errno to
> be set to something.

Can you provide a patch? I'm hesitant to hack code I don't have the
means to test.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Win 32 hackers PGSQL <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: statistics process shutting down
Date: 2004-12-02 23:18:30
Message-ID: 200412022318.iB2NIUa28450@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32


Is this an open item?

---------------------------------------------------------------------------

Merlin Moncure wrote:
>
> > > Maybe Magnus might comment here. This doesn't explain why the read
> call
> > > is failing but I'm pretty sure the error code is not being properly
> > > returned.
> >
> > I recall a lot of angst about whether the encoding of
> WSAGetLastError()
> > is compatible with errno values, but I forget what the conclusion was.
> > Can we just assign to errno like that, or do we need a mapping
> function?
>
> Ah. My bad.
> /backend/prot/win32/socket.c
>
> static void
> TranslateSocketError(void) etc. This puts the value in errno like it is
> suppoed to be. MS recv() does not (I checked) so this is definately a
> bug in pipe.c, since it is reasonable for the caller to expect errno to
> be set to something.
>
> Also, recv() and read() return completely different error codes :-). So
> any caller has to be careful not to make assumptions about errno.
>
> Merlin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073