harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject Re: [M3] NPE is thrown while debugging with M3
Date Wed, 10 Oct 2007 12:15:33 GMT
Hi Gregory,

The stack trace is not shown in the console, but debugger is terminated
abnormally.

It looks like the following code in AbstractInterruptibleChannel causes the
problem:
static initialization:

static {
        try {
            setInterruptAction = AccessController
                    .doPrivileged(new PrivilegedExceptionAction<Method>() {
                        public Method run() throws Exception {
                            return Thread.class.getDeclaredMethod(
                                    "setInterruptAction", //$NON-NLS-1$
                                    new Class[] { Runnable.class });

                        }
                    });
            setInterruptAction.setAccessible(true);
        } catch (Exception e) {
            // FIXME: be accommodate before VM actually provides
            // setInterruptAction method
            // throw new Error(e);
        }
    }

setInterruptAction is null here. And when vm tries to instantiate a NPE
object, this block of code is invoked repeatedly. I have no idea why the
method is not available.
Anything I apparently misconfigured?  Any clue?

Thanks!

On 10/10/07, Gregory Shimansky <gshimansky@gmail.com> wrote:
>
> Andrew Zhang wrote:
> > On 10/10/07, Tim Ellison <t.p.ellison@gmail.com> wrote:
> >> Gregory Shimansky wrote:
> >>> Andrew Zhang wrote:
> >>>> Hi all,
> >>>>
> >>>> I meet a problem when debugging java application with M3. It throws
> NPE
> >>>> immediately after pressing F5/F6. Here's simple test:
> >>>>
> >>>> public static void main(String[] args) {
> >>>>         int count = 100;
> >>>>         for(int i = 0; i < count; ++i) {
> >>>>             System.out.println(i); // put a breakpoint here.
> >>>>         }
> >>>>     }
> >>>>
> >>>> It looks like a serious bug. It's reproducible here, with Eclipse
> 3.2.2
> >> .
> >>>> Thanks!
> >>> I tried both M3 JDK snapshot for libstdc++.so.6 and current local
> debug
> >>> development build of harmony, I couldn't reproduce this. Could you
> >>> please give more details which platform you are using and how you are
> >>> running this test? How does NPE stack trace look like?
> >
> >
> > Hi,
> >
> > Here are some more details:
> >
> > NPE stack trace:
> >
> > Thread [main] (Suspended)
> >     NullPointerException.<init>() line: 34
> >     AbstractInterruptibleChannel.<clinit>() line: 57 [local variables
> > unavailable]
>
> Hmm. This isn't exactly what I wanted to see. I just wanted to see the
> NPE stack trace that a program would print out when it throws an
> uncaught NPE in main(). It is quite strange for me to see that you've
> somehow stepped into AbstractInterruptibleChannel. There is no main()
> function on the bottom of the stack either...
>
> I tried debugging on windows with M3 build and current development debug
> build and still I don't get any NPEs. When I press F5 on line with
> println, for the 1st time it steps into VM.intern, for other times it
> steps into PrintStream.println. Sources for these classes aren't found,
> but I can step out back to main() function.
>
> > Platform information:
> >
> > JRE: harmony-jre-580985
> >
> > Eclipse: Version: 3.2.2 Build id: M20070212-1330
> >
> > OS: Microsoft Windows Server 2003 R2 Standard Edition Service Pack 1
> > (Running on a VM)
> >
> > The way to debug the application: Debug As -> Debug ..., select Harmony
> as
> > the JRE and put a breakpoint at any line. The program halts at the
> specified
> > breakpoint as expected, but if you press F5 or F6, it throws the NPE.
> Any
> > idea?
> >
> > It doesn't have any problem to run the application against Harmony.
> >
> > Thanks!
> >
> > Works for me too on Windows M3 JDK build with Eclipse 3.3.
> >> Andrew: Could you give us the precise steps to reproduce?
> >>
> >> Regards,
> >> Tim
> >>
> >>
> >>
> >
> >
>
>
> --
> Gregory
>
>


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message