Issue #13920 has been updated by rocifier (Ryan O'Connor).


MSP-Greg (Greg L) wrote:
> rocifier (Ryan O'Connor) wrote:
> > `fileno(stdin)` returns `-2`
> 
> Sounds similar to #13546

Thanks my issue is very similar. The issue you linked to presents some undocumented requirements. When I try calling `rb_w32_sysinit` it crashes on this line:

https://github.com/ruby/ruby/blob/c08f7b80889b531865e74bc5f573df8fa27f2088/win32/win32.c#L839

What is the exact version of ucrtbased.dll that the assembly code in this function is designed for?

----------------------------------------
Bug #13920: prepping io for stdin returns "access denied" on windows
https://bugs.ruby-lang.org/issues/13920#change-66789

* Author: rocifier (Ryan O'Connor)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.5.0
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
https://github.com/ruby/ruby/blob/c08f7b80889b531865e74bc5f573df8fa27f2088/io.c#L12730

`rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO, "<STDIN>");`

When this line (io.c) is called upon initialising ruby with `ruby_init()` or `ruby_setup()` and the library is built with `VS2015 x86 Native Tools Command Prompt`, `fileno(stdin)` returns `-2` and `errno` is set to `13`. This raises a ruby exception and fails setup. The library has been tested with /MD and /MDd and with 2.4.2 and 2.5.0



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>