Solved

JVM crash on XML parsing

Posted on 2004-08-20
14
711 Views
Last Modified: 2008-03-06
Hello Experts,

I'm in real trouble. The JVM is crashing in a XML parsing after app had loaded two dll JNI wrappers. It just happen when both wrapper classes  are loaded what makes me believe in some memory invasion in the dll. But it works fine in test mode. Im test mode I load both wrappers and call it methods. The weird point is that one wrapper encapsulates XFS that uses a vendor api, and the other one want to use the vendor API directly.

I tryed to upgrade from 1.4.2_03 to 1.4.2_05 but the problem persist. I tryed almost all that I can figure out. Some idea?

=============================================================================================
StateMachine::init - begin
StateMachine::initDevices - begin
ObDev::Constructor::Device ID [7] -> class com.hp.oba.obdev.ObWosaXFS
ObDev::Connect::Device ID [7]
ObDev::SetErrorCode::Device ID [7] -> 0
ObDev::Connect::Device ID[7] succeed
ObDev::Constructor::Device ID [6] -> class com.hp.oba.obdev.ObWosaXFS
ObDev::Connect::Device ID [6]
ObDev::SetErrorCode::Device ID [6] -> 0
ObDev::Connect::Device ID[6] succeed
ObDev::GetCaps::Device ID [6]
ObDev::Constructor::Device ID [8] -> class com.hp.oba.obdev.ObPertoAPI
ObDev::Connect::Device ID [8]
[<?xml version="1.0" encoding="UTF-8"?><java version="1.0" class="java.beans.XMLDecoder"><object class="com.hp.oba.obdev.ObDevResult"><void property="errorCode"><int>0</int></void></object></java>]
ObDev::SetErrorCode::Device ID [8] -> 0
ObDev::Connect::Device ID[8] succeed
StateMachine::initDevices - end
StateMachine::initTransactions - begin
ScreenFlowManager() - begin
ScreenFlowManager() - end
RequestProcessor() - begin
RequestProcessor() - end
DeviceManager() - begin
DeviceManager() - end
TemplateService() - begin
TemplateService::initScreens - begin
Screens::loadScreenDefinitions - begin
ScreenDefinition::loadDocument - begin
1. ScreenDefinitions.xml
2.
3.
4.
5.

Unexpected Signal : EXCEPTION_FLT_STACK_CHECK (0xc0000092) occurred at PC=0xA4D212
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:

Dynamic libraries:
0x00400000 - 0x0040B000       C:\Arquivos de programas\Java\j2re1.4.2_05\bin\javaw.exe
0x78460000 - 0x784E1000       C:\WINNT\system32\ntdll.dll
0x792D0000 - 0x79332000       C:\WINNT\system32\ADVAPI32.dll
0x79720000 - 0x797DF000       C:\WINNT\system32\KERNEL32.DLL
0x77120000 - 0x77191000       C:\WINNT\system32\RPCRT4.DLL
0x77E10000 - 0x77E75000       C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7E000       C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78045000       C:\WINNT\system32\MSVCRT.dll
0x08000000 - 0x08139000       C:\Arquivos de programas\Java\j2re1.4.2_05\bin\client\jvm.dll
0x77550000 - 0x77581000       C:\WINNT\system32\WINMM.dll
0x10000000 - 0x10007000       C:\Arquivos de programas\Java\j2re1.4.2_05\bin\hpi.dll
0x007E0000 - 0x007EE000       C:\Arquivos de programas\Java\j2re1.4.2_05\bin\verify.dll
0x007F0000 - 0x00809000       C:\Arquivos de programas\Java\j2re1.4.2_05\bin\java.dll
0x00810000 - 0x0081D000       C:\Arquivos de programas\Java\j2re1.4.2_05\bin\zip.dll
0x18270000 - 0x182B4000       C:\WINNT\ObWosaXFS.dll
0x182C0000 - 0x182E6000       C:\WINNT\system32\MSXFS.dll
0x18300000 - 0x18320000       C:\WINNT\system32\XFS_SUPP.DLL
0x18330000 - 0x1833B000       C:\WINNT\system32\XFS_CONF.DLL
0x6E390000 - 0x6E396000       C:\WINNT\system32\INDICDLL.dll
0x75E30000 - 0x75E4A000       C:\WINNT\system32\IMM32.dll
0x184B0000 - 0x184D6000       C:\WINNT\system32\PERTOSP.DLL
0x184E0000 - 0x18501000       C:\WINNT\system32\pertoapi.dll
0x18D60000 - 0x18D90000       C:\WINNT\system32\PTPINTACF.DLL
0x779B0000 - 0x77A4B000       C:\WINNT\system32\OLEAUT32.DLL
0x77A50000 - 0x77B47000       C:\WINNT\system32\ole32.dll
0x19340000 - 0x19374000       C:\WINNT\system32\PT623UB.DLL
0x196E0000 - 0x196F5000       C:\CEF\ClientJava\src\dev\ObPertoAPI\ObPertoAPI.dll
0x19B00000 - 0x19B30000       C:\WINNT\system32\PTSIUTACF.DLL
0x77920000 - 0x77943000       C:\WINNT\system32\imagehlp.dll
0x729B0000 - 0x729DD000       C:\WINNT\system32\DBGHELP.dll
0x68F90000 - 0x68F9B000       C:\WINNT\system32\PSAPI.DLL

Heap at VM Abort:
Heap
 def new generation   total 576K, used 251K [0x10010000, 0x100b0000, 0x104f0000)
  eden

****************
Another exception has been detected while we were handling last error.
Dumping information about last error:
ERROR REPORT FILE = (N/A)
PC                = 0x00a4d212
SIGNAL            = -1073741678
FUNCTION NAME     = (N/A)
OFFSET            = 0xFFFFFFFF
LIBRARY NAME      = (N/A)
Please check ERROR REPORT FILE for further information, if there is any.
Good bye.

==============================================================================================================



    public static Element loadDocument(String filename) {
          System.out.println("ScreenDefinition::loadDocument - begin");
        try
        {
              System.out.println("1. " + filename );
            FileInputStream file = new FileInputStream(filename);
              System.out.println("2.");
            InputSource xmlInp = new InputSource(new BufferedInputStream(file));
              System.out.println("3.");
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
              System.out.println("4.");
            DocumentBuilder parser = docBuilderFactory.newDocumentBuilder();
              System.out.println("5.");
            Document doc = parser.parse(xmlInp);

==================================================================================================================

package      dev;


public class VendorAPIWrapperA implements IObWosaXFS {
   
      static VendorAPIWrapperA self = null;
      
    private VendorAPIWrapperA () {
        System.loadLibrary("VendorAPIWrapperA");
          self = this;
    }
   
    static public VendorAPIWrapperA getInstance() {
          if( self == null ) {
                new VendorAPIWrapperA();
          }
          return self;
    }
   
    public native boolean IsStarted();
   
    public native String Connect(int piDeviceType, ObDev poObDev);
    public native String Disconnect(int piDeviceType);
   
    public native String SiuGetInfo(int piDeviceType);    
    public native String SiuGetCaps(int piDeviceType);    
    public native boolean SiuSetLockDoor(int piDeviceType, int piDoor, boolean pbLock);
    public native boolean SiuGetLockDoor(int piDeviceType, int piDoor);
   
   
}

=================================================================================================================

public class SpecifivDevice extends Device {

    private static Device SpecificDevice;
    private boolean isAvailable = false;
   
    public final static String DEVICE_NAME = "SIU";
   
    public SpecifivDevice {
        super(Device.CD_SIU, VendorAPIWrapperA.getInstance() );
        SpecifivDevice = this;
        this.Connect();
        if SpecificDevice;!= null) {
            //getCaps();
        }
    }
0
Comment
Question by:rubentrancoso
14 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 11855842
> Please check ERROR REPORT FILE for further information, if there is any.

Does that file give any clues?

Regards
0
 

Author Comment

by:rubentrancoso
ID: 11855854
there's no file. Just the same log generated in crash.
---
Unexpected Signal : EXCEPTION_FLT_STACK_CHECK (0xc0000092) occurred at PC=0xA4D212
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:

Dynamic libraries:
0x00400000 - 0x0040B000      C:\Arquivos de programas\Java\j2re1.4.2_05\bin\javaw.exe
0x78460000 - 0x784E1000      C:\WINNT\system32\ntdll.dll
0x792D0000 - 0x79332000      C:\WINNT\system32\ADVAPI32.dll
0x79720000 - 0x797DF000      C:\WINNT\system32\KERNEL32.DLL
0x77120000 - 0x77191000      C:\WINNT\system32\RPCRT4
(...)
0
 
LVL 35

Expert Comment

by:girionis
ID: 11855894
These are nasty error because they occur outside the jvm. Can you try your application on a different computer and/or different java version?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:girionis
ID: 11855911
Also, do you use any drivers to connect somewhere? If yes can you try upgrading?
0
 
LVL 35

Expert Comment

by:girionis
ID: 11855962
rubentrancoso,

> But it works fine in test mode.

can you elaborate a bit? How do you run it in a test mode (through some IDE)? There is obviously somethign there that does not cause it to fail? Does the test mode use less resources/calls to the application?
0
 

Author Comment

by:rubentrancoso
ID: 11855979
Unfortunatelly I dont's have another machine to test. The drivers are supplied by the vendor and it is already working in a vb context. But, yes. I ill try to reinstall this drivers and make a test with JVM 1.5.

0
 

Author Comment

by:rubentrancoso
ID: 11856037
No, in test mode I just use a frame with tabs to each device and preload and connect all devices. The main difference from test to app is that the main process occour in a separated thread lauched by the main class that at it finish is lauched again.

In test mode I use to load 3 devices from a type of dll and 1 from the other. All devices uses a singleton that is the JNI wrapper.\

As I know when you do a loadlibrary you load a dll. But I dont know exactly what is happen here since the first driver loads xfs that uses the vendor api I need in the second one.
0
 
LVL 35

Accepted Solution

by:
girionis earned 350 total points
ID: 11856106
What I suggest

1) Try to upgrade drivers
2) try it on another installation of jvm and another computer
3) make sure that you use/have installed third-party dll according to the documentation provided.

These errors are nasty because they occur outside the jvm you can never be sure what exactly caused them :(
0
 
LVL 21

Assisted Solution

by:MogalManic
MogalManic earned 50 total points
ID: 11858903
It could be a threading issue.  Try syncronizing the getInstance() method and/or the loadDocument() method.
0
 
LVL 7

Assisted Solution

by:JugglerW
JugglerW earned 100 total points
ID: 11860719
The problem is absolutley sure outside the VM.
This type of crash occurs only with faulty JNI bindings (I know this from own experience :-) )
From your posted code the followoing native methods are candidates for the error.
Perhaps you can try them one after the other to get nearer to the error?
If you have not written the JNI code yourself you should contact the vendor of the library and send them the error report:

    public native boolean IsStarted();
   
    public native String Connect(int piDeviceType, ObDev poObDev);
    public native String Disconnect(int piDeviceType);
   
    public native String SiuGetInfo(int piDeviceType);    
    public native String SiuGetCaps(int piDeviceType);    
    public native boolean SiuSetLockDoor(int piDeviceType, int piDoor, boolean pbLock);
    public native boolean SiuGetLockDoor(int piDeviceType, int piDoor);
0
 

Author Comment

by:rubentrancoso
ID: 11884028
The problem was temporaly solved but in a weird way. Thanks for the comments. I just put the line that invoke initdevices after the one that invoke the xml parsing. Ouch! I don't know why but now it works, but I think its unsafe. I will try to change the way XML is parsed to see if it is the problem like a coworker sugested, but it dont prove nothing.
I will still waiting for comments.
Thanks.
Ruben
0
 
LVL 35

Expert Comment

by:girionis
ID: 11884099
Keep us posted of any progression :)
0
 

Author Comment

by:rubentrancoso
ID: 11915373
Some news.
The upper layer of XFS driver isn't safe. You canot call any function without a sucessfull connect cause it receive structures and probably deal with nonallocated memory space causing this crash. To solve this I just used a flag ( boolean isConnected ) and just call commands when it is true. For now it is in respect a problems whit a specific device and not correspond in fact to the first condition of error. Next step will be rollback the first workaround to see if the problem was solved at all.
0
 
LVL 35

Expert Comment

by:girionis
ID: 12009407
:)
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
check java version using powershell 13 282
ejb wildfly example 2 70
String array comparison 4 45
Strange router problem - can't access hotmail.com 14 35
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question