harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [M3] NPE is thrown while debugging with M3
Date Thu, 11 Oct 2007 07:36:27 GMT

Andrew Zhang wrote:
> On 10/11/07, Gregory Shimansky <gshimansky@gmail.com> wrote:
>> Andrew Zhang wrote:
>>> 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?


View raw message