[vtkusers] Problem with SetJavaArray()

Stefan Maas stefan.maas at fh-gelsenkirchen.de
Tue Nov 20 07:13:33 EST 2007


Hello,

in my application I got problems with big (DICOM-)datasets. I wrote my own
DICOMtoVTKReader based on the pixelmed library and need to build
vtkImageData from a java-array.

I do this:

...
unsignedShortArray.Initialize(); // unsignedShortArray is type
vtkUnsignedShortArray 
unsignedShortArray.SetJavaArray(imageDataAllSlices); // imageDataAllSlices
is type short[] and contains the whole DICOM-dataset
unsignedShortArray.SetName("DICOMArray");
imageData.GetPointData().SetScalars(unsignedShortArray); //imageData is type
vtkImageData
....
imageData.Update();


This works perfect for datasets up to approx. 300 slices. But for bigger
datasets my whole application crashes with that error:
-------------------------------------------------
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x48021ef6, pid=2340,
tid=3940
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode)
# Problematic frame:
# C  [vtkImaging.dll+0x101ef6]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x47177c00):  JavaThread "Thread-4" [_thread_in_native,
id=3940]

siginfo: ExceptionCode=0xc0000005, writing address 0x00000000

Registers:
EAX=0x609e041e, EBX=0x00000000, ECX=0x4e07f608, EDX=0x00000001
ESP=0x4e07f4f0, EBP=0x4e070455, ESI=0x4956efc4, EDI=0x00000001
EIP=0x48021ef6, EFLAGS=0x00010202

Top of Stack: (sp=0x4e07f4f0)
0x4e07f4f0:   00000000 4e07f5f0 48020d70 00000001
0x4e07f500:   4802fcf6 4e07f608 609e0020 00000001
0x4e07f510:   00000200 4956efc0 4b9da008 00000200
0x4e07f520:   4b9db010 609e0020 4b9dc018 4e07f5c0
0x4e07f530:   4b9d7138 4b9d8798 4e07f71c 00000000
0x4e07f540:   00000001 00000000 4956e6e8 00000001
0x4e07f550:   000001ff 00000000 00000000 4956f7c8
0x4e07f560:   00000000 00000000 4b9db010 4b9d8818 

Instructions: (pc=0x48021ef6)
0x48021ee6:   44 24 34 8d 04 50 83 c6 04 8b d7 8b 19 66 8b 28
0x48021ef6:   66 89 2b 8b 19 83 c3 02 83 c0 02 4a 89 19 75 eb 


Stack: [0x4e030000,0x4e080000),  sp=0x4e07f4f0,  free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
code)
C  [vtkImaging.dll+0x101ef6]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  vtk.vtkAlgorithm.Update_50()V+0
j  vtk.vtkAlgorithm.Update()V+1
j  com.project2.model.readers.DICOMImageReader.Update2()V+1988
j  com.project2.model.VisualMediJa$65.construct()Ljava/lang/Object;+71
j  com.project2.model.SwingWorker$2.run()V+8
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x47178400 JavaThread "Thread-5" [_thread_blocked, id=2692]
=>0x47177c00 JavaThread "Thread-4" [_thread_in_native, id=3940]
  0x472e6c00 JavaThread "Swing-Shell" daemon [_thread_blocked, id=2628]
  0x47172400 JavaThread "TimerQueue" daemon [_thread_blocked, id=444]
  0x00296400 JavaThread "DestroyJavaVM" [_thread_blocked, id=3272]
  0x47262400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=2456]
  0x47262000 JavaThread "AWT-Shutdown" [_thread_blocked, id=1384]
  0x471bac00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3500]
  0x471b8800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3556]
  0x46e5d000 JavaThread "Low Memory Detector" daemon [_thread_blocked,
id=3472]
  0x46e58400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3612]
  0x46e57400 JavaThread "Attach Listener" daemon [_thread_blocked, id=3512]
  0x46e56400 JavaThread "Signal Dispatcher" daemon [_thread_blocked,
id=2228]
  0x46e47000 JavaThread "Finalizer" daemon [_thread_blocked, id=3976]
  0x46e42c00 JavaThread "Reference Handler" daemon [_thread_blocked,
id=3672]

Other Threads:
  0x46e3f800 VMThread [id=4060]
  0x46e77c00 WatcherThread [id=1528]

VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 36352K, used 96K [0x02990000, 0x05100000,
0x07850000)
  eden space 32320K,   0% used [0x02990000, 0x029a8380, 0x04920000)
  from space 4032K,   0% used [0x04920000, 0x04920000, 0x04d10000)
  to   space 4032K,   0% used [0x04d10000, 0x04d10000, 0x05100000)
 tenured generation   total 483968K, used 110802K [0x07850000, 0x250f0000,
0x42990000)
   the space 483968K,  22% used [0x07850000, 0x0e484ac0, 0x0e484c00,
0x250f0000)
 compacting perm gen  total 14080K, used 13831K [0x42990000, 0x43750000,
0x46990000)
   the space 14080K,  98% used [0x42990000, 0x43711c68, 0x43711e00,
0x43750000)
No shared spaces configured.

Dynamic libraries:
//*deleted* - not interesting, just boring :-)

VM Arguments:
jvm_args: -Xms512m -Xmx1024m
java_command: com.fhgelsenkirchen.project2.model.VisualMediJa
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:\Programme\CMake
2.4\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme
\Java\jdk1.6.0_02\bin;C:\Programme\Julius MV1 v1.1\bin
USERNAME=Administrator
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 8, GenuineIntel

---------------  S Y S T E M  ---------------

OS: Windows XP Build 2600 Service Pack 2
CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 13 stepping
8, cmov, cx8, fxsr, mmx, sse, sse2
Memory: 4k page, physical 2095536k(623992k free), swap 4194303k(3442580k
free)
vm_info: Java HotSpot(TM) Client VM (1.6.0_02-b06) for windows-x86, built on
Jul 12 2007 01:16:14 by "java_re" with unknown MS VC++:1310
--------------------------------------------

It crashes at "unsignedShortArray.SetJavaArray(imageDataAllSlices);" 
I tried to play with the jvm_args but that helped nothing. Any ideas for
that problem? 

Thanks for help!

Stefan






More information about the vtkusers mailing list