ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50293] [Ruby trunk Bug#14006] 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する
       [not found] <redmine.issue-14006.20171012021319@ruby-lang.org>
@ 2017-10-12  2:13 ` yuuji.yaginuma
  2017-10-12  5:01 ` [ruby-dev:50294] " shevegen
  2017-10-12  8:22 ` [ruby-dev:50295] " nobu
  2 siblings, 0 replies; 3+ messages in thread
From: yuuji.yaginuma @ 2017-10-12  2:13 UTC (permalink / raw)
  To: ruby-dev

Issue #14006 has been reported by y-yagi (Yuji Yaginuma).

----------------------------------------
Bug #14006: 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する 
https://bugs.ruby-lang.org/issues/14006

* Author: y-yagi (Yuji Yaginuma)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
下記スクリプトを2.5.0.preview1で実行するとSystemStackErrorが発生します。 なお、下記スクリプトはRuby 2.4.1p111ではエラーが発生せず正常に動作します。

~~~ ruby
# warning_test.rb
module Warning
  def warn(message)
    return if message.match?("warning: possibly useless use of a variable in void context")

    super
  end
end

@a 
~~~ 

バックトレースは下記の通りです。

~~~ 
ruby -v warning_test.rb
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
warning_test.rb:9: warning: possibly useless use of a variable in void context
warning_test.rb:2: warning: method redefined; discarding old warn
Traceback (most recent call last):
	7580: from warning_test.rb:9:in `<main>'
	7579: from warning_test.rb:5:in `warn'
	7578: from warning_test.rb:5:in `warn'
	7577: from warning_test.rb:5:in `warn'
	7576: from warning_test.rb:5:in `warn'
	7575: from warning_test.rb:5:in `warn'
	7574: from warning_test.rb:5:in `warn'
	7573: from warning_test.rb:5:in `warn'
	 ... 7568 levels...
	   4: from warning_test.rb:5:in `warn'
	   3: from warning_test.rb:5:in `warn'
	   2: from warning_test.rb:5:in `warn'
	   1: from warning_test.rb:5:in `warn'
warning_test.rb:5:in `warn': stack level too deep (SystemStackError)
~~~ 

なお、再定義の方法を、

~~~ ruby 
def Warning.warn(message) 
  ... 
end 
~~~ 

のように変更すると、エラーが発生せず正常に動作します。
 
これは意図的な挙動でしょうか?




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-dev:50294] [Ruby trunk Bug#14006] 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する
       [not found] <redmine.issue-14006.20171012021319@ruby-lang.org>
  2017-10-12  2:13 ` [ruby-dev:50293] [Ruby trunk Bug#14006] 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する yuuji.yaginuma
@ 2017-10-12  5:01 ` shevegen
  2017-10-12  8:22 ` [ruby-dev:50295] " nobu
  2 siblings, 0 replies; 3+ messages in thread
From: shevegen @ 2017-10-12  5:01 UTC (permalink / raw)
  To: ruby-dev

Issue #14006 has been updated by shevegen (Robert A. Heiler).


Sorry that I distract, please ignore me :) - that kanji ッ looks like a smiley face!

No wonder matz recognized the "lonely person staring at the ground" syntax. :D

----------------------------------------
Bug #14006: 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する 
https://bugs.ruby-lang.org/issues/14006#change-67180

* Author: y-yagi (Yuji Yaginuma)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
下記スクリプトを2.5.0.preview1で実行するとSystemStackErrorが発生します。 なお、下記スクリプトはRuby 2.4.1p111ではエラーが発生せず正常に動作します。

~~~ ruby
# warning_test.rb
module Warning
  def warn(message)
    return if message.match?("warning: possibly useless use of a variable in void context")

    super
  end
end

@a 
~~~ 

バックトレースは下記の通りです。

~~~ 
ruby -v warning_test.rb
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
warning_test.rb:9: warning: possibly useless use of a variable in void context
warning_test.rb:2: warning: method redefined; discarding old warn
Traceback (most recent call last):
	7580: from warning_test.rb:9:in `<main>'
	7579: from warning_test.rb:5:in `warn'
	7578: from warning_test.rb:5:in `warn'
	7577: from warning_test.rb:5:in `warn'
	7576: from warning_test.rb:5:in `warn'
	7575: from warning_test.rb:5:in `warn'
	7574: from warning_test.rb:5:in `warn'
	7573: from warning_test.rb:5:in `warn'
	 ... 7568 levels...
	   4: from warning_test.rb:5:in `warn'
	   3: from warning_test.rb:5:in `warn'
	   2: from warning_test.rb:5:in `warn'
	   1: from warning_test.rb:5:in `warn'
warning_test.rb:5:in `warn': stack level too deep (SystemStackError)
~~~ 

なお、再定義の方法を、

~~~ ruby 
def Warning.warn(message) 
  ... 
end 
~~~ 

のように変更すると、エラーが発生せず正常に動作します。
 
これは意図的な挙動でしょうか?




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-dev:50295] [Ruby trunk Bug#14006] 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する
       [not found] <redmine.issue-14006.20171012021319@ruby-lang.org>
  2017-10-12  2:13 ` [ruby-dev:50293] [Ruby trunk Bug#14006] 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する yuuji.yaginuma
  2017-10-12  5:01 ` [ruby-dev:50294] " shevegen
@ 2017-10-12  8:22 ` nobu
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2017-10-12  8:22 UTC (permalink / raw)
  To: ruby-dev

Issue #14006 has been updated by nobu (Nobuyoshi Nakada).


再定義は `Warning.warn` にするという想定だったんですが、 `Warning#warn` の再定義はどうしましょうかねぇ。

----------------------------------------
Bug #14006: 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する 
https://bugs.ruby-lang.org/issues/14006#change-67185

* Author: y-yagi (Yuji Yaginuma)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
下記スクリプトを2.5.0.preview1で実行するとSystemStackErrorが発生します。 なお、下記スクリプトはRuby 2.4.1p111ではエラーが発生せず正常に動作します。

~~~ ruby
# warning_test.rb
module Warning
  def warn(message)
    return if message.match?("warning: possibly useless use of a variable in void context")

    super
  end
end

@a 
~~~ 

バックトレースは下記の通りです。

~~~ 
ruby -v warning_test.rb
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
warning_test.rb:9: warning: possibly useless use of a variable in void context
warning_test.rb:2: warning: method redefined; discarding old warn
Traceback (most recent call last):
	7580: from warning_test.rb:9:in `<main>'
	7579: from warning_test.rb:5:in `warn'
	7578: from warning_test.rb:5:in `warn'
	7577: from warning_test.rb:5:in `warn'
	7576: from warning_test.rb:5:in `warn'
	7575: from warning_test.rb:5:in `warn'
	7574: from warning_test.rb:5:in `warn'
	7573: from warning_test.rb:5:in `warn'
	 ... 7568 levels...
	   4: from warning_test.rb:5:in `warn'
	   3: from warning_test.rb:5:in `warn'
	   2: from warning_test.rb:5:in `warn'
	   1: from warning_test.rb:5:in `warn'
warning_test.rb:5:in `warn': stack level too deep (SystemStackError)
~~~ 

なお、再定義の方法を、

~~~ ruby 
def Warning.warn(message) 
  ... 
end 
~~~ 

のように変更すると、エラーが発生せず正常に動作します。
 
これは意図的な挙動でしょうか?




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-12  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-14006.20171012021319@ruby-lang.org>
2017-10-12  2:13 ` [ruby-dev:50293] [Ruby trunk Bug#14006] 2.5.0preview1でWarning.warnを再定義するとSystemStackErrorが発生する yuuji.yaginuma
2017-10-12  5:01 ` [ruby-dev:50294] " shevegen
2017-10-12  8:22 ` [ruby-dev:50295] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).