AOL Instant Messenger

Pavel Roskin pavel_roskin at geocities.com
Thu Mar 25 02:50:37 PST 1999


Hello!

I tried to find out what happens with

AOL Instant Messenger (TM) version 1.1.19 for Java built 03/24/98

under the current CVS snapshot of Kaffe. Here are my results.

AIM calls java.awt.Component.createImage( int width, int height ):

        at java.awt.Image.<init>(Image.java:95)
        at java.awt.Component.createImage(Component.java:300)
        at component.LabelButton.makeLabelImage(LabelButton.java:213)
        at component.LabelButton.makeButtonImages(LabelButton.java:254)
        at component.LabelButton.addNotify(LabelButton.java:128)
        at java.awt.Container.addNotify(Container.java:152)
        at java.awt.Container.addNotify(Container.java:152)
        at java.awt.Window.addNotify(Window.java:82)
        at main.LoginUI.addNotify(LoginUI.java:189)
        at java.awt.Window.pack(Window.java:189)
        at main.LoginUI.<init>(LoginUI.java:105)
        at main.LoginCore.<init>(LoginCore.java:146)
        at main.Oscar.main(Oscar.java:276)

This calls java.awt.Image ( int w, int h ).
This constructor works normally, but it doesn't set this.producer.

Soon after that AIM calls java.awt.image.PixelGrabber.PixelGrabber( Image
img, int x, int y, int w, int h, int[] pels, int off, int scan)

        at java.awt.image.PixelGrabber.<init>(PixelGrabber.java:35)
        at uiutil.ImageStore.makeTransparent(ImageStore.java:539)
        at component.LabelButton.makeLabelImage(LabelButton.java:247)
        at component.LabelButton.makeButtonImages(LabelButton.java:254)
        at component.LabelButton.addNotify(LabelButton.java:128)
        at java.awt.Container.addNotify(Container.java:152)
        at java.awt.Container.addNotify(Container.java:152)
        at java.awt.Window.addNotify(Window.java:82)
        at main.LoginUI.addNotify(LoginUI.java:189)
        at java.awt.Window.pack(Window.java:189)
        at main.LoginUI.<init>(LoginUI.java:105)
        at main.LoginCore.<init>(LoginCore.java:146)
        at main.Oscar.main(Oscar.java:276)

with that very Image. This constructor calls another constructor and sends
img.getSource(), which is null, because getSource() returns this.producer.

Now there is an object java.awt.image.PixelGrabber with producer = null.
Finally, AIM calls java.awt.image.PixelGrabber.grabPixels() which calls
java.awt.image.PixelGrabber.startGrabbing(). This method calls
producer.startProduction( this), and crashes because producer = null.

java.lang.NullPointerException
        at java.awt.image.PixelGrabber.startGrabbing(PixelGrabber.java:200)
        at java.awt.image.PixelGrabber.grabPixels(PixelGrabber.java:106)
        at uiutil.ImageStore.makeTransparent(ImageStore.java:543)
        at component.LabelButton.makeLabelImage(LabelButton.java:247)
        at component.LabelButton.makeButtonImages(LabelButton.java:254)
        at component.LabelButton.addNotify(LabelButton.java:128)
        at java.awt.Container.addNotify(Container.java:152)
        at java.awt.Container.addNotify(Container.java:152)
        at java.awt.Window.addNotify(Window.java:82)
        at main.LoginUI.addNotify(LoginUI.java:189)
        at java.awt.Window.pack(Window.java:189)
        at main.LoginUI.<init>(LoginUI.java:105)
        at main.LoginCore.<init>(LoginCore.java:146)
        at main.Oscar.main(Oscar.java:276)

I tried many workarounds, and the most successful was following:

=== cut here ===
--- PixelGrabber.java.v0        Wed Sep  2 23:39:03 1998
+++ PixelGrabber.java   Thu Mar 25 13:42:07 1999
@@ -102,7 +102,7 @@
 }
 
 public boolean grabPixels () throws InterruptedException {
-       if ( ! active)
+       if ( ! active & (producer != null))
                startGrabbing();
                
        // has to be a loop because this may be notified from outside   
=== cut here ===

After this patch AIM shows its window (without pictures), asks my
password, but it doesn't authenticate me.

Best wishes,
Pavel Roskin



More information about the kaffe mailing list