Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Error on Exit in IE when Using Java Serialization


View products that this article applies to.

This article was previously published under Q189063

↑ Back to the top


Symptoms

A complex serialization scheme when used from Internet Explorer causes Internet Explorer to stop when exiting. Internet Explorer stops with a dialog box that reports:
Iexplore.exe - Application Error

The instruction at "0xSomeAddr" referenced memory at "0xOthrAddr". The memory could not be "read".

↑ Back to the top


Status

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in the Virtual Machine for Java distributed with Internet Explorer 4.01 Service Pack 1 and later.

↑ Back to the top


More information

Steps to Reproduce Behavior

1.Save this Java source to a file named Test2.java:
      import java.applet.*;
      import java.awt.*;
      import java.io.*;

      // this applet builds a serialized object which has the minimum
      // required complexity to reproduce a bug in IE 4.0x

      public class test2 extends Applet

      {
         Panel panel = new Panel();
         Button load = new Button("           ");

         public void init()
         {

            add(panel);
            panel.setLayout(new FlowLayout());
            panel.add(load);
            try
            {
               serial();
            }
            catch (Exception x)
            {
               System.out.println("Exception: " + x.getMessage());
            }
         }

         private void serial() throws IOException, ClassNotFoundException
         {
            ByteArrayOutputStream biff = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream(biff);
            out.writeObject(new level0());
            out.flush();
            out.close();
            byte[] temp = biff.toByteArray();
            ByteArrayInputStream joe = new ByteArrayInputStream(temp);
            ObjectInputStream in = new ObjectInputStream(joe);
            level0 obj = (level0)in.readObject();
            in.close();
            load.setLabel(obj.name);
         }
      }

      abstract class base
      implements java.io.Serializable
      {}

      class level0 extends base
      implements java.io.Serializable
      {
         level1 x = new level1();
         public String name = "Can exit";
      }

      class level1
      implements java.io.Serializable
      {
         level2 x = new level2();
      }

      class level2
      implements java.io.Serializable
      {
         level3 x = new level3();
      }

      class level3
      implements java.io.Serializable
      {}
						
2.Compile the file.
3.Run the class "test2" as an applet in Internet Explorer 4.0x.
4.When you see the button with the label "Can exit," exit Internet Explorer.
5.The dialog box will appear telling you that IExplore.exe has an error.
NOTE: When running Internet Explorer 4.0x with Active Desktop installed, this bug may cause either instability in the desktop, or your machine may hang or stop on exit (logoff, restart, or shutdown).

↑ Back to the top


Keywords: kbbug, kbfix, KB189063

↑ Back to the top

Article Info
Article ID : 189063
Revision : 3
Created on : 12/1/2003
Published on : 12/1/2003
Exists online : False
Views : 346