ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: shishir127@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:69112] [Ruby trunk - Bug #11088] Infinite loop on calling missing/overwritten methods of restored marshaled objects
Date: Sat, 09 May 2015 07:02:45 +0000	[thread overview]
Message-ID: <redmine.journal-52358.20150509070244.6e84937949a7be48@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11088.20150423003550@ruby-lang.org

Issue #11088 has been updated by Shishir Joshi.

File 11088_test.rb added

Hi Jurgen,

I executed bug_hunt.rb and I was able to reproduce this issue. But when I tried a simple test (attached in 11088_test.rb) I did not see this bug. Can you tell us how you generated the ruby_object.dump? Do you have code for it?

Also, according to the documentation for Marshall (http://ruby-doc.org/core-2.2.2/Marshal.html#method-c-dump)

> Marshal can't dump following objects:
> 
> anonymous Class/Module.
> 
> objects which are related to system (ex: Dir, File::Stat, IO, File, Socket and so on)
> 
> an instance of MatchData, Data, Method, UnboundMethod, Proc, Thread, ThreadGroup, Continuation
> 
> objects which define singleton methods
> 

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

* Author: Jürgen Bickert
* Status: Open
* 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)


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

  parent reply	other threads:[~2015-05-09  6:48 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 ` shishir127 [this message]
2015-05-10  2:45 ` [ruby-core:69113] [Ruby trunk - Bug #11088] " halostatue
2015-05-10  2:48 ` [ruby-core:69114] [Ruby trunk - Bug #11088] [Rejected] " nobu
2015-05-10  2:57   ` [ruby-core:69115] " 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-52358.20150509070244.6e84937949a7be48@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).