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

Merged
merged 1 commit into from Jun 3, 2013

Conversation

Projects
None yet
5 participants
@patcheng

patcheng commented Jun 3, 2013

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 #791
@leejarvis

This comment has been minimized.

Show comment
Hide comment
@leejarvis

leejarvis Jun 3, 2013

Member

This looks great, thanks for the quick response Patrick!

Member

leejarvis commented Jun 3, 2013

This looks great, thanks for the quick response Patrick!

leejarvis added a commit that referenced this pull request Jun 3, 2013

Merge pull request #912 from patcheng/jruby_schema_validation
fixed JRuby schema validation when XSD has DOCTYPE to DTD

@leejarvis leejarvis merged commit e2c5413 into sparklemotion:master Jun 3, 2013

1 check passed

default The Travis CI build passed
Details
@pebrinic

This comment has been minimized.

Show comment
Hide comment
@pebrinic

pebrinic Jun 5, 2013

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

pebrinic commented Jun 5, 2013

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

@flavorjones

This comment has been minimized.

Show comment
Hide comment
@flavorjones

flavorjones Jun 7, 2013

Member

1.5.10 will be released later today with this fix.

Member

flavorjones commented Jun 7, 2013

1.5.10 will be released later today with this fix.

@ppg

This comment has been minimized.

Show comment
Hide comment
@ppg

ppg Aug 2, 2013

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 commented Aug 2, 2013

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

This comment has been minimized.

Show comment
Hide comment
@ppg

ppg Aug 2, 2013

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

ppg commented Aug 2, 2013

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