[libxml-devel] fyi: bug in libxml backend for Rails new xml_mini backend

2009-03-16 Thread Stephen Bannasch
FYI: I've got a bug in a Rails lighthouse ticket http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2258-libxml-xml_mini-backend-producing-incorrect-hashes Showing a case where the libxml backend produces an incorrect hash. Would be great to get this fixed before the next relea

Re: [libxml-devel] fyi: bug in libxml backend for Rails new xml_mini backend

2009-03-16 Thread Charlie Savage
Stephen, And where is the Hash#to_xml method defined? Charlie Stephen Bannasch wrote: FYI: I've got a bug in a Rails lighthouse ticket http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2258-libxml-xml_mini-backend-producing-incorrect-hashes Showing a case where the libxm

Re: [libxml-devel] fyi: bug in libxml backend for Rails new xml_mini backend

2009-03-16 Thread Stephen Bannasch
At 3:11 PM -0600 3/16/09, Charlie Savage wrote: Stephen, And where is the Hash#to_xml method defined? It's part of what an activesupport xml_mini backend does. Take a look in the rails source code here: activesupport/lib/active_support/xml_mini Which you can see here: http://github.com/r

Re: [libxml-devel] fyi: bug in libxml backend for Rails new xml_mini backend

2009-03-16 Thread Charlie Savage
On the first test, its a bug in the activesupport code: def to_hash(hash={}) if text? raise LibXML::XML::Error if content.length >= LIB_XML_LIMIT hash[CONTENT_ROOT] = content # ! INCORRECT ! else This is the xml: good hello everyone morning

Re: [libxml-devel] fyi: bug in libxml backend for Rails new xml_mini backend

2009-03-16 Thread Charlie Savage
And on the second test case: The error is here: def children_array_to_hash(hash={}) hash[child.name] = map do |child| returning({}) { |sub_hash| child.children_to_hash(sub_hash) } end hash end There is no check to see if the element name has chan

[libxml-devel] bus error cause by bad XML

2009-03-16 Thread Stephen Bannasch
In working on the rails xml_mini backend tests I found a test generating a bus error when using libxml-ruby-1.1.2. Here's a stand-alone adaptation of the test that runs on the just released Rails 2.3.2: file: test_attack_xml.rb require 'rubygems' require 'test/unit' require 'activesupport'

Re: [libxml-devel] bus error cause by bad XML

2009-03-16 Thread Charlie Savage
Hi Stephen, Here's the result running on MacOS 10.5.6 $ ruby test_attack_xml_with_libxml.rb Loaded suite test_attack_xml Started /Library/Ruby/Gems/1.8/gems/libxml-ruby-1.1.2/lib/libxml/node.rb:100: [BUG] Bus Error ruby 1.8.6 (2008-03-03) [universal-darwin9.0] Abort trap Can you get a stac

Re: [libxml-devel] bus error cause by bad XML

2009-03-16 Thread Aaron Patterson
On Mon, Mar 16, 2009 at 8:50 PM, Stephen Bannasch wrote: > In working on the rails xml_mini backend tests I found a test generating a > bus error when using libxml-ruby-1.1.2. > > Here's a stand-alone adaptation of the test that runs on the just released > Rails 2.3.2: > > file:  test_attack_xml.r