This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: JNI on ARM/XScale
- From: Andrew Haley <aph at redhat dot com>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: Jari Korva <jpkorva at iki dot fi>, java at gcc dot gnu dot org
- Date: Wed, 6 Oct 2004 15:26:24 +0100
- Subject: Re: JNI on ARM/XScale
- References: <Pine.GSO.4.58.0409161036260.8826@paju.oulu.fi><41583439.10701@redhat.com><Pine.GSO.4.58.0409301619430.28882@paju.oulu.fi><415C2B80.2040803@redhat.com><Pine.GSO.4.58.0410061342120.22689@paju.oulu.fi><4163FFD5.3020306@redhat.com>
Bryce McKinlay writes:
> Jari Korva wrote:
>
> >On Thu, 30 Sep 2004, Bryce McKinlay wrote:
> >
> >
> >>Hmm, so if you printf() lib_name immediately before and after the
> >>JvSynchronize(), it prints the correct value before the call and
> >>corrupted afterwards? If so, that sounds like a C++ compiler bug, as a
> >>value on the stack is somehow being overwritten.
> >>
> >>You could try building natRuntime.cc with -O0 to confirm this theory.
> >>
> >>
> >
> >Thanks again! I removed -O2 from libjava/Makefile, touched natRuntime.cc
> >and ran make again. Then I rebuild my JNI-HelloWorld - and it really
> >worked!
> >
> >
>
> It'd be interesting to know if you can still reproduce this with the
> latest code from CVS. If so, then it would be worth trying to isolate a
> small test case and reporting a compiler bug.
Indeed.
> Andrew Haley wrote:
>
> > > I also tried printfs instead of debugger on -O2 optimized binary. That
> > > way, it seems that the value is corrupted already before JvSynchronize.
> > > The trace and modified source are below (the most bizarre thing is that it
> > > jumps directly from trace 3-1 to 4).
> >
> >There's nothing weird about that: all it means is that you're getting
> >an ArrayIndexOutOfBoundsException. This is Bad.
> >
> >
>
> ... but probably "normal" if stack traces are not working correctly on
> this version/target?
Well, that depends on what " not working correctly" means. It might
mean something very bad like wandering off into never-never land, or
something quite harmeless.
Andrew.