Issue #5720 has been updated by Charles Nutter.


A question about the test you added, nobu:

```
  def test_too_many_args_in_eval
    bug5720 = '[ruby-core:41520]'
    arg_string = (0...140000).to_a.join(", ")
    assert_raise(SystemStackError, bug5720) {eval "raise(#{arg_string})"}
  end
```

Why SystemStackError? Why isn't it ArgumentError, since `raise` does not take 140000 arguments?

In JRuby, we currently raise ArgumentError for this.


----------------------------------------
Bug #5720: Exceptions can be caused via eval that evade exception handling
https://bugs.ruby-lang.org/issues/5720#change-56917

* Author: Gabriel Gironda
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 1.9.2-p290, 1.9.3-p0, 1.9.3-HEAD
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
While poking at #5719, I discovered it's possible to cause an exception via Kernel#eval that leaks through any surrounding rescue block. Please see the gist for details. I tested against 1.9.2-p290, 1.9.3-p0, and HEAD of the 1.9.3 branch.

https://gist.github.com/ec12e41efda564ccac7a



-- 
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>