Closed flavorjones closed 1 year ago
ruby_memcheck
is flagging two new leaks in this version of libxml2. I've tracked it down to schema validation of files.
Ruby reproduction:
#! /usr/bin/env ruby
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "nokogiri", path: "."
end
ASSETS_DIR = File.expand_path(File.join(File.dirname(__FILE__), "..", "test", "files"))
PO_SCHEMA_FILE = File.join(ASSETS_DIR, "po.xsd")
PO_XML_FILE = File.join(ASSETS_DIR, "po.xml")
loop do
xsd = Nokogiri::XML::Schema(File.read(PO_SCHEMA_FILE))
# leaks
xsd.validate(PO_XML_FILE)
# does not leak
xsd.validate(Nokogiri::XML(File.read(PO_XML_FILE)))
end
C reproduction is at https://gist.github.com/flavorjones/0902cfc1467d44417979060dd3f11971
And upstream issue was opened at memory leak from `xmlSchemaValidateStream` in v2.11.x (#530) ยท Issues ยท GNOME / libxml2 ยท GitLab
IT IS DONE. See #2866
See https://discourse.gnome.org/t/libxml2-2-11-0-released/15123 for release notes.
It doesn't look like anything in here affects nokogiri security concerns, so I'm planning to include this in a 1.15.0 release, but not a 1.14.x patch release. Opinions welcome.
Lots of yak shaving to try to make this release work ...
Summary of blockers
Summary of nonblocking items
Details
โน ruby_memcheck is failing to parse valgrind XML files because libxml2 changed its buffering code
โน ruby_memcheck is now flagging additional errors
โน windows segfaulting at exit
โน truffleruby symbol resolution issue with xmlInitMutex (CI failure)
โน encoding looks broken on windows with precompiled native gems
โน new behavior causing test failures was added upstream while all of the above was going on
โน compiler warnings