Hi Yavor, On 2011-03-11, at 12:25 PM, Yavor Doganov wrote:
Right. As far as I remember, I looked at the disassembled code for this variable in Ubuntu's pixman package, and it was using the "global-dynamic" model, which is the correct model to use in shared libraries. So it doesn't look like pixman is doing anything wrong. I think what led me to say this was, I found that modifying GNUstep-gui so it links directly to cairo and pixman made the crash disappear. So it was more or less just a guess that dlopen was somehow involved. However, after doing a bit more research I agree there should be no problem with dlopen and TLS, assuming the shared library uses the correct TLS model, which pixman does. Further supporting this, I tried to write a simple test case with a layout similar to GNUstep: 1. executable, dynamically linked to: 2. shared library, which dlopens: 3. shared library, which uses TLS and I was unable to get a crash to happen.
Hm, that's interesting! It sounds like a convincing hypothesis. I can test that, but it will take me a few days because I have to set up this virtual machine again. BTW, I switched from 32-bit Ubuntu 10.10 (where I was observing the bug) to amd64 Ubuntu 10.10, and found that this bug doesn't occur on amd64. Are you also observing it on 32-bit only?
I agree, it seems like the fact that disabling TLS in pixman makes the bug symptoms disappear is more or less a coincidence. Hopefully we are close to tracking down this really strange bug :-) Cheers, Eric |