Skip to content

itstool 2.0.4 crashes when freeing xmlDocs #17

@shaunix

Description

@shaunix

In itstool 2.0.4, we started calling freeDoc on xmlDoc object when we're done with them. libxml2's python bindings require manual frees. Previously, we were leaking them, which could cause runaway memory consumption. This was expecially true with --keep-entities or --load-dtd, which increases the size of the xmlDoc objects in memory.

Unfortunately, we're now freeing objects that are still in use, causing crashes. What I've figured out so far is that this only happens when we run scan_node in get_translated. This method is responsible for finding placeholder elements and recursively merging translations. A likely culprit is that, somewhere in prepping the new node to insert, we're not doing a deep enough copy, resulting in some dangling pointers to the xmlDoc we free.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions