https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-05-04T08:16:11ZRuby Issue Tracking SystemRuby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=391122013-05-04T08:16:11Zanuraguniyal (anurag uniyal)anuraguniyal@gmail.com
<ul></ul><p>also tried with ruby 2.0.0 at <a href="http://www.compileonline.com/execute_ruby_online.php" class="external">http://www.compileonline.com/execute_ruby_online.php</a></p> Ruby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=391182013-05-04T15:22:25Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>You can see the reason by reducing the size of the instance variable.</p> Ruby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=391192013-05-04T16:02:51Zanuraguniyal (anurag uniyal)anuraguniyal@gmail.com
<ul></ul><p>nobu (Nobuyoshi Nakada) wrote:</p>
<blockquote>
<p>You can see the reason by reducing the size of the instance variable.</p>
</blockquote>
<p>What do you mean? I have a big project where I load plugins and each plugin can have megabytes of data and if one plugin does not implement some method, ex.message just hangs, other than that this is huge development nightmare when a typo in code can make scripts hang</p>
<p>It is a bug in NameError#to_s (<a href="https://github.com/ruby/ruby/blob/ruby_2_0_0/error.c#L1088-L1095" class="external">https://github.com/ruby/ruby/blob/ruby_2_0_0/error.c#L1088-L1095</a>) because it calls obj.inspect and which can be huge and time consuming for objects which have huge instance variables, doesn't Ruby support large instance variables?</p> Ruby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=391222013-05-04T21:00:50Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Priority</strong> changed from <i>5</i> to <i>3</i></li></ul><p>You should define inspect method.</p> Ruby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=391702013-05-07T03:01:35Zanuraguniyal (anurag uniyal)anuraguniyal@gmail.com
<ul></ul><p>nobu (Nobuyoshi Nakada) wrote:</p>
<blockquote>
<p>You should define inspect method.</p>
</blockquote>
<p>But it is not practical to define inspect on all the classes I write or add inspect to all third party code or plugins I use, easier and better solution would be to now have obj.inspect called for ex.message</p> Ruby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=490362014-09-21T17:52:48ZGlass_saga (Masaki Matsushita)glass.saga@gmail.com
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>Backport</strong> changed from <i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN</i> to <i>1.9.3: DONTNEED, 2.0.0: DONTNEED</i></li></ul><p>It can't be reproduced with ruby 2.1.3.</p>
<pre><code>ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]
before NameError
after 0.147735733 undefined local variable or method `no_such_method' for #<ExceptionTest:0x007fac810bed90>
</code></pre> Ruby master - Feature #8366: Exception.message take time to execute depending on the instance variableshttps://bugs.ruby-lang.org/issues/8366?journal_id=490442014-09-22T06:41:57Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Feature</i></li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Open</i></li></ul>