[cairo] pixman TLS crash on win32 under java-vm

Kozhevnikov Mikhail mikhailkozhevnikov at yandex.ru
Wed Sep 1 09:52:36 PDT 2010


Hi,

I've got a rather strange setup here, which causes pixman to crash. It seems to happen in line 657 of pixman.c that reads

cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache);

which disassembles into 

102F8922 mov edx,dword ptr [__tls_index (1064AEDCh)] 
102F8928 mov eax,dword ptr fs:[0000002Ch] 
102F892E mov ecx,dword ptr [eax+edx*4] 
102F8931 add ecx,108h 
102F8937 mov dword ptr [cache],ecx 

where the third instruction is the one to cause the crash.

The call sequence is as follows:
do_composite
pixman_image_composite32
pixman_image_composite
_cairo_image_surface_composite
_cairo_surface_composite
_cairo_win32_scaled_font_show_glyphs
_cairo_scaled_font_show_glyphs
_cairo_surface_old_show_glyphs_draw_func
_clip_and_composite
_cairo_surface_fallback_show_glyphs
_cairo_surface_show_text_glyphs
_cairo_gstate_show_text_glyphs
cairo_show_text

The 32-bit binaries are built from the latest cairo/pixman release sources with VS 9.0 under Win Server 2008 x64 and are linked into a dll that's loaded by the Java VM on a Win XP x86 machine. An interesting point is that we've failed to reproduce this error on 32-bit Vista or on the same machine, but calldoing the same stuff from a C++ application without using Java.
I suspect that this has something to do with the TLS machinery in use. Has anyone ran across this?
Is there a way to prevent pixman from using TLS?

Cheers,
Mikhail.


More information about the cairo mailing list