[Bug libgcj/30937] Win32: Process.exitValue() does not work after multiple calls to a terminated process

2007-02-23 Thread r_ovidius at eml dot cc


--- Comment #1 from r_ovidius at eml dot cc  2007-02-23 20:53 ---
Also seems to affect process.destroy() somehow.  The "DONE" is not printed
after the destroy call on gcj win32, but is on Sun.




public class ProcTest {

  static Process process;

  public static void main(String[] args) {
try {
  String bat = "exitcode.bat";
  PrintStream p = new PrintStream(new FileOutputStream(bat));
  p.println("@exit 5");
  p.close();

  process = Runtime.getRuntime().exec(bat);

  try {
int wf = process.waitFor();
System.err.println(wf);
  } catch (InterruptedException e) {
  }

  try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
  } catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
  }

  try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
  } catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
  }

  process.destroy();

  System.err.println("DONE");

} catch (Exception e) {
  e.printStackTrace();
}

  }

}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30937



[Bug libgcj/30937] New: Win32: Process.exitValue() does not work after multiple calls to a terminated process

2007-02-23 Thread r_ovidius at eml dot cc
After calling process.waitFor(), or calling process.exitValue() multiple times
on a process that has exited, the process returns
"java.lang.IllegalThreadStateException: Process has not exited" even though it
has.  Sun's java, and gcj on linux does not have this problem.


Result on SUN win32:
5
EV: 5 [EMAIL PROTECTED]
EV: 5 [EMAIL PROTECTED]

Result on GCJ 4.2 Win:  (probably 4.3 as well since it doesn't look changed in
viewcvs):

5
X: java.lang.IllegalThreadStateException: Process has not exited
X: java.lang.IllegalThreadStateException: Process has not exited


Snippet: 

import java.io.FileOutputStream;
import java.io.PrintStream;

public class ProcTest {

  static Process process;

  public static void main(String[] args) {
try {
  String bat = "exitcode.bat";
  PrintStream p = new PrintStream(new FileOutputStream(bat));
  p.println("@exit 5");
  p.close();

  process = Runtime.getRuntime().exec(bat);

  try {
int wf = process.waitFor();
System.err.println(wf);
  } catch (InterruptedException e) {
  }

  try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
  } catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
  }

  try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
  } catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
  }

} catch (Exception e) {
  e.printStackTrace();
}

  }

}


-- 
   Summary: Win32: Process.exitValue() does not work after multiple
calls to a terminated process
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30937



[Bug libgcj/18266] GCJ: Using references drops finalizers causing all apps to eventually crash ( SIGSEGV in GC_register_finalizer_inner () )

2006-11-03 Thread r_ovidius at eml dot cc


--- Comment #15 from r_ovidius at eml dot cc  2006-11-03 22:58 ---
Updated summary.  (Happy 2 year birthday, stupid stubborn bug.)


-- 

r_ovidius at eml dot cc changed:

   What|Removed |Added

Summary|SIGSEGV in  |GCJ: Using references drops
   |GC_register_finalizer_inner |finalizers causing all apps
   |()  |to eventually crash  (
   ||SIGSEGV in
   ||GC_register_finalizer_inner
   ||() )


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18266



[Bug java/27908] VMSecureRandom generateSeed infinite loop? (Regression)

2006-06-06 Thread r_ovidius at eml dot cc


--- Comment #11 from r_ovidius at eml dot cc  2006-06-07 03:16 ---
Alright, but, it seems strange that code that worked 2 months ago is suddenly
broken due to a bug filed 6 years ago.  The "Regression" status of this
particular situation and this particular code seems to get lost when calling it
a dupe.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27908



[Bug libgcj/27908] VMSecureRandom generateSeed infinite loop? (Regression)

2006-06-06 Thread r_ovidius at eml dot cc


--- Comment #4 from r_ovidius at eml dot cc  2006-06-06 20:20 ---
Linux RH9 2.4.20 450Mhz
WinXP 2Ghz

I removed the call to VMSecureRandom from SecureRandom and just return length
at the moment, and everything works again.  The usage of /dev/random did work
as well, but binaries would not be portable if target systems don't have it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27908



[Bug libgcj/27797] win32.cc: FormatMessage fails on win98 for network messages

2006-06-06 Thread r_ovidius at eml dot cc


--- Comment #4 from r_ovidius at eml dot cc  2006-06-06 18:03 ---
After reading more from http://tangentsoft.net/wskfaq/newbie.html [2.7], it
seems MESSAGE_FROM_MODULE won't really work. A lookup table would be needed
like in http://tangentsoft.net/wskfaq/examples/basics/ws-util.cpp for win98. 
But, the patch above still works for the time being to avoid the segfault.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27797



[Bug libgcj/27908] New: VMSecureRandom generateSeed infinite loop? (Regression)

2006-06-05 Thread r_ovidius at eml dot cc
gcc version 4.2.0 20060605 (experimental)

I'm trying to run jsch (jcraft.com) with the examples/PortForwardingR.java and
id_dsa identity.  It worked before the most recent classpath import (works in
gcj 20060420), but now it just results in an infinite loop and a pegged cpu.

My guess is that it spins forever in the SecureRandom call to
VMSecureRandom.generateSeed.  This class didn't exist in 20060420 but jsch
worked fine.

I'm not sure if it is classpath or bad code generation in gcj causing the
infinite loop.

This testcase pegs the cpu.  Works fine with Sun's java.
---
import java.security.*;
public class GR {
  public static void main(String[] a) {
SecureRandom sr = new SecureRandom();
byte[] ba = sr.getSeed(5);
System.err.println(ba);
  } 
}


-- 
   Summary: VMSecureRandom generateSeed infinite loop? (Regression)
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: critical
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27908



[Bug libgcj/27892] gij.cc:104: error: 'setenv' was not declared in this scope

2006-06-05 Thread r_ovidius at eml dot cc


--- Comment #3 from r_ovidius at eml dot cc  2006-06-05 19:14 ---
Same on mingw.


-- 

r_ovidius at eml dot cc changed:

   What|Removed |Added

 CC||r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27892



[Bug libgcj/27797] win32.cc: FormatMessage fails on win98 for network messages

2006-06-05 Thread r_ovidius at eml dot cc


--- Comment #3 from r_ovidius at eml dot cc  2006-06-05 14:46 ---
The intent was to stop my app from segfaulting. :) I'm not sure what you are
getting at...

FormatMessage fails when looking up nErrorCode, since Win98 doesn't have error
messages in FORMAT_MESSAGE_FROM_SYSTEM for network messages.

The second call just does the FormatMessage on GetLastError() which is no
longer nErrorCode, but will be 317 "Message not found" due to the previous
failed call, which will be a valid MESSAGE_FROM_SYSTEM.  You could try a bunch
of other FormatMessage calls on nErrorCode with MESSAGE_FROM_HANDLE instead of
FROM_SYSTEM and try to use the ModuleHandle of wininet.dll or whatever dll and
see if that works if that is what you mean.  I haven't tried those yet since
I'm still fighting with other gcj problems.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27797



[Bug libgcj/27797] New: win32.cc: FormatMessage fails on win98 for network messages

2006-05-29 Thread r_ovidius at eml dot cc
gcj 4.2 trunk

FormatMessage (with MESSAGE_FROM_SYSTEM flag) doesn't work on network messages
on win98. This causes lpMsgBuf to be null, and will cause a seg fault later.

Example code: 
new Socket("127.0.0.1", ); 
(or some host/port that denies the connection).

I believe that one could explicitely try to use MESSAGE_FROM_HANDLE and
GetModuleHandle("wininet.dll") in the FORMATMESSAGE call. A quicker option was
to get the inevitable 317 (ERROR_MR_MID_NOT_FOUND) from a followup
GetLastError() call and fill the lpMsgBuf with that which is what I did to make
it work for me.

Index: win32.cc
===
--- win32.cc  (revision 114200)
+++ win32.cc  (working copy)
@@ -193,7 +193,7 @@
 FORMAT_MESSAGE_FROM_SYSTEM |
 FORMAT_MESSAGE_IGNORE_INSERTS;

