Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use xmlFreeNode in xml_document.c to deallocate unparented nodes of all types #1826

Closed
flavorjones opened this issue Dec 2, 2018 · 4 comments
Labels
topic/memory Segfaults, memory leaks, valgrind testing, etc.

Comments

@flavorjones
Copy link
Member

As @stevecheckoway pointed out in #1784 we might be able to avoid the case statement in dealloc_node_i and let xmlFreeNode take care of it for us.

This change would be a simplification, but I need to spend some time digging into:

  • why we call xmlFreePropList on XML_ATTRIBUTE_NODEs
  • why we reparent most nodes back into the document instead of just freeing them.

Both of these features have been around since 2009 (1aa012a) and I couldn't quickly find a clear reason why. Let's be careful here not to introduce an inadvertent memory leak.

@flavorjones
Copy link
Member Author

@rubarb666 can you explain a bit more about your comment?

@flavorjones
Copy link
Member Author

I'd like to block this on #1603 which will add the memory leak test suite to CI

@flavorjones flavorjones added the topic/memory Segfaults, memory leaks, valgrind testing, etc. label Feb 2, 2020
@sparklemotion sparklemotion deleted a comment from rubarb666 Oct 20, 2020
@sparklemotion sparklemotion deleted a comment from rubarb666 Oct 20, 2020
@flavorjones
Copy link
Member Author

Hey! The memory leak suite has been back in effect since 6326caa (2023-12-10) so let's do this.

@flavorjones flavorjones added this to the v1.17.0 milestone Jul 2, 2024
@flavorjones
Copy link
Member Author

Yeah, so this didn't work -- it either leaked memory or segfaulted. I'm not going to spend time on figuring out why, though, since the code it would simplify is pretty minimal and hopefully more generally we can get rid of the nonstandard memory lifecycle of nodes (as Nick suggested in #1952 (comment)).

@flavorjones flavorjones closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2024
@flavorjones flavorjones removed this from the v1.17.0 milestone Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/memory Segfaults, memory leaks, valgrind testing, etc.
Projects
None yet
Development

No branches or pull requests

1 participant