This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hang when printing exception


Hi,

On Mon, 2003-03-17 at 18:56, Andrew Haley wrote:
> Tom Tromey writes:
>  > Backing out this change removes the problem.  So this is definitely
>  > it.  I'm going to write a small test showing the bug.

Yes, that is what I am also seeing. My stack traces work again! Yeah.

> I haven't seen the failure you describe.  If you will create a test
> case I'll investigate.

The attached program does work correctly (prints [i: 1, j: 2, k: 3])
with the latest change gjavah.c reverted. But produces incorrect results
otherwise:

  $ gcj -C TC.java
  $ gcjh TC
  $ gcj --main=TC TC.class natTC.cc
  $ ./a.out
  [i: 4294967296, j: 0, k: 2]

Cheers,

Mark
public class TC
{
  long i;
  int j, k;

  TC()
  {
    init();
  }

  native void init();

  public String toString()
  {
    return "[i: " + i +", j: " + j + ", k: " + k + "]";
  }

  public static void main(String[] args)
  {
    System.out.println(new TC());
  }
}
#include "TC.h"

void
TC::init()
{
  i = 1;
  j = 2;
  k = 3;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]