You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Andrew Zhang <zh...@gmail.com> on 2007/10/09 16:55:40 UTC

[M3] NPE is thrown while debugging with M3

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!

-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Re: [M3] NPE is thrown while debugging with M3

Posted by Gregory Shimansky <gs...@apache.org>.
Tim Ellison wrote:
> Gregory Shimansky wrote:
>> Tim Ellison wrote:
>>> Andrew Zhang wrote:
>>>> On 10/11/07, Tim Ellison <t....@gmail.com> wrote:
>>>>> Is that something we need to add to a technical FAQ?
>>>> yeah, I think it would be really helpful!
>>> There is a (short) technical FAQ in this page:
>>>   https://svn.apache.org/repos/asf/harmony/standard/site/xdocs/faq.xml
>>>
>>> Perhaps you could add in the symptoms and instructions for disabling the
>>> NX bit?
>> Is this text ok for FAQ?
>>
>> The symptom seems to be unexpected NPEs in the code that doesn't produce
>> any when not debugged. This is a limitation of M3 build. Hopefully it
>> will be fixed in M4.
> 
> Hmm, well if it will be fixed in M4 perhaps it should go into the M3
> release notes as a known issue rather than as a permanent technical FAQ.

In fact I think I've fixed this bug in revision 584204. Andrew, could 
you please try to run this version of DRLVM? I added functions to 
allocate memory with specified permissions and now JVMTI buffer for 
handling breakpoints should have execute permission on it.

>> On Linux ia32 NX bit is usually disabled because enabling it requires
>> CONFIG_X86_PAE that is needed to address over 4Gb of memory, and to turn
>> it on it is necessary to specify "noexec=on" on kernel command line.
>>
>> On Linux x86_64 NX bit is enabled by default, so if one tries to run
>> DRLVM debugger in x86 emulation mode it is better to specify
>> "noexec=off" on kernel command line.
>>
>> On Windows x86 NX bit is controlled with a /noexecute switch to kernel
>> command line in X:\boot.ini (X is boot drive letter) file. Usually it is
>> set as /noexecute=optin that disables execution of kernel but allows
>> execution of user level programs heap. For more details see [1]
>>
>> [1] http://www.microsoft.com/technet/sysinternals/information/bootini.mspx
>>
> 


-- 
Gregory


Re: [M3] NPE is thrown while debugging with M3

Posted by Tim Ellison <t....@gmail.com>.
Gregory Shimansky wrote:
> Tim Ellison wrote:
>> Andrew Zhang wrote:
>>> On 10/11/07, Tim Ellison <t....@gmail.com> wrote:
>>>> Is that something we need to add to a technical FAQ?
>>>
>>> yeah, I think it would be really helpful!
>>
>> There is a (short) technical FAQ in this page:
>>   https://svn.apache.org/repos/asf/harmony/standard/site/xdocs/faq.xml
>>
>> Perhaps you could add in the symptoms and instructions for disabling the
>> NX bit?
> 
> Is this text ok for FAQ?
> 
> The symptom seems to be unexpected NPEs in the code that doesn't produce
> any when not debugged. This is a limitation of M3 build. Hopefully it
> will be fixed in M4.

Hmm, well if it will be fixed in M4 perhaps it should go into the M3
release notes as a known issue rather than as a permanent technical FAQ.

Regards,
Tim

> On Linux ia32 NX bit is usually disabled because enabling it requires
> CONFIG_X86_PAE that is needed to address over 4Gb of memory, and to turn
> it on it is necessary to specify "noexec=on" on kernel command line.
> 
> On Linux x86_64 NX bit is enabled by default, so if one tries to run
> DRLVM debugger in x86 emulation mode it is better to specify
> "noexec=off" on kernel command line.
> 
> On Windows x86 NX bit is controlled with a /noexecute switch to kernel
> command line in X:\boot.ini (X is boot drive letter) file. Usually it is
> set as /noexecute=optin that disables execution of kernel but allows
> execution of user level programs heap. For more details see [1]
> 
> [1] http://www.microsoft.com/technet/sysinternals/information/bootini.mspx
> 

Re: [M3] NPE is thrown while debugging with M3

