Closed caldwell closed 5 years ago
Interesting case. All you need is to keep on of the c
elements and the unlink_node call and I can reproduce.
It seems that unlinking a node that comes from an xpath evaluation isn't implemented correctly, will try to fish out which is the exact misalignment from the libxml2 recommendation.
I may have a fix in #51 , will run a couple of extra tests tomorrow and land it. Let me know if you spot any other issues!
That was impressively quick debugging :-). I compiled my original code against your PR #51 branch and do not see any more malloc asserts. Thanks!
I have a test case in the drop_test branch of my github fork. The test commit is here. It's ugly. I tried to make it a more suitable testcase that you could use (smaller and use more obfuscated xml), but everything I did caused the problem to go away.
When I run
cargo test
on Mac OS X I get this:When I run on Debian, I get this:
I tried the breakpoint suggested in the mac error message and caught it. The backtrace is this:
This makes me think it's the drop code for
_Node
in node.rs. I tried looking at it but as I'm not really familiar with the code, there was nothing super obvious to me.