Skip to content

Bug: app crashed at ~LibXMLDocument because of xmlFreeDoc be called multiple times #14

Open
@bruceeelin

Description

@bruceeelin

Version:

  • svgNativeCoder: 0.2.0
  • SDWebImage: 5.19.1

Crashed iOS Version:
17.5, 17.6, 16.7, etc

Recently, we enabled the svg image loading feature in the app to be used with SDWebImage, which we introduced in the AppDelegate using this method:

SDImageSVGNativeCoder *SVGCoder = [SDImageSVGNativeCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:SVGCoder];

When using it, it is the same as loading a normal image, and there is no superfluous operation.
We've been running the online app for a week, and some users have crashes, and the stack monitored by Firebase looks like this:

image image image

This happens because the pointer is released multiple times during ~libXMLDocument(), and this bug can be replicated by adding the following code when debugging:

~LibXMLDocument()
{
    xmlFreeDoc(mDocument);
    xmlFreeDoc(mDocument); //  new added
    xmlCleanupParser();
}

I can't analyze under what scenario this crash occurs and why the pointer is released multiple times, I hope you can help look at the specific problem, thank you very much for your help

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