AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2018.07.27 23:11 "[Tiff] libtiff (v3 / v4) maintain/use shared global state?", by Alan Koohi
2018.07.28 13:28 "Re: [Tiff] libtiff (v3 / v4) maintain/use shared global state?", by Bob Friesenhahn

2018.07.27 23:11 "[Tiff] libtiff (v3 / v4) maintain/use shared global state?", by Alan Koohi

Question: Does libtiff attempt at maintaining any sort of shared global state among the DSOs dynamically referenced by the same process?

Background: I'm working on a plugin (C++) that ends up indirectly pulling in 2 different versions of libtiff (library X dynamically linked against libtiff v3.9.4 and library Y against libtiff v4.0.7) into the run-time environment through two 3rd party dependencies, which results in a segmentation fault crash due to a missing symbol (TIFFFindFieldInfo).

Considering I can rebuild X and Y from source, but modifying the source is not an option, I tried to statically link libtiff v3.9.4 into library X to make all the libtiff symbols it needs locally available, which avoids the crash; I've been testing this for some time and can confirm this solves the missing symbol problem.

The only concern I have is whether or not libtiff maintains some sort of a global state which may be shared among all libtiff users (DSOs) referenced by the same process. If this is not the case, then I can go with the static linkage solution, otherwise it is probably not safe.

Thanks in advance for your help!