Infinite loop generated by using any_instance and dup #120

Closed
tfwright opened this Issue Mar 27, 2012 · 14 comments

Comments

Projects
None yet
6 participants
@tfwright

I believe I've run into a bug while trying to get #119 to work. The following code causes the ruby process to hang, eventually throwing Ruby stack level too deep

it "should play nicely with dup" do
  Object.any_instance.stub(:some_method)
  o = Object.new
  o.some_method
  o.dup.some_method
end
@dchelimsky

This comment has been minimized.

Show comment
Hide comment
@dchelimsky

dchelimsky Mar 27, 2012

Member

@kaiwren do you have time to look at this?

Member

dchelimsky commented Mar 27, 2012

@kaiwren do you have time to look at this?

@ags

This comment has been minimized.

Show comment
Hide comment
@ags

ags Mar 28, 2012

+1, encountered this today.

ags commented Mar 28, 2012

+1, encountered this today.

@kaiwren

This comment has been minimized.

Show comment
Hide comment
@kaiwren

kaiwren Mar 28, 2012

Contributor

@dchelimsky Sure, I will, no problem.

Contributor

kaiwren commented Mar 28, 2012

@dchelimsky Sure, I will, no problem.

@kaiwren

This comment has been minimized.

Show comment
Hide comment
@kaiwren

kaiwren Mar 28, 2012

Contributor

Hey @preethiramdev, this was the issue I was telling you about.

Contributor

kaiwren commented Mar 28, 2012

Hey @preethiramdev, this was the issue I was telling you about.

@jmazzi

This comment has been minimized.

Show comment
Hide comment
@jmazzi

jmazzi Mar 28, 2012

Just for a little more insight, this seems to basically cause a fork bomb until all memory is exhausted. I recommend testing this with a wrapper script like this to limit the amount of memory it can consume:

# 500 MB
ulimit -Sv 500000
rspec spec/blah_spec.rb

jmazzi commented Mar 28, 2012

Just for a little more insight, this seems to basically cause a fork bomb until all memory is exhausted. I recommend testing this with a wrapper script like this to limit the amount of memory it can consume:

# 500 MB
ulimit -Sv 500000
rspec spec/blah_spec.rb
@preethiramdev

This comment has been minimized.

Show comment
Hide comment
@preethiramdev

preethiramdev Mar 30, 2012

Contributor

@tfwright Ive been able to replicate this. Will probably not get much done over the weekend tho so will start looking into this on Monday.

@jmazzi Will try that

Contributor

preethiramdev commented Mar 30, 2012

@tfwright Ive been able to replicate this. Will probably not get much done over the weekend tho so will start looking into this on Monday.

@jmazzi Will try that

@kaiwren

This comment has been minimized.

Show comment
Hide comment
@kaiwren

kaiwren Apr 23, 2012

Contributor

@dchelimsky I'm helping a few of my colleagues get used to contributing via #124 and #120 - it's taking a little longer than expected. If this is a blocker for an upcoming release, please let me know and I'll fix them myself.

Contributor

kaiwren commented Apr 23, 2012

@dchelimsky I'm helping a few of my colleagues get used to contributing via #124 and #120 - it's taking a little longer than expected. If this is a blocker for an upcoming release, please let me know and I'll fix them myself.

@dchelimsky

This comment has been minimized.

Show comment
Hide comment
@dchelimsky

dchelimsky Apr 23, 2012

Member

This is not a blocker. We can release this fix as a patch release of 2.9 or 2.10, whichever is current when this gets done.

Member

dchelimsky commented Apr 23, 2012

This is not a blocker. We can release this fix as a patch release of 2.9 or 2.10, whichever is current when this gets done.

@kaiwren

This comment has been minimized.

Show comment
Hide comment
@kaiwren

kaiwren Apr 23, 2012

Contributor

Thanks, that's good to know.

On 23 April 2012 18:20, David Chelimsky
reply@reply.github.com
wrote:

This is not a blocker. We can release this fix as a patch release of 2.9 or 2.10, whichever is current when this gets done.


Reply to this email directly or view it on GitHub:
#120 (comment)

Contributor

kaiwren commented Apr 23, 2012

Thanks, that's good to know.

On 23 April 2012 18:20, David Chelimsky
reply@reply.github.com
wrote:

This is not a blocker. We can release this fix as a patch release of 2.9 or 2.10, whichever is current when this gets done.


Reply to this email directly or view it on GitHub:
#120 (comment)

kaiwren added a commit to c42engineering/rspec-mocks that referenced this issue May 19, 2012

kaiwren added a commit to c42engineering/rspec-mocks that referenced this issue May 20, 2012

@kaiwren

This comment has been minimized.

Show comment
Hide comment
@kaiwren

kaiwren May 20, 2012

Contributor

See pull request #138

Contributor

kaiwren commented May 20, 2012

See pull request #138

justinko added a commit that referenced this issue May 23, 2012

@dchelimsky

This comment has been minimized.

Show comment
Hide comment
@dchelimsky

dchelimsky May 23, 2012

Member

Closed by #138.

Member

dchelimsky commented May 23, 2012

Closed by #138.

@dchelimsky dchelimsky closed this May 23, 2012

@jmazzi

This comment has been minimized.

Show comment
Hide comment
@jmazzi

jmazzi May 23, 2012

Thanks, @kaiwren!

jmazzi commented May 23, 2012

Thanks, @kaiwren!

@kaiwren

This comment has been minimized.

Show comment
Hide comment
@kaiwren

kaiwren May 23, 2012

Contributor

@jmazzi You're welcome. In fact, I'm sorry I took this long to get this sorted. I hope it wasn't too much of an inconvenience.

Contributor

kaiwren commented May 23, 2012

@jmazzi You're welcome. In fact, I'm sorry I took this long to get this sorted. I hope it wasn't too much of an inconvenience.

@jmazzi

This comment has been minimized.

Show comment
Hide comment
@jmazzi

jmazzi May 23, 2012

@kaiwren nope, we worked around it.

jmazzi commented May 23, 2012

@kaiwren nope, we worked around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment