User account creation filtered due to spam.

Bug 28804 - segfault in libfreetype (debian) with e.g. Java2Demo
Summary: segfault in libfreetype (debian) with e.g. Java2Demo
Status: RESOLVED DUPLICATE of bug 38473
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2006-08-22 13:48 UTC by Christian Thalinger
Modified: 2008-12-10 22:58 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:

small swing test case (1004 bytes, text/plain)
2006-08-24 11:17 UTC, Christian Thalinger

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Thalinger 2006-08-22 13:48:11 UTC
When running Java2Demo from SUN, I get the following segfault.  It seems that this happens only on Debian systems, as other people (Robert Schuster IIRC) haven't seen this crash with a different application (which I also can't remember anymore, sorry).

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912509268384 (LWP 15538)]
0x00002aaaad93b402 in FT_Outline_Decompose () from /usr/lib/
(gdb) bt
#0  0x00002aaaad93b402 in FT_Outline_Decompose () from /usr/lib/
#1  0x00002aaaac5973af in Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative (env=0x503080, obj=Variable "obj" is not available.
    at ../../../../native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:337

The CACAO output of that segfault is:

LOG: [0x558e00] We received a SIGSEGV and tried to handle it, but we were
LOG: [0x558e00] unable to find a Java method at:
LOG: [0x558e00] 
LOG: [0x558e00] PC=0x00002aaaad8e5402
LOG: [0x558e00] 
LOG: [0x558e00] Dumping the current stacktrace:
        at;(Native Method)
        at java.awt.font.TextLayout.getOutline(Ljava/awt/geom/AffineTransform;)Ljava/awt/Shape;(
        at java2d.Intro$Surface$TxE.<init>(Ljava/lang/String;Ljava/awt/Font;ILjava/awt/Paint;II)V(
        at java2d.Intro$Surface$Director.<init>()V(
        at java2d.Intro$Surface.<init>()V(
        at java2d.Intro.<init>()V(
        at java2d.Java2Demo.<init>()V(
        at java2d.Java2Demo.main([Ljava/lang/String;)V(
LOG: [0x558e00] Exiting...
Aborted (core dumped)
Comment 1 Christian Thalinger 2006-08-24 11:17:54 UTC
Created attachment 12125 [details]
small swing test case

This testcase also triggers the bug.
Comment 2 Debian GCC Maintainers 2008-01-27 21:09:40 UTC
I cannot reproduce this with current unstable.

Comment 3 Christian Thalinger 2008-01-27 21:31:24 UTC
IIRC this is somehow related to fonts I have installed.  But I'm not sure.
Comment 4 Christian Thalinger 2008-04-09 21:07:03 UTC
Today this bug hit me again and here is a simple testcase to reproduce it:

new java.awt.Font("Helvetica", java.awt.Font.PLAIN, 12), "test", null).getOutline();
Comment 5 Mark Wielaard 2008-05-09 12:00:42 UTC
I cannot reproduce this with either jamvm or cacao on a Fedora 8 x86_64 with freetype-2.3.5-3.fc8. Might it be the actual fonts installed?
Comment 6 Christian Thalinger 2008-05-10 13:45:14 UTC
I tried to install and remove some packages, but I can't reproduce it on my powerpc laptop either.  A powerpc64 machine at the university works too, but the i386 and x86_64 machines fail.
Comment 7 Yu Ning 2008-06-27 07:31:37 UTC
google lead me to this thread, and I'm new to mail-list or bugzilla, so if I comment in the wrong way, please be friendly :)

I met this bug when I'm porting classpath-0.97.2 to gtk-dfb. We will get this error if we try to decompose a non-vector font. The code locate in CLASSPATH/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreeTypeglyphVector.c is:

FT_Get_Glyph( ft_face->glyph, &glyph );

then if the font is not in FT_GLYPH_FORMAT_OUTLINE format, Segment Fault is met.

So I just add one line between the above two lines to avoid the fault:

 FT_Get_Glyph( ft_face->glyph, &glyph );
+if (ft_face->glyph->format == FT_GLYPH_FORMAT_OUTLINE)

by adding this, now I can run classpath & jamvm on gtk-dfb, the only problem is all text are shown as black boxes, because in fact no font is decomposed at all (in my print, only font with format == FT_GLYPH_FORMAT_BITMAP is found).

I'm not familar with freetype, and don't know how to still display text even if no vector fonts found. Dose anyone have some ideas? Any suggestion is welcomed.

forgive my poor English, please.
Comment 8 Andrew John Hughes 2008-12-10 22:58:57 UTC
Marking this older bug as duplicate, as more info and a minimal fix are in the new bug.

*** This bug has been marked as a duplicate of 38473 ***