-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop #158
Comments
Do you have a code snippet that replicates the issue? It's hard to investigate without code examples. Keep in mind that if you rescue |
I'll attempt to create a small test case, but may take me a little while to do that. |
Calling `NameError#message` causes the `did_you_mean` library to endup being in an infinite loop(Probabaly raises `SystemStackError` at some point though). Related to ruby/did_you_mean#158
We are bitten by a similar problem exists in the The problem is, The following snippet demonstrates the issue; class Foo
def bar
zoo_1
rescue => e
raise e.class, e.message
end
def zoo
true
end
def inspect
bar
end
end
Foo.new.bar I think adding a warning to the documentation of the |
Based on @meinac comments and some further testing I'm not sure that the issue is with did you mean and instead related to timing and errors with @yuki24 if I comment out this line in the did you mean gem, then I assume it wont ever be activated for a NoMethodError?
If so, then our problem is elsewhere and I can close this bug. |
Our issue ended up not being with did you mean. The comments from @meinac were enough to track down our error which was actually due to issues with We have a large data structure that was being held as a member variable of an object. Attempting to dump that via Logging a NoMethodError from an object (in this case a Rails controller) that held an indirect reference to one of these structures caused the exception handling to dump those objects as part of calling I'm not sure whether there is a still an infinite loop issue as @meinac reports, so will leave this up to maintainer to close. But my original issue is resolved. Sorry for the noise! |
) * Fix infinite loop problem with the `NameError`s in block exposures Calling `NameError#message` causes the `did_you_mean` library to endup being in an infinite loop(Probabaly raises `SystemStackError` at some point though). Related to ruby/did_you_mean#158 * Fix rubocop cop violations
@ldodds: Does this commit rails/rails@080edb4 in Rails 6.1 solve the problem? |
A Rails app I'm working on occasionally hangs, with the process becoming unresponsive and having to be killed.
We've also seen the same issue within the rails console and command-line scripts. In these cases a Ctrl-C causes the execution to either continue or end. But within the rails app we have to kill the process. We've removed some exception logging which was triggering the issue.
Using gdb and some manual testing, I've managed to identify that the issue is triggered whenever there is a NoMethodError generated by a call to an object and we are logging the exception message.
The gdb stack trace showed that a thread seems to be repeatedly calling methods in
Correctable
. When I remove the call tosuper.dup
into_s
, to supply a hard-coded value instead, the issue went away.We're currently on ruby-2.6.5 and Did You Mean 1.3.0.
I've tried upgrading to Did You Mean 1.5.0 but this doesn't seem to fix the issue. I also hit build/bundler issues similar to these which I've not been able to fully resolve.
We're looking to upgrade to newer ruby but I'm not sure if that will resolve the underlying problem as I gather its using version 1.5.0, but it might avoid the travis issues.
I've also been trying to disable the gem completely for the moment but setting
RUBYOPT='--disable-did_you_mean'
when runningbundle exec rails s
doesn't seem to work.Any advice on other things I can try to either identify the cause or disable the gem?
The text was updated successfully, but these errors were encountered: