[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#268991: gcj-3.4: simple program segfaults



Package: gcj-3.4
Version: 3.4.1-4sarge1
Severity: important


gcj-3.4 --main=hecl hecl.java 
@ashland [~/workshop/hecl] $ ./a.out 
Segmentation fault (core dumped)

Maybe there is a bug in my code...
import java.io.*;

public class hecl {

    public static void main(String [] args) {
    StringBuffer input = new StringBuffer();
    FileInputStream fin;
    int c = 0;
    try {
        fin = new FileInputStream(args[0]);
	    DataInputStream in = new DataInputStream(fin);
	        while ((c = in.read()) != -1)
		      input.append((char)c);

		      } catch (Exception e) {
		          System.err.println ("Error reading from
		          file" + e);
			  }

			  System.out.println("Input is: " + input);
    }

}

but it seems to work elsewhere (on i386/unstable).

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.6
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages gcj-3.4 depends on:
ii  g++-3.4                  3.4.1-4sarge1   The GNU C++ compiler
ii  gcc-3.4-base             3.4.1-4sarge1   The GNU Compiler Collection (base 
ii  java-common              0.22            Base of all Java packages
ii  libc6                    2.3.2.ds1-13    GNU C Library: Shared libraries an
ii  libgcc1                  1:3.4.1-4sarge1 GCC support library
ii  libgcj5-common           3.4.1-4sarge1   Java runtime library for use with 
ii  zlib1g                   1:1.2.1.1-5     compression library - runtime

-- no debconf information



Reply to: