How to diagnose Java JNI EXCEPTION_ACCESS_VIOLATION errors in Windows Vista

前端 未结 2 1024
醉酒成梦
醉酒成梦 2021-02-10 03:39

We have a Java application that uses some C++ libraries through JNI. The application used to work just fine in Windows XP, but it does not work in Windows Vista, it just crashes

相关标签:
2条回答
  • 2021-02-10 04:19

    Try setting up WinDBG, and hook up a symbol server, so you can get symbols for the OS DLLs.

    • WinDBG

    • Symbols (bottom of the page)

    Then run your Java app under WinDBG and trap the crash there. With any luck you should be able to find your native code in the call stack, or at least something you can recognize.

    0 讨论(0)
  • 2021-02-10 04:37

    Perhaps your problem is mixing c runtime libraries because you updated your C compiler? I see in your stack dump both msvcr71.dll and msvcrt.dll. According to this Microsoft Library

    If your DLLs pass CRT resources across the msvcrt.dll and msvcr71.dll boundary, you will encounter issues with mismatched CRTs and need to recompile your project

    The implication seems to be that JNI extensions should use the same compiler/runtime as used to build the jre, but I can't find any reference to say that is so. I'd welcome another answer telling my why I am wrong and how I can get around the same problem myself.

    0 讨论(0)
提交回复
热议问题