Skip to main content

JIT crashes VM on WM 6.1

4 replies [Last post]
davyp
Offline
Joined: 2007-01-03

Hi,

I am having a problem with JIT on Windows Mobile 6.1. I run the test
application from testclasses.zip, and about halfway through the test, the VM
crashes. If I disable the JIT with -Xjit:compile=none, the test application and
other ones run fine.

I have compiled the CDC profile with various compilers and with various SDKs
(WinCE 4.2, WinCE 5.0, WM2003, WM5 and WM6) and the binaries run fine
on each of these platforms, but they all have the same problem when I run the
VM on Windows Mobile 6.1.

I am no expert in JIT and have no idea how to debug this. Could someone with
more experience give some advice?

Thanks,
Davy

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
davyp
Offline
Joined: 2007-01-03

Replying to myself,

I was able to resolve the issue myself by not allowing the code cache to
reside in a read/write/execute segment of the executable. The fix itself was as
simple as setting WINCE_DISABLE_STATIC_CODECACHE to true.

Davy

cjplummer
Offline
Joined: 2006-10-16

The downside of using WINCE_DISABLE_STATIC_CODECACHE=true is that it results in disabling trap-based null checks. This means the JIT needs to generate inline null checks rather than just letting null referenced cause a segv, and letting the segv handler make sure an NPE is thrown. On WinCE you can't have a segv handler in allocated memory, but on some variants you also can't execute out of the static code cache that is linked with cvm.

Disabling trap-based null checks hurts performance in very loopy microbenchmarks by 10% to 20%. However, you probably won't notice the difference in anything that does graphics.

davyp
Offline
Joined: 2007-01-03

Thanks for the explanation. The comments in the configuration file already gave a small hint
what effect setting property would have. Given the performance penalty, is there perhaps a
better way to fix this OS specific problem?

Thanks,
Davy

cjplummer
Offline
Joined: 2006-10-16

None that we know of. We need to be able to catch segvs (exceptions on win32?) in order to handle trap-based NPEs. It was discovered that you can only do this with code executing as part of the cvm binary, even if it was a static data section that we write JIT'd code into. However, we then found that on some Win32 platforms you can't execute code out of the static data section. There probably is a way to get this to work, but we haven't figured it out yet.