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
WeakRef::RefError: Invalid Reference - probably recycled #863
Comments
Here's another stack trace with less haml and more nanoc: |
Yup, I am getting this one as well. This is caused by the recent change of #846, though I am not quite sure why. |
Potential fix in #865. |
The only reason for this to fail seems be that GC occurs between the check for |
Probably it's best to disable GC during check and retrieval? |
Yes, it seems GC is the culprit. I added this: + require 'pry-byebug'
+ prestat = GC.stat
if method_cache.key?(args) && method_cache[args].weakref_alive?
+ begin
method_cache[args].value
+ rescue => e
+ errstat = GC.stat
+ binding.pry
+ raise
+ end
else
send(original_method_name, *args).tap do |r|
method_cache[args] = WeakRef.new(Wrapper.new(r))
end
end When the debugger breaks I printed the GC count:
|
Correct. I have a fix in #865, which uses |
Hi,
first thanks for the great and consistent work on nanoc.
Me and my team really appreciate it.
Problem
I create the used items inside a
preprocess
rule.After upgrading to Nanoc 4.2.0 I experience the following error when I access
@item
inside a template:Environment
crash.log
crash.txt
Let me know if I can provide further information to this topic
Kind Regards
Gregor
The text was updated successfully, but these errors were encountered: