[Insight-users] Odd java wrappers behavior

Brian Eastwood beastwoo at email.unc.edu
Thu May 27 17:06:46 EDT 2004


Hi there,

I have the Java wrappings for ITK working now--thanks a lot, Luis.  I've 
run accross a problem in multiple instances where I'm getting errors 
from the native code and my program is crashing.  Below is a very short 
code example that shows why this is odd. 

I have a List of itkTransform22 objects, and the function 
TransformIO.printTransforms() just writes the parameters of each 
transform to standard out.  Normally I would be  instantiating a number 
of ITK objects, but in the code below I've commented out the 
instantiation and set all objects to null.

        reader = null; // itkImageFileReaderUS2.itkImageFileReaderUS2_New();
        caster = null; // 
itkCastImageFilterUS2F2.itkCastImageFilterUS2F2_New();
        rescaler = null; // 
itkRescaleIntensityImageFilterF2US2.itkRescaleIntensityImageFilterF2US2_New();
        writer = null; // itkImageFileWriterUS2.itkImageFileWriterUS2_New();
       
        TransformIO.printTranforms(transforms);
        if (true) return; // just to exit the method...for testing

This code executes fine, but if I uncomment one or two of the 
instantiations, I get the error shown below from within the print 
method, sometimes after a number of transforms have printed.  Could the 
memory references to the C++ objects be getting messed up when too many 
objects are instantiated?  Have I just misconfigured something?

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_PRIV_INSTRUCTION (0xc0000096) occurred at 
PC=0x2E50312
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:
    at 
InsightToolkit.ITKRigidTransformsJNI.itkCenteredRigid2DTransform_GetParameters(Native 
Method)
    at 
InsightToolkit.itkCenteredRigid2DTransform.GetParameters(itkCenteredRigid2DTransform.java:54)
    at 
edu.unc.cs.nano.registration.TransformIO.printTransform(TransformIO.java:130)
    at 
edu.unc.cs.nano.registration.TransformIO.printTranforms(TransformIO.java:145)
    at 
edu.unc.cs.nano.registration.RegistrationOutput.createImages(RegistrationOutput.java:88)
    at 
edu.unc.cs.nano.registration.RegistrationOutputTest.main(RegistrationOutputTest.java:67)

Dynamic libraries:
0x00400000 - 0x00407000     C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
0x77F50000 - 0x77FF7000     C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000     C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5D000     C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78087000     C:\WINDOWS\system32\RPCRT4.dll
0x77D40000 - 0x77DCC000     C:\WINDOWS\system32\USER32.dll
0x7E090000 - 0x7E0D1000     C:\WINDOWS\system32\GDI32.dll
0x77C10000 - 0x77C63000     C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08138000     C:\Program 
Files\Java\j2re1.4.2_03\bin\client\jvm.dll
0x76B40000 - 0x76B6C000     C:\WINDOWS\System32\WINMM.dll
0x10000000 - 0x10007000     C:\Program Files\Java\j2re1.4.2_03\bin\hpi.dll
0x00820000 - 0x0082E000     C:\Program 
Files\Java\j2re1.4.2_03\bin\verify.dll
0x00830000 - 0x00849000     C:\Program Files\Java\j2re1.4.2_03\bin\java.dll
0x00850000 - 0x0085D000     C:\Program Files\Java\j2re1.4.2_03\bin\zip.dll
0x02E40000 - 0x02E48000     C:\ITKCVS.NET\bin\release\SwigRuntimeJava.dll
0x7C000000 - 0x7C054000     C:\WINDOWS\System32\MSVCR70.dll
0x02E60000 - 0x0308E000     C:\ITKCVS.NET\bin\release\VXLNumericsJava.dll
0x7C080000 - 0x7C0F7000     C:\WINDOWS\System32\MSVCP70.dll
0x03090000 - 0x03A92000     C:\ITKCVS.NET\bin\release\ITKCommonJava.dll
0x03AA0000 - 0x03B15000     C:\ITKCVS.NET\bin\Release\ITKCommon.dll
0x03B20000 - 0x03BD8000     C:\ITKCVS.NET\bin\release\ITKNumericsJava.dll
0x03BE0000 - 0x04AB2000     
C:\ITKCVS.NET\bin\release\ITKBasicFiltersAJava.dll
0x04AC0000 - 0x0536F000     
C:\ITKCVS.NET\bin\release\ITKBasicFiltersBJava.dll
0x05370000 - 0x05779000     C:\ITKCVS.NET\bin\release\ITKIOJava.dll
0x76C90000 - 0x76CB2000     C:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58D000     C:\WINDOWS\system32\DBGHELP.dll
0x77C00000 - 0x77C07000     C:\WINDOWS\system32\VERSION.dll
0x76BF0000 - 0x76BFB000     C:\WINDOWS\System32\PSAPI.DLL

Heap at VM Abort:
Heap
 def new generation   total 576K, used 12K [0x10010000, 0x100b0000, 
0x104f0000)
  eden space 512K,   0% used [0x10010000, 0x10010890, 0x10090000)
  from space 64K,  16% used [0x10090000, 0x100929a8, 0x100a0000)
  to   space 64K,   0% used [0x100a0000, 0x100a0000, 0x100b0000)
 tenured generation   total 1408K, used 112K [0x104f0000, 0x10650000, 
0x14010000)
   the space 1408K,   8% used [0x104f0000, 0x1050c328, 0x1050c400, 
0x10650000)
 compacting perm gen  total 4096K, used 1823K [0x14010000, 0x14410000, 
0x18010000)
   the space 4096K,  44% used [0x14010000, 0x141d7ed0, 0x141d8000, 
0x14410000)

Local Time = Thu May 27 16:45:16 2004
Elapsed Time = 1
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
#
# An error report file has been saved as hs_err_pid3820.log.
# Please refer to the file for further information.
#



More information about the Insight-users mailing list