Skip to content
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

hpricot crashes Ruby when input is empty #28

Open
e2 opened this issue Feb 6, 2015 · 1 comment
Open

hpricot crashes Ruby when input is empty #28

e2 opened this issue Feb 6, 2015 · 1 comment

Comments

@e2
Copy link

e2 commented Feb 6, 2015

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.

@joaomilho
Copy link
Member

Could be easily fixed in a PR. Any chance you can try it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants