User account creation filtered due to spam.

Bug 33789 - gij crashes when sending serialized objects through a pipe
Summary: gij crashes when sending serialized objects through a pipe
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-16 01:17 UTC by Robert Schiele
Modified: 2016-09-30 22:50 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schiele 2007-10-16 01:17:51 UTC
I can crash gij when I read multiple serialized objects (type does not matter) from a PipedInputStream.  You can reproduce the bug with the following small example:

public class Test {
    public static void main(String[] args) throws Throwable {
        java.io.PipedOutputStream mout = new java.io.PipedOutputStream();
        new Reader(new java.io.PipedInputStream(mout)).start();
        java.io.ObjectOutputStream os = new java.io.ObjectOutputStream(mout);
        for (int i = 0; i < 1000; ++i)
            os.writeObject(new Integer(1));
    }

    static class Reader extends Thread {
        java.io.PipedInputStream pin;
        Reader(java.io.PipedInputStream in) {
            pin = in;
        }
        public void run() {
            try {
                java.io.ObjectInputStream  is =
                    new java.io.ObjectInputStream(pin);
                for (int i = 0; i < 1000; ++i)
                    is.readObject();
            } catch (Exception t) {
                System.err.println("Exception: " + t);
                System.exit(1);
            }
        }
    }
}

It does not matter whether you compile this with gcj or the Sun Java compiler thus the compiler is obviously not the problem.

Running this in gij with

gij Test

leads to a random exception.  Running the same code in the Sun JVM does not cause any problems.

This is tested with the current SVN tree (trunk revision 129368) and with several released versions as shipped with various Linux distributions (tested on Redhat/Fedora and SUSE).
Comment 1 Andrew Pinski 2016-09-30 22:50:42 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.