{"action":"created","issue":{"url":"https://api.github.com/repos/ohler55/ox/issues/161","repository_url":"https://api.github.com/repos/ohler55/ox","labels_url":"https://api.github.com/repos/ohler55/ox/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/ohler55/ox/issues/161/comments","events_url":"https://api.github.com/repos/ohler55/ox/issues/161/events","html_url":"https://github.com/ohler55/ox/issues/161","id":206133016,"number":161,"title":"getting segmentation fault while using ox parser.","user":{"login":"arashiya","id":18007218,"avatar_url":"https://avatars.githubusercontent.com/u/18007218?v=3","gravatar_id":"","url":"https://api.github.com/users/arashiya","html_url":"https://github.com/arashiya","followers_url":"https://api.github.com/users/arashiya/followers","following_url":"https://api.github.com/users/arashiya/following{/other_user}","gists_url":"https://api.github.com/users/arashiya/gists{/gist_id}","starred_url":"https://api.github.com/users/arashiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arashiya/subscriptions","organizations_url":"https://api.github.com/users/arashiya/orgs","repos_url":"https://api.github.com/users/arashiya/repos","events_url":"https://api.github.com/users/arashiya/events{/privacy}","received_events_url":"https://api.github.com/users/arashiya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-02-08T08:56:34Z","updated_at":"2017-02-16T04:46:47Z","closed_at":null,"body":"I am getting segmentation fault error when using ox parser. The error is as follows:\r\n/mnt/deployed/data-import/releases/data-import_20170207-112126_1677_bb8e24ecee_dev-branch/helpers/easy_sax.rb:30: [BUG] Segmentation fault at 0x00000000000030  check_box FILTER FOR'\r\n\r\nFollowing is the code which is there in easy_sax.rb\r\n```ruby\r\nclass EasySax < ::Ox::Sax\r\n  def initialize(roots_name, handler)\r\n    @roots_name = roots_name.to_sym\r\n    @handler = handler\r\n    @ignore = true\r\n    @stack = []\r\n  end\r\n\r\n  def create_new_element(name)\r\n    {\r\n      name: name,\r\n      attributes: {},\r\n      children: {},\r\n      cdata: nil,\r\n      text: nil\r\n    }\r\n  end\r\n\r\n  def start_element(name)\r\n    if @ignore\r\n      if name == @roots_name\r\n        @current = @current_root = create_new_element(name)\r\n        @stack.push(@current)\r\n        @ignore = false\r\n      else\r\n        return\r\n      end\r\n    else\r\n      new_elm = create_new_element(name)\r\n      @current[:children][name] ||= []\r\n      @current[:children][name].push new_elm\r\n      @current = new_elm\r\n      @stack.push(@current)\r\n    end\r\n  end\r\n\r\n  def end_element(name)\r\n    return if @ignore\r\n\r\n    popped = @stack.pop\r\n    @current = @stack.last\r\n\r\n    if name == @roots_name\r\n      @ignore = true\r\n      @handler.call(@current_root)\r\n    end\r\n  end\r\n\r\n  def attr(name, value)\r\n    return if @ignore\r\n    @current[:attributes][name] = value\r\n  end\r\n\r\n  def text(value)\r\n    return if @ignore\r\n    @current[:text] = value\r\n  end\r\n\r\n  def cdata(value)\r\n    return if @ignore\r\n    @current[:cdata] = value\r\n  end\r\nend\r\n```\r\ncode at line 30 is  \"@current[:children][name] ||= []\"\r\nThis was not happening before and it suddently started happening. I am trying to parse a file with size almost 1.7 GB."},"comment":{"url":"https://api.github.com/repos/ohler55/ox/issues/comments/280230166","html_url":"https://github.com/ohler55/ox/issues/161#issuecomment-280230166","issue_url":"https://api.github.com/repos/ohler55/ox/issues/161","id":280230166,"user":{"login":"shruthipuranik","id":6974429,"avatar_url":"https://avatars.githubusercontent.com/u/6974429?v=3","gravatar_id":"","url":"https://api.github.com/users/shruthipuranik","html_url":"https://github.com/shruthipuranik","followers_url":"https://api.github.com/users/shruthipuranik/followers","following_url":"https://api.github.com/users/shruthipuranik/following{/other_user}","gists_url":"https://api.github.com/users/shruthipuranik/gists{/gist_id}","starred_url":"https://api.github.com/users/shruthipuranik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shruthipuranik/subscriptions","organizations_url":"https://api.github.com/users/shruthipuranik/orgs","repos_url":"https://api.github.com/users/shruthipuranik/repos","events_url":"https://api.github.com/users/shruthipuranik/events{/privacy}","received_events_url":"https://api.github.com/users/shruthipuranik/received_events","type":"User","site_admin":false},"created_at":"2017-02-16T04:46:47Z","updated_at":"2017-02-16T04:46:47Z","body":"The following error appears sometimes in line 30. \r\ncode at line 30 is \"@current[:children][name] ||= []\"\r\nmethod `hash' called on unexpected T_NODE object (0x007efd2f1bdf90 flags=0x651c)\r\nAny idea of what this could be?"}}
{"actor":{"display_login":"shruthipuranik"}}