harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject Re: [M3] NPE is thrown while debugging with M3
Date Wed, 10 Oct 2007 22:58:00 GMT
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]
> 
> 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


Mime
View raw message