ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:69114] [Ruby trunk - Bug #11088] [Rejected] Infinite loop on calling missing/overwritten methods of restored marshaled objects
Date: Sun, 10 May 2015 02:48:34 +0000	[thread overview]
Message-ID: <redmine.journal-52360.20150510024833.3d8fd642ff595757@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11088.20150423003550@ruby-lang.org

Issue #11088 has been updated by Nobuyoshi Nakada.

Status changed from Open to Rejected

Your objects are consist of very large networks with complex recursive references.
Even with omission of the recursions, it makes tons of hundreds MB strings.
You should define `inspect` methods for your purpose. 

----------------------------------------
Bug #11088: Infinite loop on calling missing/overwritten methods of restored marshaled objects
https://bugs.ruby-lang.org/issues/11088#change-52360

* Author: Jürgen Bickert
* Status: Rejected
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I have Marshal.dump some objects and then I Marshal.load them and later I call non-existent methods on those objects and instead of raising an exception (NoMethodError) it runs off in an infinite loop.

I have tested with simple cases where the dumped structure is not recursive and it works fine. So I attached a non-working dump which will when called with inspect or a non-existing method run off in an infinite loop.

When you run "ruby bug_hunt.rb" it will get stuck and you have to abort(CTRL-C) and only then will it print an error message and finish.

---Files--------------------------------
bug_hunt.rb (336 Bytes)
ruby_object.dump (561 KB)
11088_test.rb (305 Bytes)
simple-inspect.txt (1.19 MB)
simple-inspect-stats.txt (90.7 KB)
bug_hunt_benchmark.rb (1.42 KB)
bug_hunt_simple.rb (1.09 KB)


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

  parent reply	other threads:[~2015-05-10  2:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11088.20150423003550@ruby-lang.org>
2015-04-23  0:35 ` [ruby-core:68965] [Ruby trunk - Bug #11088] [Open] Infinite loop on calling missing/overwritten methods of restored marshaled objects kaiserprogrammer
2015-05-09  7:02 ` [ruby-core:69112] [Ruby trunk - Bug #11088] " shishir127
2015-05-10  2:45 ` [ruby-core:69113] " halostatue
2015-05-10  2:48 ` nobu [this message]
2015-05-10  2:57   ` [ruby-core:69115] Re: [Ruby trunk - Bug #11088] [Rejected] " Austin Ziegler
2015-07-15  9:52 ` [ruby-core:69976] [Ruby trunk - Bug #11088] On Exception too expensive inspect is called on recursive object graph with 3000 elements in it, swallows memory and ultimately doesn't deliver exception kaiserprogrammer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-52360.20150510024833.3d8fd642ff595757@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).