libxml crashing after upgrading to Xcode 11.4 in release build

Hello, community.

Starting from Xcode 11.4, libxml behaving differently in debug and release build, sometimes crashes. It works fine before Xcode 11.3 or in debug build.

My project use libxml via a 3rd party library called Fuzi. Fuzi have't changed in months, so I don't think it's where problem lie in . I have spent months debugging this issue, but unfortunately not yet find the cause.

I have created a demo project for reproducing this issue. https://github.com/kukushi/FuziCrash

Any help will be welcomed.
Answered by DarkMaster in 636675022
Thanks for responding.

During the process of creating a minimum swift file for reproducing this issue, I found it was a crash caused by an inappropriate usage of unowned let and referencing a released object inside the third party framework. The weird part is that crash only happened in the release build. Anyway, this is not a issue of libxml and I will close this question.
As far as I checked the source code of Fuzi, there are some inappropriate pointer usages, which may cause crash depending on the implementation details and runtime context (or may cause any sort of unpredictable behaviors).

You should better contact to the author of the library.
Accepted Answer
Thanks for responding.

During the process of creating a minimum swift file for reproducing this issue, I found it was a crash caused by an inappropriate usage of unowned let and referencing a released object inside the third party framework. The weird part is that crash only happened in the release build. Anyway, this is not a issue of libxml and I will close this question.
Glad to hear that you got this sorted.

The weird part is that crash only happened in the release build.

That’s not that weird. The Release build typically enables optimisations. That will radically shuffle around the memory access patterns in your app which can expose latent memory management bugs.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
libxml crashing after upgrading to Xcode 11.4 in release build
 
 
Q