[ruby-core:96029] [Ruby master Bug#16382] SystemStackError thrown when running `LC_ALL="C" RUBYLIB=".:" ruby -E cp932:utf-8 aaa.rb` from where the current dir contains Japanese characters

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.issue-16382.20191130021300.d83315422a000c1d@ruby-lang.org>
Issue #16382 has been reported by yuki24 (Yuki Nishijima).

----------------------------------------
Bug #16382: SystemStackError thrown when running `LC_ALL="C" RUBYLIB=".:" ruby -E cp932:utf-8 aaa.rb` from where the current dir contains Japanese characters
https://bugs.ruby-lang.org/issues/16382

* Author: yuki24 (Yuki Nishijima)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-11-29T23:00:40Z master 0b1b2f2442) [x86_64-darwin18]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
## Steps to reproduce

```
~/GitHub/ruby/did_you_mean/テスト$ LC_ALL="C" RUBYLIB=".:" ruby -E cp932:utf-8 aaa.rb
Traceback (most recent call last):
	2: from <internal:gem_prelude>:5:in `<internal:gem_prelude>'
	1: from /Users/yuki/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
/Users/yuki/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require': stack level too deep (SystemStackError)
```

The key points are:

 * The current directory contains one or more Japanese character (perhaps non-alphabet char is what's causing the issue, but I'm unfamiliar with other types of chars)
 * Only happens when `LC_ALL="C" RUBYLIB=".:"` environment variables and the option `-E cp932:utf-8` are given
 * The existing of the file that is supposed to be run by the executable does not seem to matter

## Actual

A `SystemStackError` is thrown.

## Expected

The file specified should be run or Ruby should throw a `No such file or directory -- aaa.rb (LoadError)` error.



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

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.