LibXML::XML::Document.validate(LibXML::XML::Schema) fails with Segmataion fault

Bug #365244 reported by svenk
2
Affects Status Importance Assigned to Milestone
libxml-ruby (Ubuntu)
New
Undecided
Unassigned

Bug Description

Architecture: x86_64
Description: Ubuntu 9.04
Release: 9.04
libxml-ruby1.8: 0.9.4-1

When i call `ruby information_controller_test`, the following code throws an Segmetation fault, but
the same xml / xsd files works with `xmllint --schema version.xsd version.xml` without any problem.

# Start of Code ####

require File.dirname(__FILE__) + '/../test_helper'
require 'libxml'

class MylynConnector::InformationControllerTest < ActionController::TestCase
  def setup
    @controller = MylynConnector::InformationController.new
    @request = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new
  end

  def test_version
    get :version
      .
      .
    xmldoc = LibXML::XML::Document.string @response.body
    schema = read_schema 'version'
    valid = xmldoc.validate schema # produces the segmentation fault
  end

  protected
  def read_schema name
    schemapath = File.dirname(__FILE__) + '/../schema/' + name + '.xsd';
    schemadoc = LibXML::XML::Document.file schemapath
    LibXML::XML::Schema.document schemadoc
  end
end

# End of Code ####

The same xml / xsd files works with `xmllint --schema version.xsd version.xml` without any problem.

Revision history for this message
svenk (sven-krzyzak) wrote :
Revision history for this message
svenk (sven-krzyzak) wrote :

Shame on me, i have mistaken the methods.
I have to call validate_schema

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.