Bug 17295 - GdkGlyphVector.c triggers assert()s for empty strings
Summary: GdkGlyphVector.c triggers assert()s for empty strings
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Thomas Fitzsimmons
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 18:50 UTC by Mark Wielaard
Modified: 2010-09-08 18:18 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-09-09 03:22:45


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2004-09-02 18:50:29 UTC
Both GdkGlyphVector_setChars after pango_itemize() returns NULL and
GdkGlyphVector_allInkExtents when vec->glyphitems is NULL trigger an assert().

Workaround for now is to just return from those methods when that condition occurs.
Comment 1 GCC Commits 2004-09-03 23:27:53 UTC
Subject: Bug 17295

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	java-gui-branch
Changes by:	mark@gcc.gnu.org	2004-09-03 23:27:41

Modified files:
	libjava        : ChangeLog 
	libjava/gnu/java/awt/peer/gtk: GdkGraphics.java 
	                               GdkGraphics2D.java 
	libjava/java/awt: FontMetrics.java 
	libjava/javax/swing: JMenu.java 
	libjava/javax/swing/plaf/basic: BasicGraphicsUtils.java 
	libjava/jni/gtk-peer: gnu_java_awt_peer_gtk_GdkGlyphVector.c 

Log message:
	* gnu/java/awt/peer/gtk/GdkGraphics.java (setColor): Use
	Color.BLACK if c == null, don't create new Color object each time.
	* gnu/java/awt/peer/gtk/GdkGraphics2D.java (comp): New private
	field.
	(setColor): Use Color.BLACK when argument null.
	(setComposite): Set this.comp field.
	(getComposite): Return this.comp, or AlphaComposite.SrcOver when null.
	(DrawState.comp): New private field.
	(DrawState.save): Save Composite.
	(DrawState.restore): Restore comp field.
	* java/awt/FontMetrics.java (gRC): New static final private field.
	(getLineMetrics(String, Graphics)): New method.
	(getLineMetrics(String, int, int, Graphics)): Likewise.
	(getLineMetrics(char[], int, int, Graphics)): Likewise.
	(getLineMetrics(CharacterIterator, int, int, Graphics)): Likewise.
	* javax/swing/JMenu.java (JMenu(String, boolean)): Ignore tearoff
	argument. PR SWING/17294.
	* javax/swing/plaf/basic/BasicGraphicsUtils.java (): Always use
	the fall-back code since none of the TextArea methods are really
	implemented now. PR SWING/17296.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
	(GdkGlyphVector_setChars): Replace assert() with if block when
	pango_itemize() returns null. PR AWT/17295.
	(GdkGlyphVector_allInkExtents): Likewise when vec->glyphitems is null.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.2660.2.363&r2=1.2660.2.364
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.4.16.7&r2=1.4.16.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.7.2.15&r2=1.7.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/awt/FontMetrics.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.5.2.1&r2=1.5.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/javax/swing/JMenu.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.3.8.11&r2=1.3.8.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.7.2.2&r2=1.7.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.2.12.2&r2=1.2.12.3

Comment 2 Andrew Pinski 2004-09-07 08:41:13 UTC
Fixed on the GUI branch.
Comment 3 Mark Wielaard 2004-09-07 20:28:28 UTC
The GUI branch doesn't have a fix. It only has a workaround for the problem.
Comment 4 Andrew Pinski 2004-12-09 00:14:03 UTC
Fixed.
Comment 5 Frédéric Buclin 2010-09-08 18:18:45 UTC
Resetting the target milestone, which doesn't exist in the 'classpath' product.