Skip to content

hpricot crashes Ruby when input is empty #28

Description

@e2
IO.popen("html2slim", 'r+') do |io|
  io.write ""
  io.close_write
  puts io.read
end

Crashes with:

/home/me/.rvm/gems/ruby-2.2.0/gems/hpricot-0.8.6/lib/hpricot/parse.rb:33: [BUG] Segmentation fault at 0x00000000000008
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0015 p:---- s:0071 e:000070 CFUNC  :scan
c:0014 p:0062 s:0066 e:000065 METHOD /home/me/.rvm/gems/ruby-2.2.0/gems/hpricot-0.8.6/lib/hpricot/parse.rb:33
c:0013 p:0026 s:0059 e:000058 METHOD /home/me/.rvm/gems/ruby-2.2.0/gems/hpricot-0.8.6/lib/hpricot/parse.rb:4
c:0012 p:0009 s:0053 e:000052 METHOD /home/me/.rvm/gems/ruby-2.2.0/gems/html2slim-0.1.1/lib/html2slim/converter.rb:11 [FINISH]
c:0

(etc.)

System:

hpricot (0.8.6)
html2slim (0.1.1)
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]

Probably a hpricot issue, but hpricot is no longer maintained AFAIK.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions