ahoward / systemu

univeral capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
Other
126 stars 33 forks source link

Argument list too long #24

Closed chetan closed 12 years ago

chetan commented 12 years ago

I got the following error quite at random -- it's in a script which runs the same command every minute in a loop and on just one occasion, it crashed with the following:

/.../lib/systemu.rb:73:in `popen': Argument list too long - "/home/chetan/.rvm/rubies/ruby-1.9.3-p286/bin/ruby" "/tmp/systemu_dantooine_8942_8944_0.755956356860259_1/program" (Errno::E2BIG)
        from /.../lib/systemu.rb:73:in `block (2 levels) in systemu'
        from /.../lib/systemu.rb:165:in `quietly'

Have you seen this before? Any idea what's going on here? The underlying command is also very simple and actually has no args in this case -- systemu("uptime") -- so I know the error isn't bubbling up from there. The only related bit of info I could find is this SO question:

http://stackoverflow.com/questions/11475221/why-do-i-get-bin-sh-argument-list-too-long-when-passing-quoted-arguments

which seems to indicate using quotes around arguments sometimes causes issues, but even then, it's not clear that that is the issue here.

chetan commented 12 years ago

Alright, it's happened a couple more times now in a short period. fwiw, the box is running Ubuntu 12.04.

chetan commented 12 years ago

Traced it down and it turned out to be an exploding ENV var (RUBYLIB) that was causing the issue. Oops!