Project

General

Profile

Actions

Bug #6291

closed

Backtrace printout halts for an extremely long time when large amounts of data are allocated

Added by cuthbert (Christoffer Lervag) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.3
Backport:
[ruby-core:44346]

Description

=begin
When large amounts of data are allocated, it can take an eternity for the backtrace printout to complete. Here's a simple example:

class SomeClass
  def initialize
    @a = Array.new(100000, "just some random string")
  end
end
h = Hash.new
200.times {|i| h[i] = SomeClass.new}
h.asdf

This will halt with the following printout:
test.rb:9

And then, after a very long time (depending on how much data is in memory), it will eventually finish:
test.rb:9: undefined method `asdf' for #Hash:0x1001bc348 (NoMethodError)

For me, this has caused a lot of frustration when running a test suite on an application which loads a lot of data in memory, as in many cases I will never get to see the actual backtrace. This makes debugging much more difficult. Perhaps there is some fundamental property of the Ruby language itself that makes this an 'expected behaviour', but if not, I would really appreciate to see this adressed.
=end


Related issues 2 (1 open1 closed)

Related to Ruby master - Feature #18285: NoMethodError#message uses a lot of CPU/is really expensive to callClosedActions
Has duplicate Ruby master - Feature #6783: Infinite loop in inspect, not overriding inspect, to_s, and no known circular references. Stepping into inspect in debugger locks it up with 100% CPU.OpenActions

Updated by mame (Yusuke Endoh) over 12 years ago

Hello,

I have no idea except adding a length limitation or timeout to #inspect.
Any other ideas?

--
Yusuke Endoh

Updated by mame (Yusuke Endoh) over 12 years ago

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

Matz,

Do you think that #inspect has a length limitation or timeout?

--
Yusuke Endoh

Updated by matz (Yukihiro Matsumoto) over 12 years ago

  • Status changed from Assigned to Closed

This one is not easy to fix.
We try to address it by improving #inspect, but we cannot make promise.

Matz.

Actions #4

Updated by shyouhei (Shyouhei Urabe) about 8 years ago

  • Has duplicate Feature #6783: Infinite loop in inspect, not overriding inspect, to_s, and no known circular references. Stepping into inspect in debugger locks it up with 100% CPU. added
Actions #5

Updated by Eregon (Benoit Daloze) almost 3 years ago

  • Related to Feature #18285: NoMethodError#message uses a lot of CPU/is really expensive to call added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0