Ticket #96 (reopened defect)

Opened 13 months ago

Last modified 3 months ago

Hpricot::ParseError - ran out of buffer space

Reported by: holymonkey Owned by: why
Priority: major Milestone: 0.6
Component: ext/hpricot_scan Version:
Keywords: parseerror buffer Cc: oksteev

Description

This issue occurs with Hpricot 0.6 when loading the attached html file.

irb(main):001:0> f = File.open 'hpricot-bug.txt'
=> #<File:hpricot-bug.txt>
irb(main):002:0> require 'rubygems'
=> true
irb(main):003:0> require 'hpricot'
=> true
irb(main):004:0> Hpricot f
/usr/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/hpricot/parse.rb:51:in `scan': ran out of buffer space on element <input>, starting on line 26. (Hpricot::ParseError)
        from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/hpricot/parse.rb:51:in `make'
        from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/hpricot/parse.rb:15:in `parse'
        from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/hpricot/parse.rb:4:in `Hpricot'
        from (irb):4:in `irb_binding'
        from /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
        from /usr/lib/ruby/1.8/irb/workspace.rb:52

I am using cygwin in windows xp. Ruby version 1.8.6

Change History

follow-up: ↓ 2   Changed 13 months ago by holymonkey

Trac is giving me errors when I try to upload files, so here is a url instead:

http://www.wittmeierhonda.com/preowned-inventory.asp

in reply to: ↑ 1   Changed 12 months ago by static

  • status changed from new to closed
  • resolution set to duplicate

Look at ticket #13 and use Hpricot.buffer_size = 262144 (or some other big number...cool kids use obscure powers of 2). Your link works for me after this change.

  Changed 7 months ago by holymonkey

This did the trick. Thank you for the feedback!

  Changed 5 months ago by oksteev

... or if you want a dynamically increasing buffer look at this ticket http://code.whytheluckystiff.net/hpricot/ticket/105 and get the patched gem from here: http://coderrr.wordpress.com/2007/09/14/hpricot-patch-to-support-arbitrarily-large-elements/

  Changed 4 months ago by cheald

  • status changed from closed to reopened
  • resolution deleted

It'd be great to get the dynamic buffer growth patch added to the trunk. This is a severely annoying bug, and given the prevalence of ASP.NET viewstates, will crop up in common usage.

  Changed 3 months ago by oksteev

+1 to that :]

  Changed 3 months ago by oksteev

  • cc oksteev added
Note: See TracTickets for help on using tickets.