Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libfreetype.so.6+0x73c9] FT_Stream_Close+0x19
C [libfreetype.so.6+0xa065] FT_Stream_Free+0x25
C [libfreetype.so.6+0xaf78] FT_Done_Face+0x78
This appeared to be due to two JNI pitfalls:
- The JNIEnv is unique to the thread. It cannot be saved by one thread and reused by another. Use GetEnv instead.
- The font2D jobject in freetypeScaler.c needs to be converted into a global reference because its lifetime exceeds the lifetime of a native method call.
Martin Buchholz and I suggested a patch. But here's a fix that was actually submitted by Igor Nekrestyanov: