Project

General

Profile

Bug #5591

Windows bug when using "shortcut" syntax with output redirection

Added by jwille (Jens Wille) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
[ruby-core:40835]

Description

How to reproduce:

---- snip ----
# test.rb
puts test
---- snip ----

Start Command Prompt with Ruby 1.9.3:

$ ruby test.rb
test
$ ruby test.rb > out
$ type out
test
$ test
test
$ test > out
[BUG] rb_update_max_fd: invalid fd (1) given.
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP

-- C level backtrace information -------------------------------------------
C:\WINDOWS\system32\ntdll.dll(KiIntSystemCall+0x6) [0x7c91e526]
C:\WINDOWS\system32\kernel32.dll(WaitForSingleObject+0x12) [0x7c802542]
C:\Ruby193\bin\msvcrt-ruby191.dll(rb_vm_bugreport+0xf9) [0x62e5acc9]
C:\Ruby193\bin\msvcrt-ruby191.dll(rb_name_err_mesg_new+0x17a) [0x62d3a68e]
C:\Ruby193\bin\msvcrt-ruby191.dll(rb_bug+0x2f) [0x62d3b3ef]
C:\Ruby193\bin\msvcrt-ruby191.dll(rb_io_close+0x357) [0x62d63ab7]
C:\Ruby193\bin\msvcrt-ruby191.dll(rb_get_argv+0x1123) [0x62d70b9b]
C:\Ruby193\bin\msvcrt-ruby191.dll(rb_call_inits+0x83) [0x62d5e807]
C:\Ruby193\bin\msvcrt-ruby191.dll(ruby_init+0x89) [0x62d41a8d]
[0x00401355]
[0x004010b9]
[0x00401284]

-- Other runtime information -----------------------------------------------

0: can't convert false into String (TypeError)
$

Expected test > out' to behave likeruby test.rb > out'.

Bug occurs with both 1.9.3 (RubyInstaller) and 1.9.2 (Binary); 1.8.7 (RubyInstaller) behaves as expected. Tested on Windows XP Version 2002 Service Pack 3; originally reported on Windows 7.

History

#1 [ruby-core:40873] Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Category set to core
  • Target version set to 2.0.0

#2 [ruby-core:40880] Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Target version changed from 2.0.0 to 1.9.3

Couldn't reproduce with 2.0.0 r32684 on Windows 7.

#3 [ruby-core:40904] Updated by phasis68 (Heesob Park) about 6 years ago

I can reproduce this issue with trunk on Windows XP.

The changeset r33692 solves this bug too.

On Windows XP, fstat failed with errno EACCES when called with shortcut and redirected stdout.

#4 [ruby-core:41130] Updated by jwille (Jens Wille) about 6 years ago

Unfortunately, I find myself unable to compile Ruby on Windows. I'm not familiar with developing on that platform and all the instructions I could find were either outdated or rather complicated. So I simply trust that it's fixed by r33691. Will that change be backported to 1.9.3?

#5 [ruby-core:41131] Updated by usa (Usaku NAKAMURA) about 6 years ago

  • Status changed from Open to Closed

I've moved #5593 to backport request (because the ticket has revision information).

#6 [ruby-core:41132] Updated by jwille (Jens Wille) about 6 years ago

Ok, thank you very much!

#7 [ruby-core:41135] Updated by luislavena (Luis Lavena) about 6 years ago

Jens Wille wrote:

Unfortunately, I find myself unable to compile Ruby on Windows. I'm not familiar with developing on that platform and all the instructions I could find were either outdated or rather complicated. So I simply trust that it's fixed by r33691. Will that change be backported to 1.9.3?

Testing this wouldn't be that hard if you use RubyInstaller recipes and build infrastructure.

https://github.com/oneclick/rubyinstaller/

You only need a previous version of Ruby installed and Git to clone RubyInstaller recipes.

You can checkout/clone ruby source code and use LOCAL.

Some similar instructions are here:

https://github.com/thecodeshop/ruby/wiki/Building-MRI-on-Windows

#8 [ruby-core:41136] Updated by jwille (Jens Wille) about 6 years ago

Luis, that's awesome. I was literally saying to myself the RubyInstaller guys must be providing some easy way to do this, I just wasn't able to find anything from the homepage. So thanks! I might give it a try some time. Though I won't spend more time on Windows than is absolutely necessary, for sure ;)

Also available in: Atom PDF