[kaffe] AWT/QT bug

Benja Fallenstein b.fallenstein at gmx.de
Wed Jul 7 13:27:42 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I've managed to compile awt-qt from the newest CVS, but there's some
seriously weird bug going on that is way over my head. The following
program works and produces a frame on the screen:

- --------------------------------------------------------------------
import java.awt.*;

class M {
~    public static void call(Frame f) {
	f.show();
~    }

~    public static void main(String[]s) {
	Frame f = new Frame("foo");
	System.out.println();
	System.out.println("SET VISIBLE");
	call(f);
	System.out.println("END SET VISIBLE");
	System.out.println();
~    }
}
- --------------------------------------------------------------------

However, the following program fails with a NullPointerException in
native code:

- --------------------------------------------------------------------
import java.awt.*;

class M {
~    public static void main(String[]s) {
	Frame f = new Frame("foo");
	System.out.println();
	System.out.println("SET VISIBLE");
	f.show();
	System.out.println("END SET VISIBLE");
	System.out.println();
~    }
}
- --------------------------------------------------------------------

The stack trace is as follows:

java.lang.NullPointerException
~   at java.awt.Toolkit.wndSetVisible (Toolkit.java)
~   at java.awt.Window.show (Window.java:376)
~   at M.main (M.java:8)

The compiler is jikes, kaffe is the newest version from CVS as I
mentioned. The full output of the working program is:

- --------------------------------------------------------------------
benja at joy:/tmp$ javac M.java && java -cp . M
tlkProperties
qapp initialization.

tlkInit Done.
tlkGetScreenWidth
tlkGetScreenHeight
tlkGetResolution
Native AWT ---->evtInit
tlkVersion
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Monospaced
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntGetFixedWidth 0
Native AWT ---->fntIsWideFont
tlkDisplayBanner

SET VISIBLE
wndCreateFrame
Native AWT ---->createFrame( 0x82c5964, 4,24,-8,-28,..) -> 0x86253b8
wndSetResizable
Native AWT ---->setResizable: 0x86253b8, 1, 4,24,1,1
wndSetTitle
Native AWT ---->registerSource: mw=0x86253b8 idx=41
Native AWT ---->registerSource( 0x86253b8) -> 41
Native AWT ---->setVisible: 86253b8 (41) 1
Native AWT ---->Event Move: srcIdx=41
Native AWT ---->Event Resize: srcIdx=41
Native AWT ---->Event Show: srcIdx=41
Native AWT ---->Event Paint: srcIdx=41
Native AWT ---->processing Move Event SrcIdx=41
Native AWT ---->Event Resize: srcIdx=41
Native AWT ---->Event Move: srcIdx=41
Native AWT ---->Event Paint: srcIdx=41
Native AWT ---->Event MouseButton: srcIdx=41
Native AWT ---->processing Resize Event SrcIdx=41
END SET VISIBLE

Native AWT ---->processing Paint Event SrcIdx=41
Native AWT ---->initGraphics: gr (nil) (tgt 0x86253b8, type=0) xo -4,yo
- -24  4,24 - 1,1  0x861a200 ff000000 ffc0c0c0
Native AWT ---->painter=862c888
Native AWT ---->clearRect: 0x8635fd0, 4,24-1,1
Native AWT ---->processing Resize Event SrcIdx=41
Native AWT ---->processing Move Event SrcIdx=41
Native AWT ---->processing Paint Event SrcIdx=41
Native AWT ---->initGraphics: gr 0x8635fd0 (tgt 0x86253b8, type=0) xo
- -4,yo -24  4,24 - 849,572  0x861a200 ff000000 ffc0c0c0
Native AWT ---->painter=862c9c0
Native AWT ---->clearRect: 0x8635fd0, 4,24-849,572
Native AWT ---->processing MouseMove Event SrcIdx=41
Native AWT ---->setCursor: 86253b8, 0
Native AWT ---->Event Key: srcIdx=41
Native AWT ---->processing KeyPress: SrcIdx=41
Native AWT ---->KeyEvent: idx=41 keyCode=0 keyChar= mod=0
Native AWT ---->Event Key: srcIdx=41
Native AWT ---->processing KeyRelease: SrcIdx=41
Native AWT ---->KeyEvent: idx=41 keyCode=0 keyChar= mod=0
Native AWT ---->Event Key: srcIdx=41
Native AWT ---->processing KeyPress: SrcIdx=41
Native AWT ---->KeyEvent: idx=41 keyCode=0 keyChar= mod=0
Native AWT ---->Event Hid: srcIdx=41
Native AWT ---->Event MouseButton: srcIdx=41
Native AWT ---->processing MouseMove Event SrcIdx=41
- --------------------------------------------------------------------

(I hit Ctrl-C here)

The full output of the non-working program is:

- --------------------------------------------------------------------
benja at joy:/tmp$ javac M.java && java -cp . M
tlkProperties
qapp initialization.

tlkInit Done.
tlkGetScreenWidth
tlkGetScreenHeight
tlkGetResolution
Native AWT ---->evtInit
tlkVersion
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Monospaced
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntInitFont...Default
Native AWT ---->fntGetFixedWidth 0
Native AWT ---->fntIsWideFont
tlkDisplayBanner

SET VISIBLE
wndCreateFrame
Native AWT ---->createFrame( 0x82c493c, 4,24,-8,-28,..) -> 0x86253b8
wndSetResizable
Native AWT ---->setResizable: 0x86253b8, 1, 4,24,1,1
wndSetTitle
Native AWT ---->registerSource: mw=0x86253b8 idx=41
Native AWT ---->registerSource( 0x86253b8) -> 41
Native AWT ---->setVisible: 86253b8 (41) 1
Native AWT ---->Event Move: srcIdx=41
Native AWT ---->Event Resize: srcIdx=41
Native AWT ---->processing Move Event SrcIdx=41
Native AWT ---->processing Resize Event SrcIdx=41
java.lang.NullPointerException
~   at java.awt.Toolkit.wndSetVisible (Toolkit.java)
~   at java.awt.Window.show (Window.java:376)
~   at M.main (M.java:8)
- --------------------------------------------------------------------

Please, does anybody have an idea what's going on?

Thanks,
- - Benja
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA7Fy9UvR5J6wSKPMRAkzkAJ9QfB+gs4bRquYh8pDAvSRzHbMtUACfQhdP
lzxPuxGgRBblQWhwgxquQpI=
=zRqD
-----END PGP SIGNATURE-----




More information about the kaffe mailing list