Posted by Gregory Shimansky <gs...@gmail.com>.
Tim Ellison wrote:
> Andrew Zhang wrote:
>> On 10/11/07, Tim Ellison <t....@gmail.com> wrote:
>>> Is that something we need to add to a technical FAQ?
>>
>> yeah, I think it would be really helpful!
> 
> There is a (short) technical FAQ in this page:
>   https://svn.apache.org/repos/asf/harmony/standard/site/xdocs/faq.xml
> 
> Perhaps you could add in the symptoms and instructions for disabling the
> NX bit?

Is this text ok for FAQ?

The symptom seems to be unexpected NPEs in the code that doesn't produce 
any when not debugged. This is a limitation of M3 build. Hopefully it 
will be fixed in M4.

On Linux ia32 NX bit is usually disabled because enabling it requires 
CONFIG_X86_PAE that is needed to address over 4Gb of memory, and to turn 
it on it is necessary to specify "noexec=on" on kernel command line.

On Linux x86_64 NX bit is enabled by default, so if one tries to run 
DRLVM debugger in x86 emulation mode it is better to specify 
"noexec=off" on kernel command line.

On Windows x86 NX bit is controlled with a /noexecute switch to kernel 
command line in X:\boot.ini (X is boot drive letter) file. Usually it is 
set as /noexecute=optin that disables execution of kernel but allows 
execution of user level programs heap. For more details see [1]

[1] http://www.microsoft.com/technet/sysinternals/information/bootini.mspx

-- 
Gregory


Re: [M3] NPE is thrown while debugging with M3

Posted by Tim Ellison <t....@gmail.com>.
Andrew Zhang wrote:
> On 10/11/07, Tim Ellison <t....@gmail.com> wrote:
>> Is that something we need to add to a technical FAQ?
> 
> 
> yeah, I think it would be really helpful!

There is a (short) technical FAQ in this page:
  https://svn.apache.org/repos/asf/harmony/standard/site/xdocs/faq.xml

Perhaps you could add in the symptoms and instructions for disabling the
NX bit?

Thanks,
Tim



Re: [M3] NPE is thrown while debugging with M3

Posted by Andrew Zhang <zh...@gmail.com>.
On 10/11/07, Tim Ellison <t....@gmail.com> wrote:
>
>
>
> Andrew Zhang wrote:
> > On 10/11/07, Gregory Shimansky <gs...@gmail.com> wrote:
> >> Andrew Zhang wrote:
> <snip>
> >>> Here are some more details:
> >>>
> >>> NPE stack trace:
> >>>
> >>> Thread [main] (Suspended)
> >>>     NullPointerException.<init>() line: 34
> >>>     AbstractInterruptibleChannel.<clinit>() line: 57 [local variables
> >>> unavailable]
> >>>
> >>> 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)
> >> Hello Andrew
> >>
> >> I've just thought about one thing. Modern processors have NX bit that
> >> protects heap from execution. Modern operating systems can enable it so
> >> that execution of heap results in page fault.
>
> wow - that's a clever piece of intuition!
>
> >> JVMTI breakpoints use bits of heap to execute instruction under
> >> breakpoint, and since on usual ia32 platforms it works ok (as NX bit is
> >> disabled by default), protection is not removed currently from these
> >> heap regions. I've just found this out trying to port JVMTI code to
> >> x86_64 where operating systems enable NX bit by default. This is
> >> something I'm going to fix now.
> >>
> >> But if you have NX bit enabled as on your server, it may result in page
> >> fault while executing an instrumented instruction. Page fault in java
> >> code is treated as NPE by DRLVM.
> >>
> >> So I wonder, do you have by a change enabled Execution Disable Bit
> (NX)?
> >> I think windows 2003 server has such capability.
> >
> >
> > Super, thanks Gregory and Tim!
> >
> > That's exactly the problem! Everything goes well after disabling NX.
>
> Don't thank me, I would never have thought of that!
>
> Is that something we need to add to a technical FAQ?


yeah, I think it would be really helpful!

Regards,
> Tim
>



-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Re: [M3] NPE is thrown while debugging with M3

Posted by Tim Ellison <t....@gmail.com>.

Andrew Zhang wrote:
> On 10/11/07, Gregory Shimansky <gs...@gmail.com> wrote:
>> Andrew Zhang wrote:
<snip>
>>> Here are some more details:
>>>
>>> NPE stack trace:
>>>
>>> Thread [main] (Suspended)
>>>     NullPointerException.<init>() line: 34
>>>     AbstractInterruptibleChannel.<clinit>() line: 57 [local variables
>>> unavailable]
>>>
>>> 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)
>> Hello Andrew
>>
>> I've just thought about one thing. Modern processors have NX bit that
>> protects heap from execution. Modern operating systems can enable it so
>> that execution of heap results in page fault.

