Project

General

Profile

Actions

Bug #10563

closed

system() call hangs if command is too long

Added by Maturin (Lars Benner) about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Assignee:
Target version:
ruby -v:
ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]
[ruby-core:66648]

Description

In some situations another process, which was started using Kernel::system(), hangs right from the beginning, i.e. the process was started but nothing is actually executed.

On my system this happened, when the single command string passed to system call exceeded 1022 characters.

A very interesting fact is, that this only happens, if the command at the beginning is given with '/' in the path. After I replaced the '/' with '', everything is working fine.

Please find attached two scripts for reproducing this issue. Just call 'ruby caller.rb' and observe that everything hangs after the command line got to long. After changing the Ruby interpreter in the file. everything works as expected.


Files

caller.rb (797 Bytes) caller.rb Runner script for calling callee.rb Maturin (Lars Benner), 12/02/2014 08:36 PM
callee.rb (283 Bytes) callee.rb Maturin (Lars Benner), 12/02/2014 08:36 PM

Updated by Maturin (Lars Benner) about 10 years ago

Actually I found this problem, while using rake and I raised another bug for rake first. Perhaps it contains some useful information.

https://github.com/ruby/rake/issues/5

Updated by usa (Usaku NAKAMURA) about 10 years ago

  • Category changed from platform/mingw to platform/windows
  • Status changed from Open to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to windows

Thank you for reporting!
We'll fix it.

memo: This is a bug of w32_spawn().

Updated by usa (Usaku NAKAMURA) about 10 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: REQUIRED

Updated by usa (Usaku NAKAMURA) about 10 years ago

  • Status changed from Assigned to Closed

fixed at r48690.

Actions #5

Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED to 2.0.0: DONTNEED, 2.1: DONE

Backported into ruby_2_1 branch at r49997.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0