[Bug 120] New: Serialization/Deserialization hangs

[email protected] Tue, 22 Mar 2005 14:07:45 -0500
Newsgroups gmane.comp.java.vm.sablevm.bugs
Message-ID <[email protected]>
http://sablevm.org/bugs/show_bug.cgi?id=120

           Summary: Serialization/Deserialization hangs
           Product: SableVM
           Version: 1.11.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]


With the following testcase, sablevm seems to enter an infinite loop while
deserializing the user class. 


import java.io.*;

public class Ser
{
  static class Foo implements Serializable {}

  static Object serializeThenDeserialize(Object obj)
  {
    try {
      ByteArrayOutputStream outb = new ByteArrayOutputStream();
      ObjectOutputStream outs = new ObjectOutputStream(outb);
      outs.writeObject(obj);
      byte[] store = outb.toByteArray();

      InputStream inb = new ByteArrayInputStream(store);
      ObjectInputStream ins = new ObjectInputStream(inb);
      return ins.readObject();
    }
    catch (Exception e) {
      return null;
    }
  }

  public static void main(String[] args)
  {
    System.out.println(serializeThenDeserialize(new Foo()));
  }
}



Output with a forced stack trace dump:

$ sablevm Ser
WARNING: could not properly read security provider files:
        
file:///usr/lib/sablevm-classpath/sablevm-classpath/security/SableVM.security
        
file:///usr/lib/sablevm-classpath/sablevm-classpath/security/classpath.security
         Falling back to standard GNU security provider
--- stack trace dump (begin) ---
Thread ID: 1, Posix ID: 1076093056
(StringCreator.java:-1)  java/lang/StringCreator.createString
(internal frame)
(Throwable.java:-1)  java/lang/Throwable.nativeGetStackTraceList  n
(Throwable.java:510)  java/lang/Throwable.fillInStackTrace
(Throwable.java:165)  java/lang/Throwable.<init>
(Exception.java:78)  java/lang/Exception.<init>
(RuntimeException.java:76)  java/lang/RuntimeException.<init>
(NullPointerException.java:80)  java/lang/NullPointerException.<init>
(internal frame)
(ObjectInputStream.java:-1)  java/io/ObjectInputStream.allocateObject  n
(ObjectInputStream.java:1841)  java/io/ObjectInputStream.newObject
(ObjectInputStream.java:308)  java/io/ObjectInputStream.readObject
(Ser.java:17)  Ser.serializeThenDeserialize
(Ser.java:26)  Ser.main
(internal frame)
(VirtualMachine.java:-1)  java/lang/VirtualMachine.invokeMain  n
(VirtualMachine.java:108)  java/lang/VirtualMachine.main
(internal frame)
--- stack trace dump (end) ---

SableVM version 1.11.1
- compile date and time: 2005-03-21 03:56:38 UTC
- gcc version: 3.3.5 (Debian 1:3.3.5-12)
- 'real life brokenness' features enabled
- signal based exception detection
- copying garbage collection
- bidirectional object layout
- inline-threaded interpreter



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.