wow - that's a clever piece of intuition!

>> JVMTI breakpoints use bits of heap to execute instruction under
>> breakpoint, and since on usual ia32 platforms it works ok (as NX bit is
>> disabled by default), protection is not removed currently from these
>> heap regions. I've just found this out trying to port JVMTI code to
>> x86_64 where operating systems enable NX bit by default. This is
>> something I'm going to fix now.
>>
>> But if you have NX bit enabled as on your server, it may result in page
>> fault while executing an instrumented instruction. Page fault in java
>> code is treated as NPE by DRLVM.
>>
>> So I wonder, do you have by a change enabled Execution Disable Bit (NX)?
>> I think windows 2003 server has such capability.
> 
> 
> Super, thanks Gregory and Tim!
> 
> That's exactly the problem! Everything goes well after disabling NX.

Don't thank me, I would never have thought of that!

Is that something we need to add to a technical FAQ?

Regards,
Tim

Re: [M3] NPE is thrown while debugging with M3

Posted by Andrew Zhang <zh...@gmail.com>.
On 10/11/07, Gregory Shimansky <gs...@gmail.com> wrote:
>
> Andrew Zhang wrote:
> > On 10/10/07, Tim Ellison <t....@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]
> >
> > 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)
>
> Hello Andrew
>
> I've just thought about one thing. Modern processors have NX bit that
> protects heap from execution. Modern operating systems can enable it so
> that execution of heap results in page fault.
>
> JVMTI breakpoints use bits of heap to execute instruction under
> breakpoint, and since on usual ia32 platforms it works ok (as NX bit is
> disabled by default), protection is not removed currently from these
> heap regions. I've just found this out trying to port JVMTI code to
> x86_64 where operating systems enable NX bit by default. This is
> something I'm going to fix now.
>
> But if you have NX bit enabled as on your server, it may result in page
> fault while executing an instrumented instruction. Page fault in java
> code is treated as NPE by DRLVM.
>
> So I wonder, do you have by a change enabled Execution Disable Bit (NX)?
> I think windows 2003 server has such capability.


Super, thanks Gregory and Tim!

That's exactly the problem! Everything goes well after disabling NX.

> 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/

Re: [M3] NPE is thrown while debugging with M3

Posted by Gregory Shimansky <gs...@gmail.com>.
Andrew Zhang wrote:
> On 10/10/07, Tim Ellison <t....@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]
> 
> 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)

Hello Andrew

I've just thought about one thing. Modern processors have NX bit that 
protects heap from execution. Modern operating systems can enable it so 
that execution of heap results in page fault.

JVMTI breakpoints use bits of heap to execute instruction under 
breakpoint, and since on usual ia32 platforms it works ok (as NX bit is 
disabled by default), protection is not removed currently from these 
heap regions. I've just found this out trying to port JVMTI code to 
x86_64 where operating systems enable NX bit by default. This is 
something I'm going to fix now.

But if you have NX bit enabled as on your server, it may result in page 
fault while executing an instrumented instruction. Page fault in java 
code is treated as NPE by DRLVM.

So I wonder, do you have by a change enabled Execution Disable Bit (NX)? 
I think windows 2003 server has such capability.

> 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


Re: [M3] NPE is thrown while debugging with M3

Posted by Andrew Zhang <zh...@gmail.com>.
On 10/10/07, Tim Ellison <t....@gmail.com> wrote:
>
> Andrew Zhang wrote:
> > It has nothing to do with System.out.println. I changed that statement
> to
> > "++i", the problem still exists. It seems Harmony(at least, nio
> part)  is
> > not successfully initialized. The first time of pressing F5 triggers the
> > problem.
>
> Understood, I'm just telling you what I see.
>
> Looking at your screenshot you are in the exception handler, so that
> should be dealing with the NPE, right?


Hi Tim,

yes. It's dealing with the NPE.

Do you have an exception breakpoint set in the debugger or any reason
> why that exception is invoking the debugger?


