kiwix / libkiwix

Common code base for all Kiwix ports
https://download.kiwix.org/release/libkiwix/
GNU General Public License v3.0
116 stars 56 forks source link

Allocation of icu transliterator in removeAccents on apple fails #1101

Open mgautierfr opened 1 month ago

mgautierfr commented 1 month ago

See https://github.com/kiwix/kiwix-apple/issues/851

From first investigation, from trace, apple application is using icu73. But we are loading icu data version 58 (https://github.com/kiwix/libkiwix/blob/main/src/tools/stringTools.cpp#L39-L49) There is something wrong ?

@BPerlakiH Are you calling the method loadICUExternalTables first ?

BPerlakiH commented 1 month ago

I have investigated this further. The issue will be fixed on the Apple side here: https://github.com/kiwix/kiwix-apple/pull/868

The reason it was failing is that we had calls to Kiwix::Manager->readOPDS() from multiple threads at the same time!

From the more detailed crash report, I can see that both Thread 1 and Thread 6 are calling the same:

Screenshot 2024-07-15 at 12 16 03 Screenshot 2024-07-15 at 12 15 55
kelson42 commented 4 weeks ago

From first investigation, from trace, apple application is using icu73. But we are loading icu data version 58 (https://github.com/kiwix/libkiwix/blob/main/src/tools/stringTools.cpp#L39-L49)

We do use version 73, see https://github.com/kiwix/kiwix-build/blob/main/kiwixbuild/dependencies/icu4c.py#L17. The only question is why do we use what looks like to be an outdated .dat file!?