-  FormatMessage (dwFlags,
+  DWORD fRet = FormatMessage (dwFlags,
 NULL,
 (DWORD) nErrorCode,
 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
@@ -201,6 +201,17 @@
 0,
 NULL);

+  if (!fRet) 
+{
+  fRet = FormatMessage (dwFlags,
+  NULL,
+  (DWORD) GetLastError(),
+  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+  (LPTSTR) &lpMsgBuf,
+  0,
+  NULL);
+}
+
   jstring ret;
   if (lpszPrologue)
 {


-- 
   Summary: win32.cc: FormatMessage fails on win98 for network
messages
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27797



[Bug bootstrap/27251] [4.2 Regression] undefined reference to `vec_assert_fail' with --disable-checking

2006-05-20 Thread r_ovidius at eml dot cc


--- Comment #4 from r_ovidius at eml dot cc  2006-05-20 19:53 ---
The build was a crossed-native.  A cross compiler (linux->mingw) was building a
mingw native compiler.

build=i686-pc-linux-gnu
host=i686-pc-mingw32
target=i686-pc-mingw32


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27251



[Bug bootstrap/27251] New: undefined reference to `vec_assert_fail' with --disable-checking

2006-04-21 Thread r_ovidius at eml dot cc
I receive the following when trying to build gcc using --disable-checking. 

gcc (GCC) 4.2.0 20060421 (experimental)

gcc -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -s -o build/genextract \
build/genextract.o build/rtl.o build/read-rtl.o build/ggc-none.o
build/min-insn-modes.o build/gensupport.o build/pri
nt-rtl.o build/errors.o build/vec.o
../build-i686-pc-linux-gnu/libiberty/libiberty.a
build/genextract.o(.text+0x370): In function `gen_insn':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x46b): In function `VEC_safe_set_locstr':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x6e3): In function `walk_rtx':
: undefined reference to `vec_assert_fail'
collect2: ld returned 1 exit status
make[2]: *** [build/genextract] Error 1





After quickly looking into it, here is my initial theory:

1. 
build=i686-pc-linux-gnu
host=i686-pc-mingw32
target=i686-pc-mingw32

2. 
configure with --disable-checking

3.
from gcc/configure:

# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
# If host=build, it is correct to have bconfig include auto-host.h
# as well.  If host!=build, we are in error and need to do more
# work to find out the build config parameters.
if test x$host = x$build
then
  build_auto=auto-host.h
else
  # We create a subdir, then run autoconf in the subdir.
  # To prevent recursion we set host and build for the new
  # invocation of configure to the build for this invocation
  # of configure.
  tempdir=build.$$
  rm -rf $tempdir
  mkdir $tempdir
  cd $tempdir
  case ${srcdir} in
  /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
  *) realsrcdir=../${srcdir};;
  esac
  saved_CFLAGS="${CFLAGS}"
  CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
  ${realsrcdir}/configure \
--enable-languages=${enable_languages-all} \
--target=$target_alias --host=$build_alias --build=$build_alias
  CFLAGS="${saved_CFLAGS}"

  # We just finished tests for the build machine, so rename
  # the file auto-build.h in the gcc directory.
  mv auto-host.h ../auto-build.h
  cd ..
  rm -rf $tempdir
  build_auto=auto-build.h
fi 

4. 
This creates an auto-build.h with enable_checking 1

#ifndef USED_FOR_TARGET
#define ENABLE_CHECKING 1 
#endif

5.  
bconfig.h includes it

#ifndef GCC_BCONFIG_H
#define GCC_BCONFIG_H
#include "auto-build.h"
#ifdef IN_GCC
# include "ansidecl.h"
#endif
#endif /* GCC_BCONFIG_H */

6. 
gcc/genextract.c is compiled with checking since it includes "bconfig.h"
it also includes "vec.h", and consequently vec_assert_fail

gcc -c -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -I. -Ibuild -I/home/gcc/gcc/gcc
-I/home/gcc/gcc/gcc/build -I/home/gcc/gcc/gcc/../include
-I/home/gcc/gcc/gcc/../libcpp/include  -I/home/gcc/gcc/gcc/../libdecnumber
-I../libdecnumber-o build/genextract.o /home/gcc/gcc/gcc/genextract.c

7. 
gcc/vec.c is compiled without checking, so it will not define vec_assert_fail:

gcc -c -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -I. -Ibuild -I/home/gcc/gcc/gcc
-I/home/gcc/gcc/gcc/build -I/home/gcc/gcc/gcc/../include
-I/home/gcc/gcc/gcc/../libcpp/include  -I/home/gcc/gcc/gcc/../libdecnumber
-I../libdecnumber-o build/vec.o /home/gcc/gcc/gcc/vec.c

8. 
vec_assert_fail isn't defined. 

gcc -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -s -o build/genextract \
build/genextract.o build/rtl.o build/read-rtl.o build/ggc-none.o
build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/errors.o
build/vec.o ../build-i686-pc-linux-gnu/libiberty/libiberty.a
build/genextract.o(.text+0x370): In function `gen_insn':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x46b): In function `VEC_safe_set_locstr':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x6e3): In function `walk_rtx':
: undefined reference to `vec_assert_fail'
collect2: ld returned 1 exit status
make[2]: *** [build/genextract] Error 1


-- 
   Summary: undefined reference to `vec_assert_fail' with --disable-
checking
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27251



[Bug crypto/27228] java.security.InvalidAlgorithmParameterException

2006-04-20 Thread r_ovidius at eml dot cc


--- Comment #6 from r_ovidius at eml dot cc  2006-04-21 05:02 ---
One of the first things I tried was to remove the instanceof check and see what
would happen, but it just lead to another exception (I don't recall what it
was).  


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27228



[Bug libgcj/27231] New: java.lang.StringIndexOutOfBoundsException in HTTPURLConnection.connect

2006-04-20 Thread r_ovidius at eml dot cc
Works in Sun's java.  Doesn't work with gcj, with or without the trailing "/"
on the url.

gcj (GCC) 4.2.0 20060419 (experimental)

gcj -o Htest --main=Htest Htest.java
./Htest
Exception in thread "main" java.lang.StringIndexOutOfBoundsException
   at java.lang.String.substring (libgcj.so.7)
   at gnu.java.net.protocol.http.HTTPURLConnection.connect (libgcj.so.7)
   at gnu.java.net.protocol.http.HTTPURLConnection.getInputStream (libgcj.so.7)
   at java.net.URL.openStream (libgcj.so.7)
   at Htest.main (Htest)



---

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;

public class Htest { 

public static void main(String[] a) {
String urlString = "http://microsoft.com/";;  // w or w/o trailing "/"
URL url = null;

try {
  url = new URL(urlString);
} catch (MalformedURLException e) {
  e.printStackTrace();
}
try {
  BufferedReader b = new BufferedReader(new
InputStreamReader(url.openStream()));

  StringBuffer sb = new StringBuffer();
  String string;
  while ((string = b.readLine()) != null)
sb.append(string);

  b.close();

  System.err.println(sb.toString());

} catch (IOException e) {
  e.printStackTrace();
}
  }

}


-- 
   Summary: java.lang.StringIndexOutOfBoundsException in
HTTPURLConnection.connect
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27231



[Bug libgcj/27228] New: java.security.InvalidAlgorithmParameterException

2006-04-20 Thread r_ovidius at eml dot cc
Originally from jsch (jcraft.com)

com/jcraft/jsch/jce/DH.java  
getE()

This function works in Sun's java, but on libgcj it fails.  Here is a
standalone sample that works in Sun's java:

(I believe this used to work with gnu.crypto)


gcj (GCC) 4.2.0 20060419 (experimental)
gcj --main=Sec -o Sec Sec.java
./Sec

java.security.InvalidAlgorithmParameterException: params
   at gnu.javax.crypto.jce.sig.DHKeyPairGeneratorSpi.initialize (libgcj.so.7)
   at java.security.KeyPairGenerator.initialize (libgcj.so.7)
   at Sec.main (Sec)

=
public class Sec {

  private static KeyPairGenerator myKpairGen;
  private static KeyAgreement myKeyAgree;
  private static BigInteger p;
  private static BigInteger g;
  private static BigInteger e; // my public key
  private static byte[] e_array;

  public static void main(String[] args) {
try {
  myKpairGen = KeyPairGenerator.getInstance("DH");
  myKeyAgree = KeyAgreement.getInstance("DH");

  p = new
BigInteger("179769313486231590770839156793787453197860296048756011706236841971802161585193689478337958649255415021805654
859805036464405481992391000507928770033558166392295531362390765087357599148225748625750074253020774477125895509579377784244424266173347276
29299387668709205606050270810842907692932019128194467627007");
  g = new BigInteger("2");

  DHParameterSpec dhSkipParamSpec = new DHParameterSpec(p, g);
  myKpairGen.initialize(dhSkipParamSpec);
  KeyPair myKpair = myKpairGen.generateKeyPair();
  myKeyAgree.init(myKpair.getPrivate());
  //  BigInteger
x=((javax.crypto.interfaces.DHPrivateKey)(myKpair.getPrivate())).getX();
  byte[] myPubKeyEnc = myKpair.getPublic().getEncoded();

  System.err.println(myPubKeyEnc);

  e = ((javax.crypto.interfaces.DHPublicKey) (myKpair.getPublic())).getY();
  e_array = e.toByteArray();
} catch (Exception e) {
  e.printStackTrace();
}
  }

}


-- 
   Summary: java.security.InvalidAlgorithmParameterException
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27228



[Bug classpath/27163] FTP directory listing doesn't work

2006-04-20 Thread r_ovidius at eml dot cc


--- Comment #3 from r_ovidius at eml dot cc  2006-04-20 17:20 ---
Try with 

String url = "ftp://gcc.gnu.org";;

(notice the missing "/" at the end).  This results in

gnu.java.net.protocol.ftp.FTPException: Invalid number of arguments.
   at gnu.java.net.protocol.ftp.FTPConnection.changeWorkingDirectory
(libgcj.so.7)
   at gnu.java.net.protocol.ftp.FTPURLConnection.getInputStream (libgcj.so.7)
   at java.net.URL.openStream (libgcj.so.7)

with gcj (GCC) 4.2.0 20060419 (experimental).

Further, the "while (file.ready())" never seems to return false in Sun's java,
while it does with gcj, so I'd wager on the "obscure bug".


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163



[Bug libgcj/27163] New: FTP directory listing doesn't work

2006-04-14 Thread r_ovidius at eml dot cc
GCJ 4.1.0

The following prints the ftp directory list when using Sun's java.  With gcj it
does not.  

(The first url (microsoft) prints nothing, the second (gcc.gnu.org) results in

gnu.java.net.protocol.ftp.FTPException: Invalid number of arguments.
   at gnu.java.net.protocol.ftp.FTPConnection.changeWorkingDirectory
(libgcj.so.7)
   at gnu.java.net.protocol.ftp.FTPURLConnection.getInputStream (libgcj.so.7)
   at java.net.URL.openStream (libgcj.so.7)
   at Ftest.main (Ftest)

)


---

import java.net.*;
import java.util.*;
import java.io.*;

public class Ftest {

 public static void main(String[] args) {
String url = "ftp://ftp.microsoft.com/ResKit/y2kfix/";;
// String url = ftp://gcc.gnu.org/";;

try {
  InputStream input = (new URL(url)).openStream();
  BufferedReader file = new BufferedReader(new InputStreamReader(input));
  System.err.println("START");
  while (file.ready()) {
String line = file.readLine();
System.err.println(">" + line + "<");
  }
  System.err.println("DONE");

} catch (Exception e) {
  e.printStackTrace();
}

  }

}


-- 
   Summary: FTP directory listing doesn't work
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
    AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27163



[Bug libgcj/25593] Socket problems

2006-03-07 Thread r_ovidius at eml dot cc


--- Comment #3 from r_ovidius at eml dot cc  2006-03-08 04:56 ---
Yes, I just compiled 4.1 on linux and the testcase works there.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25593