{"action":"closed","issue":{"url":"https://api.github.com/repos/cowboyd/therubyracer/issues/397","labels_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/397/labels{/name}","comments_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/397/comments","events_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/397/events","html_url":"https://github.com/cowboyd/therubyracer/issues/397","id":122084529,"number":397,"title":"V8 causing weak references in session objects","user":{"login":"hlascelles","id":299102,"avatar_url":"https://avatars.githubusercontent.com/u/299102?v=3","gravatar_id":"","url":"https://api.github.com/users/hlascelles","html_url":"https://github.com/hlascelles","followers_url":"https://api.github.com/users/hlascelles/followers","following_url":"https://api.github.com/users/hlascelles/following{/other_user}","gists_url":"https://api.github.com/users/hlascelles/gists{/gist_id}","starred_url":"https://api.github.com/users/hlascelles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlascelles/subscriptions","organizations_url":"https://api.github.com/users/hlascelles/orgs","repos_url":"https://api.github.com/users/hlascelles/repos","events_url":"https://api.github.com/users/hlascelles/events{/privacy}","received_events_url":"https://api.github.com/users/hlascelles/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-14T16:58:42Z","updated_at":"2015-12-14T17:14:35Z","closed_at":"2015-12-14T17:14:35Z","body":"We were recently running into issues where our session `inspect` calls were crashing with a **WeakRef::RefError: Invalid Reference - probably recycled**. (Specifically, it was being triggered by Devise https://github.com/plataformatec/devise/issues/3828).\r\n\r\nA report of the class hierarchy yielded this:\r\n\r\n```\r\nself.class.ancestors = [ActionDispatch::Request::Session, Object, PP::ObjectMixin, V8::Conversion::Object, JSON::Ext::Generator::GeneratorMethods::Object, Kernel, BasicObject]\r\n```\r\n\r\nAnd sure enough the `V8::Conversion::Object` interloper was causing session objects to be unsafely garbage collected.\r\n\r\nThe only fix we found was to remove therubyracer altogether from deployed environments."}}