vm crash problem

This simple code:

ImageIO.read (...)

makes my vm crash, if the jpeg has an invalid icc color profile. Since this is part of a jsp that means my web server and all the servelets go down when somebody trys to subscribe my site and upload a jpeg like this!!!

Some work-around or solution?

Thanks a lot to everybody.

[344 byte] By [Ego_Suma] at [2007-11-26 15:39:15]
# 1
shouldn't you be ergo sum?
tjacobs01a at 2007-7-8 21:57:35 > top of Java-index,Java Essentials,Java Programming...
# 2

> This simple code:

>

> ImageIO.read (...)

> Some work-around or solution?

>

> Thanks a lot to everybody.

I doubt anyone could help you with such little information.

What is the OS?

What is the VM version?

What is the content of hs_err_pidXXXX.log

Have you search the [url http://bugs.sun.com/bugdatabase/index.jsp]Bug database[/url]?

Caffeine0001a at 2007-7-8 21:57:35 > top of Java-index,Java Essentials,Java Programming...
# 3

If somebody encountered the same problem and knows how to do, then surely i said enough for him, anyway:

os = Windows 2003

java = 1.5.0_10

tomcat = 5.5

hs_err_pid4336.log =

*********************

#

# An unexpected error has been detected by HotSpot Virtual Machine:

#

# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d2192ac, pid=4336, tid=5896

#

# Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode, sharing)

# Problematic frame:

# C [cmm.dll+0x192ac]

#

T H R E A D

Current thread (0x00036300): JavaThread "main" [_thread_in_native, id=5896]

siginfo: ExceptionCode=0xc0000005, reading address 0x02cc6000

Registers:

EAX=0x0000a206, EBX=0x02cbce7c, ECX=0x00000420, EDX=0x02f38488

ESP=0x0007f404, EBP=0x0007f450, ESI=0x02cc6000, EDI=0x02f4160c

EIP=0x6d2192ac, EFLAGS=0x00010207

Top of Stack: (sp=0x0007f404)

0x0007f404:0000a206 02f382e4 6d2245ea 02f38488

0x0007f414:02cbce7c 0000a206 02f38488 02f382c0

0x0007f424:02f38190 6d224551 02f382e4 41324230

0x0007f434:0000a206 02cbce7c 02f38190 02cbce7c

0x0007f444:02cbccd0 0000a3b2 0000a3b2 0007f480

0x0007f454:6d222b49 02f38190 41324230 0000a206

0x0007f464:02cbce7c 00000000 0007f4b8 02cbccd0

0x0007f474:41324230 0000000a 0008806c 0007f498

Instructions: (pc=0x6d2192ac)

0x6d21929c:8b 74 24 0c 57 8b 7c 24 0c 8b c1 8b d7 c1 e9 02

0x6d2192ac:f3 a5 8b c8 8b c2 83 e1 03 f3 a4 5f 5e c3 8b 4c

Stack: [0x00040000,0x00080000), sp=0x0007f404, free space=253k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

C [cmm.dll+0x192ac]

C [cmm.dll+0x22b49]

C [cmm.dll+0x22b86]

C [cmm.dll+0x280aa]

j sun.awt.color.CMM.cmmLoadProfile([B[J)I+0

j java.awt.color.ICC_Profile.getInstance([B)Ljava/awt/color/ICC_Profile;+15

j com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(IIIII[B)V+44

v ~StubRoutines::call_stub

V [jvm.dll+0x8176e]

V [jvm.dll+0xd481d]

V [jvm.dll+0x8163f]

V [jvm.dll+0x86984]

C [jpeg.dll+0x1d3e]

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(JZZ)Z+0

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(Z)Z+12

j com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly()V+92

j com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(I)V+41

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(IZ)V+2

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(ILjavax/imageio/ImageReadParam;Z)Ljava/awt/image/Raster;+3

j com.sun.imageio.plugins.jpeg.JPEGImageReader.read(ILjavax/imageio/ImageReadParam;)Ljava/awt/image/BufferedImage;+4

j javax.imageio.ImageIO.read(Ljavax/imageio/stream/ImageInputStream;)Ljava/awt/image/BufferedImage;+55

j javax.imageio.ImageIO.read(Ljava/io/InputStream;)Ljava/awt/image/BufferedImage;+20

j test.main([Ljava/lang/String;)V+26

v ~StubRoutines::call_stub

V [jvm.dll+0x8176e]

V [jvm.dll+0xd481d]

V [jvm.dll+0x8163f]

V [jvm.dll+0x885cd]

C [java.exe+0x14c0]

C [java.exe+0x64cd]

C [kernel32.dll+0x123e5]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)

j sun.awt.color.CMM.cmmLoadProfile([B[J)I+0

j java.awt.color.ICC_Profile.getInstance([B)Ljava/awt/color/ICC_Profile;+15

j com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(IIIII[B)V+44

v ~StubRoutines::call_stub

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(JZZ)Z+0

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(Z)Z+12

j com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly()V+92

j com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(I)V+41

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(IZ)V+2

j com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(ILjavax/imageio/ImageReadParam;Z)Ljava/awt/image/Raster;+3

j com.sun.imageio.plugins.jpeg.JPEGImageReader.read(ILjavax/imageio/ImageReadParam;)Ljava/awt/image/BufferedImage;+4

j javax.imageio.ImageIO.read(Ljavax/imageio/stream/ImageInputStream;)Ljava/awt/image/BufferedImage;+55

j javax.imageio.ImageIO.read(Ljava/io/InputStream;)Ljava/awt/image/BufferedImage;+20

j test.main([Ljava/lang/String;)V+26

v ~StubRoutines::call_stub

P R O C E S S

Java Threads: ( => current thread )

0x02cb0ab8 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=5788]

0x00a6c7b0 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=5604]

0x00a6b410 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3372]

0x00a6a678 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3244]

0x0003f108 JavaThread "Finalizer" daemon [_thread_blocked, id=5600]

0x00a47a90 JavaThread "Reference Handler" daemon [_thread_blocked, id=4832]

=>0x00036300 JavaThread "main" [_thread_in_native, id=5896]

Other Threads:

0x00a67af0 VMThread [id=3376]

0x00a6daf8 WatcherThread [id=4264]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap

def new generationtotal 576K, used 191K [0x22a70000, 0x22b10000, 0x22f50000)

eden space 512K, 32% used [0x22a70000, 0x22a990a0, 0x22af0000)

from space 64K, 42% used [0x22af0000, 0x22af6b98, 0x22b00000)

tospace 64K,0% used [0x22b00000, 0x22b00000, 0x22b10000)

tenured generationtotal 1408K, used 123K [0x22f50000, 0x230b0000, 0x26a70000)

the space 1408K,8% used [0x22f50000, 0x22f6ec90, 0x22f6ee00, 0x230b0000)

compacting perm gen total 8192K, used 145K [0x26a70000, 0x27270000, 0x2aa70000)

the space 8192K,1% used [0x26a70000, 0x26a94528, 0x26a94600, 0x27270000)

ro space 8192K, 66% used [0x2aa70000, 0x2afc8580, 0x2afc8600, 0x2b270000)

rw space 12288K, 46% used [0x2b270000, 0x2b804aa8, 0x2b804c00, 0x2be70000)

Dynamic libraries:

0x00400000 - 0x0040c000 C:\Program Files\Java\jdk1.5.0_01\bin\java.exe

0x7c800000 - 0x7c8c0000 C:\WINDOWS\system32\ntdll.dll

0x77e40000 - 0x77f42000 C:\WINDOWS\system32\kernel32.dll

0x77f50000 - 0x77fec000 C:\WINDOWS\system32\ADVAPI32.dll

0x77c50000 - 0x77cef000 C:\WINDOWS\system32\RPCRT4.dll

0x77ba0000 - 0x77bfa000 C:\WINDOWS\system32\MSVCRT.dll

0x6d6b0000 - 0x6d835000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\client\jvm.dll

0x77380000 - 0x77412000 C:\WINDOWS\system32\USER32.dll

0x77c00000 - 0x77c48000 C:\WINDOWS\system32\GDI32.dll

0x76aa0000 - 0x76acd000 C:\WINDOWS\system32\WINMM.dll

0x76290000 - 0x762ad000 C:\WINDOWS\system32\IMM32.DLL

0x71bc0000 - 0x71bc8000 C:\WINDOWS\system32\rdpsnd.dll

0x771f0000 - 0x77201000 C:\WINDOWS\system32\WINSTA.dll

0x71c40000 - 0x71c98000 C:\WINDOWS\system32\NETAPI32.dll

0x76b70000 - 0x76b7b000 C:\WINDOWS\system32\PSAPI.DLL

0x6d2f0000 - 0x6d2f8000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\hpi.dll

0x6d680000 - 0x6d68c000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\verify.dll

0x6d370000 - 0x6d38d000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\java.dll

0x6d6a0000 - 0x6d6af000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\zip.dll

0x6d200000 - 0x6d22f000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\cmm.dll

0x6d430000 - 0x6d44f000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\jpeg.dll

0x6d070000 - 0x6d1d6000 C:\Program Files\Java\jdk1.5.0_01\jre\bin\awt.dll

0x73070000 - 0x73097000 C:\WINDOWS\system32\WINSPOOL.DRV

0x77670000 - 0x777a4000 C:\WINDOWS\system32\ole32.dll

VM Arguments:

java_command: test

Environment Variables:

CLASSPATH=D:\Tomcat5.5\common\classes;D:\Tomcat5.5\common\lib\servlet-api.jar;D:\Tomcat5.5\common\lib\activation.jar;D:\Tomcat5.5\common\lib\mail.jar;D:\Tomcat5.5\common\lib\jtds-0.9-rc2.jar;C:\Program Files\PostgreSQL\8.0\jdbc\postgresql-8.0-311.jdbc3.jar;.;

PATH=C:\Program Files\TextPad 4;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Dell\OpenManage\oma\bin;C:\Program Files\Dell\OpenManage\LU\bin;C:\Program Files\Dell\OpenManage\oldiags\bin;C:\Program Files\Dell\OpenManage\Array Manager;C:\MSSQL7\BINN;C:\Program Files\PostgreSQL\8.0\bin;C:\Program Files\GnuWin32\bin;.

USERNAME=matematici

OS=Windows_NT

PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel

S Y S T E M

OS: Windows Server 2003 family Build 3790 Service Pack 1

CPU:total 4 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht

Memory: 4k page, physical 1047824k(258148k free), swap 3056972k(2115468k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_01-b08) for windows-x86, built on Dec 6 2004 19:51:00 by "java_re" with MS VC++ 6.0

*********************

by the way: "ego sum" in english is "I am"

thank you again

Ego_Suma at 2007-7-8 21:57:35 > top of Java-index,Java Essentials,Java Programming...
# 4

I googled using [url http://www.google.com/search?q=cmmLoadProfile+bug]cmmLoadProfile bug[/url].

One of the results was a link to http://forums.java.net/jive/thread.jspa?threadID=13342&messageID=93584 which talks about this bug. Someone there posted a link to code that provides a workaround for that bug: http://uio.imagero.com/doc/com/imagero/uio/io/JpegFilterInputStream.html

I couldn't find a relevant bug id in the [url http://bugs.sun.com/bugdatabase/]bug database[/url]. You might want to submit a bug report.

Caffeine0001a at 2007-7-8 21:57:35 > top of Java-index,Java Essentials,Java Programming...
# 5
thank you, i will try on monday and will let you know
Ego_Suma at 2007-7-8 21:57:35 > top of Java-index,Java Essentials,Java Programming...