This is likely the culprit why we see the failures, if you call this after redefining share_with, share_with and share_with_original point to the same method, so the call to share_with_original inside the new share_with becomes and unconditional recursive call.