Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fixed JRuby schema validation when XSD has DOCTYPE to DTD #912

Merged
merged 1 commit into from

5 participants

@patcheng

consolidation of #791 and #810

Patrick Cheng Fixed issue found while try to troubleshoot ruby-saml with jruby
when XSD has DOCTYPE to DTD, not able to load the file.

and the ruby script is run without path, NullPointerException got thrown.

Test to demostrate sparklemotion/nokogiri#791
28878a3
@leejarvis
Owner

This looks great, thanks for the quick response Patrick!

@leejarvis leejarvis merged commit e2c5413 into sparklemotion:master

1 check passed

Details default The Travis CI build passed
@pebrinic

Awesome fix! Would it be possible to get a new RC built with this change?

@flavorjones
Owner

1.5.10 will be released later today with this fix.

@ppg
ppg commented

Hi,

I believe I'm still hitting an issue with this on Ubuntu 8.04 (and 10.04). Ruby-saml is trying to read the protocol XSD file mentioned in a related issue and its generating a segfault:

../shared/bundle/ruby/1.8/gems/nokogiri-1.5.10/lib/nokogiri/xml/schema.rb:37: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux]

This is running through passenger 3.0.7 and fronted by apache2 (whatever the up-to-date package is on 8.04 and 10.04). Predictably it stops any saml authentication (i.e. through omniauth) from working.

The odd parts are:

  • This works on my development machine (10.04) just fine, but not on an internal testing server (tried both 8.04 and 10.04; note this is a vmware virtual machine if that affects anything)
  • If I run the Nokogiri::XML::Schema.new() call with the XSD file in IRB, it complains about the formatting of it (on both my development machine and the internal testing server which I also find wierd), but it doesn't generate a segfault.

So my questions are is this the same issue that wasn't fixed all the way, or am I seeing something different? And why the odd behavior where same OS, dependencies, etc. seem to behave differently on the two different machines? And how can I trace down further what is causing this issue and either fix it or workaround it?

Thanks,
\Peter

@ppg
ppg commented

Hmm, so I didn't realize that the chdir from ruby-saml was important to be able to find the other schemas in the directory. Now that I have that working, my development machine correctly parses the schema and returns a Nokogiri::XML::Schema object in IRB. However, now the confusing part is that the internal test server ~also~ can parse it in IRB, but when running under passenger/apache its segfaulting? I feel better about it correctly parsing on my development machine, since it works correctly there, but I feel farther from a solution with less info because now I'm at a loss on how to figure out why its segfaulting? Any suggestions?

Thanks,
\Peter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 3, 2013
  1. Fixed issue found while try to troubleshoot ruby-saml with jruby

    Patrick Cheng authored
    when XSD has DOCTYPE to DTD, not able to load the file.
    
    and the ruby script is run without path, NullPointerException got thrown.
    
    Test to demostrate sparklemotion/nokogiri#791
Something went wrong with that request. Please try again.