Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0

2021-09-05 Thread Mario Emmenlauer
On 03.09.21 01:00, Tom Lane wrote: > Mario Emmenlauer writes: >> The idea to switch to dup(2) sounds very good to me. > > I poked at this some more, and verified that adding "fclose(stdin);" > at the head of PostmasterMain is enough to trigger the reported > failure. However, after changing fd.c

Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0

2021-09-02 Thread Tom Lane
Mario Emmenlauer writes: > The idea to switch to dup(2) sounds very good to me. I poked at this some more, and verified that adding "fclose(stdin);" at the head of PostmasterMain is enough to trigger the reported failure. However, after changing fd.c to dup stderr not stdin, we can pass check-wo

Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0

2021-09-01 Thread Tom Lane
Mario Emmenlauer writes: > The idea to switch to dup(2) sounds very good to me. Also, while at it, > maybe the error message could be improved? The kids nowadays don't learn > so much about system I/O any more, and if someone does not know `dup()`, > then the error message is not very telling. It

Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0

2021-09-01 Thread Mario Emmenlauer
On 01.09.21 15:54, Tom Lane wrote: > Mario Emmenlauer writes: >> On 05.10.20 14:35, Tom Lane wrote: >>> Mario Emmenlauer writes: I get reproducibly the error: 2020-10-05 11:48:19.720 CEST [84731] WARNING: dup(0) failed after 0 successes: Bad file descriptor > >>> Hmph. That cod

Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0

2021-09-01 Thread Tom Lane
[ redirecting to -hackers ] Mario Emmenlauer writes: > On 05.10.20 14:35, Tom Lane wrote: >> Mario Emmenlauer writes: >>> I get reproducibly the error: >>> 2020-10-05 11:48:19.720 CEST [84731] WARNING: dup(0) failed after 0 >>> successes: Bad file descriptor >> Hmph. That code loop assumes t