FAQ
During a recent trip with a slow mobile connection, this code from a hobby
project (a go-based linux/windows/osx ruby switcher/runner)


https://bitbucket.org/jonforums/uru/src/403adb22fb424900afa85b2943926e4a3ff82fd7/command/base.go?at=master#cl-64

fails (tested only windows so far) when trying to run an external command
that does network io. The same code works fine on fast connections and I'm
trying to track down the source of this time dependent behavior. Sadly, I
only get to hack on go during brief bouts of lucid free time, but haven't
yet spelunked enough go source to solve the riddle.

Does go's runtime have watchdog-like oversight of things started via the
`exec` package?

Suggested go source locations to continue spelunking? (currently I'm
digging around the obvious "os" and "os/exec" pkg's)

Jon

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dave Cheney at Jun 3, 2013 at 9:47 pm
    Try CombinedOutput, you're throwing away stderr which probably has some thing important to tell you.


    On 04/06/2013, at 7:40, jon.forums@gmail.com wrote:

    During a recent trip with a slow mobile connection, this code from a hobby project (a go-based linux/windows/osx ruby switcher/runner)

    https://bitbucket.org/jonforums/uru/src/403adb22fb424900afa85b2943926e4a3ff82fd7/command/base.go?at=master#cl-64

    fails (tested only windows so far) when trying to run an external command that does network io. The same code works fine on fast connections and I'm trying to track down the source of this time dependent behavior. Sadly, I only get to hack on go during brief bouts of lucid free time, but haven't yet spelunked enough go source to solve the riddle.

    Does go's runtime have watchdog-like oversight of things started via the `exec` package?

    Suggested go source locations to continue spelunking? (currently I'm digging around the obvious "os" and "os/exec" pkg's)

    Jon
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jon Forums at Jun 4, 2013 at 4:33 pm
    Heh, terseness can be overrated ;)

    Time to dive deeper down the rabbit hole as the go exec-based automated
    version fails while a manual cmd line version works. Could have nothing to
    do with go and turn out that cmd.exe is the source of the shenanigans
    because the `gem` command is actually a `gem.bat` that wraps a call to the
    appropriate `[j]ruby.exe` with cmd line args. A lot of moving
    pieces...interested to see if the same failures in a zsh/bash environment.

    Any pointers to go goodies that may help debugging highly appreciated.


    === FAIL ===

    C:\>uru gem up multi_json treetop --verbose
    jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) Client VM
    1.7.0_21-b11 +indy [Windows 7-x86]

    ---> unable to run `gem up multi_json treetop --verbose`

    --- returned error message ---
    exit status 1

    --- combined child output ---
    Updating installed gems
    HEAD http://rubygems.org/specs.4.8.gz
    302 Moved Temporarily
    HEAD http://production.s3.rubygems.org/specs.4.8.gz
    304 Not Modified
    Updating multi_json
    Installing gem multi_json-1.7.6
    ERROR: While executing gem ... (Errno::EIO)
         Input/output error - C:\

    ruby 2.0.0p201 (2013-06-04 revision 41056) [i386-mingw32]

    ---> unable to run `gem up multi_json treetop --verbose`

    --- returned error message ---
    exit status 1

    --- combined child output ---
    ERROR: While executing gem ... (Errno::ENOENT)
         No such file or directory -
    Updating installed gems
    HEAD http://rubygems.org/specs.4.8.gz
    302 Moved Temporarily
    HEAD http://production.s3.rubygems.org/specs.4.8.gz
    304 Not Modified
    Updating multi_json
    Installing gem multi_json-1.7.6

    ruby 1.9.3p430 (2013-05-15 revision 40754) [i386-mingw32]

    ---> unable to run `gem up multi_json treetop --verbose`

    --- returned error message ---
    exit status 1

    --- combined child output ---
    ERROR: While executing gem ... (Errno::ENOENT)
         No such file or directory -
    Updating installed gems
    HEAD http://rubygems.org/specs.4.8.gz
    302 Moved Temporarily
    HEAD http://production.s3.rubygems.org/specs.4.8.gz
    304 Not Modified
    Updating multi_json
    Installing gem multi_json-1.7.6


    === WORKING ===

    C:\>gem up multi_json treetop --verbose
    Updating installed gems
    HEAD http://rubygems.org/specs.4.8.gz
    302 Moved Temporarily
    HEAD http://production.s3.rubygems.org/specs.4.8.gz
    200 OK
    GET http://rubygems.org/specs.4.8.gz
    302 Moved Temporarily
    GET http://production.s3.rubygems.org/specs.4.8.gz
    200 OK
    Updating multi_json
    Installing gem multi_json-1.7.6
    Downloading gem multi_json-1.7.6.gem
    GET http://rubygems.org/gems/multi_json-1.7.6.gem
    302 Moved Temporarily
    GET http://production.cf.rubygems.org/gems/multi_json-1.7.6.gem
    Fetching: multi_json-1.7.6.gem (100%)
    200 OK
    ...
    Successfully installed multi_json-1.7.6
    Updating treetop
    HEAD http://rubygems.org/latest_specs.4.8.gz
    302 Moved Temporarily
    HEAD http://production.s3.rubygems.org/latest_specs.4.8.gz
    200 OK
    GET http://rubygems.org/latest_specs.4.8.gz
    302 Moved Temporarily
    GET http://production.s3.rubygems.org/latest_specs.4.8.gz
    200 OK
    Installing gem treetop-1.4.14
    Downloading gem treetop-1.4.14.gem
    GET http://rubygems.org/gems/treetop-1.4.14.gem
    302 Moved Temporarily
    GET http://production.cf.rubygems.org/gems/treetop-1.4.14.gem
    Fetching: treetop-1.4.14.gem (100%)
    200 OK
    ...
    Creating executable as 'tt.exe'
    Installed C:/ruby193/bin/tt.exe executable
    Successfully installed treetop-1.4.14
    Gems updated: multi_json treetop


    On Monday, June 3, 2013 5:46:53 PM UTC-4, Dave Cheney wrote:

    Try CombinedOutput, you're throwing away stderr which probably has some
    thing important to tell you.



    On 04/06/2013, at 7:40, jon.f...@gmail.com <javascript:> wrote:

    During a recent trip with a slow mobile connection, this code from a hobby
    project (a go-based linux/windows/osx ruby switcher/runner)


    https://bitbucket.org/jonforums/uru/src/403adb22fb424900afa85b2943926e4a3ff82fd7/command/base.go?at=master#cl-64

    fails (tested only windows so far) when trying to run an external command
    that does network io. The same code works fine on fast connections and I'm
    trying to track down the source of this time dependent behavior. Sadly, I
    only get to hack on go during brief bouts of lucid free time, but haven't
    yet spelunked enough go source to solve the riddle.

    Does go's runtime have watchdog-like oversight of things started via the
    `exec` package?

    Suggested go source locations to continue spelunking? (currently I'm
    digging around the obvious "os" and "os/exec" pkg's)

    Jon
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Tamás Gulácsi at Jun 4, 2013 at 8:04 pm
    Start cmd.exe with proper args ("gem" is the first)?

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jon Forums at Jun 4, 2013 at 8:36 pm

    On Tuesday, June 4, 2013 4:03:56 PM UTC-4, Tamás Gulácsi wrote:
    Start cmd.exe with proper args ("gem" is the first)?

    Interesting. I hadn't tried it yet because `exec.Command` and
    `exec.LookPath` already do awesome things on Windows:

        http://code.google.com/p/go/source/browse/src/pkg/os/exec/exec.go#109

    http://code.google.com/p/go/source/browse/src/pkg/os/exec/lp_windows.go#53

    Since I've made things more difficult by supporting both cmd.exe and
    powershell on windows, I'll see how special casing exec's CombinedOutput
    for cmd.exe with `runtime.GOOS` and


    https://bitbucket.org/jonforums/uru/src/0183858359ae21915f66bdc06547edc496df39b7/exec/script.go?at=master#cl-42

    works out.

    Thank you for the idea.

    Jon

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 3, '13 at 9:41p
activeJun 4, '13 at 8:36p
posts5
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase