Thanks for the tip, I wasn't aware that happened! I'll use os.Pipe.
-- Marcin
On Mon, Jul 6, 2020 at 4:45 PM Ian Lance Taylor wrote:
> On Mon, Jul 6, 2020 at 4:42 PM Marcin Romaszewicz
> wrote:
> >
> > Yes, I am using io.Pipe, and passing in the PipeWriter side of it as
> Stdout and Stderr on
On Mon, Jul 6, 2020 at 4:42 PM Marcin Romaszewicz wrote:
>
> Yes, I am using io.Pipe, and passing in the PipeWriter side of it as Stdout
> and Stderr on Cmd.
I'm glad you figured out the problem, but I want to note that you
almost certainly want to be using os.PIpe rather than io.Pipe.
io.Pipe i
Yes, I am using io.Pipe, and passing in the PipeWriter side of it as Stdout
and Stderr on Cmd.
I figured out the problem, though. The executable which I am launching is
doing a write on a non-existent file descriptor upon shutdown, which
generates a SIGPIPE, per strace:
write(75,
"\25\3\3\0\32,v\
On Sun, Jul 5, 2020 at 4:14 PM Marcin Romaszewicz wrote:
>
> On Sun, Jul 5, 2020 at 1:05 PM Ian Lance Taylor wrote:
>>
>> On Sun, Jul 5, 2020 at 10:54 AM Marcin Romaszewicz wrote:
>> >
>> > I'm hitting a problem using os.exec Cmd.Start to run a process.
>> >
>> > I'm setting Cmd.Stdio and Cmd.St
On Sun, Jul 5, 2020 at 1:05 PM Ian Lance Taylor wrote:
> On Sun, Jul 5, 2020 at 10:54 AM Marcin Romaszewicz
> wrote:
> >
> > I'm hitting a problem using os.exec Cmd.Start to run a process.
> >
> > I'm setting Cmd.Stdio and Cmd.Stderr to the same instance of an io.Pipe,
> and spawn a Goroutine to
On Sun, Jul 5, 2020 at 10:54 AM Marcin Romaszewicz wrote:
>
> I'm hitting a problem using os.exec Cmd.Start to run a process.
>
> I'm setting Cmd.Stdio and Cmd.Stderr to the same instance of an io.Pipe, and
> spawn a Goroutine to consume the pipe reader until I reach EOF. I then call
> cmd.Start
Hi All,
I'm hitting a problem using os.exec Cmd.Start to run a process.
I'm setting Cmd.Stdio and Cmd.Stderr to the same instance of an io.Pipe,
and spawn a Goroutine to consume the pipe reader until I reach EOF. I then
call cmd.Start(), do some additional work, and call cmd.Wait(). The runtime
o