libxml-raku / LibXML-raku

Raku bindings to the libxml2 native library
Artistic License 2.0
11 stars 4 forks source link

Referencing issue in findnodes node-sets #112

Closed dwarring closed 5 months ago

dwarring commented 6 months ago
use LibXML;

my $string = q:to<__DATA__>;
    <AAA>
    <BBB></BBB>
    </AAA>
    __DATA__
my $xml = LibXML.parse: :$string;

for 1 .. 1000 {
    .<BBB> given $xml.findnodes('//BBB');
}

produces errors on GC

src/xml6_node.c:21 0x5614aed42b40 type=1 name='BBB'
src/xml6_ref.c:93: node 0x5614aed42b40 was not referenced
src/xml6_node.c:21 0x5614aed42b40 type=1 name='BBB'
src/xml6_ref.c:93: node 0x5614aed42b40 was not referenced
src/xml6_node.c:21 0x5614aed42b40 type=1 name='BBB'
src/xml6_ref.c:93: node 0x5614aed42b40 was not referenced
src/xml6_node.c:21 0x5614aed42b40 type=1 name='BBB'
src/xml6_ref.c:93: node 0x5614aed42b40 was not referenced
src/xml6_node.c:21 0x5614aed42b40 type=1 name='BBB'
src/xml6_ref.c:93: node 0x5614aed42b40 was not referenced
... etc
dwarring commented 6 months ago

As does $xml.findnodes('//*')<z>

dwarring commented 5 months ago

Fixed in LibXML 0.10.9