I didn't set exception breakpoint, but I set a breakpoint explicitly at the
beginning of the static initialization, and when it jumped to
catch(Exception e), I pressed F5 again. That's the screen snapshot. The more
I pressed F5, the more "AbstractInterruptibleChannel.<clinit>(): Line 57" is
shown in the stack trace.

The debugger terminates abnormally after pressing F6.

Regards,
> Tim
>



-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Re: [M3] NPE is thrown while debugging with M3

Posted by Tim Ellison <t....@gmail.com>.
Andrew Zhang wrote:
> It has nothing to do with System.out.println. I changed that statement to
> "++i", the problem still exists. It seems Harmony(at least, nio part)  is
> not successfully initialized. The first time of pressing F5 triggers the
> problem.

Understood, I'm just telling you what I see.

Looking at your screenshot you are in the exception handler, so that
should be dealing with the NPE, right?

Do you have an exception breakpoint set in the debugger or any reason
why that exception is invoking the debugger?

Regards,
Tim

Re: [M3] NPE is thrown while debugging with M3

Posted by Andrew Zhang <zh...@gmail.com>.
On 10/10/07, Tim Ellison <t....@gmail.com> wrote:
>
> Gregory Shimansky wrote:
> > Andrew Zhang wrote:
> >> On 10/10/07, Tim Ellison <t....@gmail.com> wrote:
> <snip>
> >>
> >> 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...
>
> Yes, can you give us the full stack Andrew?
>
> The AbstractInterruptibleChannel does try to get the setInterruptAction
> method on initialization, but it is guarded by an exception handler.
>
> > 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.
>
> I see the same as you Gregory with Eclipse 3.3 (I20070625-1500) and
> Eclipse 3.2.2 (M20070212-1330), Windows XP Pro 2002 SP2, and Harmony M3.
>
> After breaking on the println (line 6) and hitting F5 (Step into) I am
> suspended in VM.intern, like this
>
> AndrewTest at localhost:2963
>         Thread [main] (Suspended)
>                 VM.intern(String) line: not available
>                 AndrewTest.main(String[]) line: 6


Hi all,

It has nothing to do with System.out.println. I changed that statement to
"++i", the problem still exists. It seems Harmony(at least, nio part)  is
not successfully initialized. The first time of pressing F5 triggers the
problem.

Here's the screen snapshot:
http://picasaweb.google.com/zhanghuangzhu/AndrewZhangSBlog/photo#5119686975412844082


Regards,
> Tim
>
>


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Re: [M3] NPE is thrown while debugging with M3

Posted by Tim Ellison <t....@gmail.com>.
Gregory Shimansky wrote:
> Andrew Zhang wrote:
>> On 10/10/07, Tim Ellison <t....@gmail.com> wrote:
<snip>
>>
>> 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...

Yes, can you give us the full stack Andrew?

The AbstractInterruptibleChannel does try to get the setInterruptAction
method on initialization, but it is guarded by an exception handler.

> 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.

I see the same as you Gregory with Eclipse 3.3 (I20070625-1500) and
Eclipse 3.2.2 (M20070212-1330), Windows XP Pro 2002 SP2, and Harmony M3.

After breaking on the println (line 6) and hitting F5 (Step into) I am
suspended in VM.intern, like this

AndrewTest at localhost:2963	
	Thread [main] (Suspended)	
		VM.intern(String) line: not available	
		AndrewTest.main(String[]) line: 6	

Regards,
Tim


Re: [M3] NPE is thrown while debugging with M3

Posted by Andrew Zhang <zh...@gmail.com>.
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 <gs...@gmail.com> wrote:
>
> Andrew Zhang wrote:
> > On 10/10/07, Tim Ellison <t....@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/

Re: [M3] NPE is thrown while debugging with M3

Posted by Gregory Shimansky <gs...@gmail.com>.
Andrew Zhang wrote:
> On 10/10/07, Tim Ellison <t....@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


Re: [M3] NPE is thrown while debugging with M3

Posted by Andrew Zhang <zh...@gmail.com>.
On 10/10/07, Tim Ellison <t....@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]

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
>
>
>


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Re: [M3] NPE is thrown while debugging with M3

Posted by Tim Ellison <t....@gmail.com>.
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?

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



Re: [M3] NPE is thrown while debugging with M3

Posted by Gregory Shimansky <gs...@gmail.com>.
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?

-- 
Gregory