Project

General

Profile

Actions

Backport #3602

closed

stdout not set in rubyw.exe, causes silent failures

Added by Fitzsimmons (Justin Fitzsimmons) over 14 years ago. Updated over 13 years ago.


Description

=begin
Attempting to write anything to stdout will cause the program to silently crash when executed with rubyw.exe on windows.

The problem is trivial to duplicate:

Source:

f = File.new("test.txt", "w")
f.write("failure")
f.close
puts "Hello, World"
f = File.new("test.txt", "w")
f.write("success")
f.close


Execution output:

C:>ruby test.rb
Hello, World

C:>type test.txt
success

C:>rubyw test.rb

C:>type test.txt
failure

-----END OUTPUT----------------

This bug is not present in the 1.9.1 build of ruby for windows. A workaround is available, by providing a valid file descriptor for stdout, e.g. $stdout = File.new("stdout.txt", "w").
=end


Related issues 1 (0 open1 closed)

Related to Backport187 - Backport #4293: Errno::ENOMEM writing to STDOUT. Regression in 1.8.7-p330Closedshyouhei (Shyouhei Urabe)01/19/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0