Skip to main content

[JAI-IMAGEIO] JPEG lossy image file crashing JVM with native JIIO reader

4 replies [Last post]
Anonymous

Hi.

I have found some JPEG image files which cause the JVM machine to crash when
loaded through the NATIVE reader of the JAI Image I/O Tools library (Win XP
Pro SP2, JRE v1.6.0, JAI v1.1.3, JIIO v1.1).

The "malicious" image is a simple color JPEG image, 8-bit per channel,
photometric interpretation YBR_FULL_422. It can be opened and displayed
without problems by any image viewer, including Windows Preview. This sample
image (extracted from a multi-frame DICOM file) can be downloaded at:

http://test.neologica.it/USImage.jpg

If I try loading this image through the pure-Java version of the JPEG
reader, everything works fine. But if I use the native version, the JVM
crashes and exits unexpectedly on Windows XP. Here is a fragment of the
crash dump:

# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0378ff2c, pid=3336,
tid=6088
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
# Problematic frame:
# C [clib_jiio_sse2.dll+0xaff2c]
#
[..]

I attach a self-contained test case which demonstrates the problem.

Strange enough, I've run the attached test application on different Windows
platforms (Windows XP, Windows 2000 Server, Windows 2003 Server), all with
the same JRE version (1.6.0) and the same JAI and JAI Image I/O Tools
versions (JAI v1.1.3 and JIIO v1.1), but the crash ONLY HAPPENS ON WINDOWS
XP. I've tested several different Win XP machines, and the attached test
application crashes the JVM on all of them.

Please let me know your comments. Can you guess why the JVM crash is only
happening on Win XP?

Regards,

Marco.

[JpegReaderTester.java]
---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
James Cheng

Hi Marco,

> Please let me know your comments. Can you guess why the JVM crash is only
> happening on Win XP?

I am able to reproduce the crash with the SSE2 version DLL on WinXP.
No problem if the pure C DLL, clib_jiio.dll, is used. So, there must
be a bug in the SSE2 version DLL, clib_jiio_sse2.dll. Would you like
to file an issue against jai-imageio-core/codeclib? Or, I can do so
with your test case, if you prefer.

As for why it happened only on WinXP, it might be that your WinXP
boxes have CPUs with SSE2 while your other boxes have older CPUs
without SSE2.

Thanks,
-James

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Marco Sambin - NeoLogica

Hi James,

thank you for your message and the additional explanations about SSE2.

Actually, the strange thing is that I run the test case on a Pentium 4, 3.2
GHz server with Windows 2003 Server OS, and the JVM does not crash on this
PC. I believe this machine should support SSE2, am I correct?

In any case, I confirm that if I remove the "clib_jiio_sse2.dll" file,
everything works fine on Windows XP as well, so the problem must certainly
reside in the SSE2 version of the DLL. It is still quite strange that I can
only reproduce it on Windows XP PC's...

I will file an issue ASAP.

Thanks again for your feedback,

Marco.

-----Original Message-----
From: James.Cheng@Sun.COM [mailto:James.Cheng@Sun.COM]
Sent: mercoledì 7 febbraio 2007 20.17
To: interest@jai-imageio.dev.java.net
Subject: Re: [JAI-IMAGEIO] JPEG lossy image file crashing JVM with native
JIIO reader

Hi Marco,

> Please let me know your comments. Can you guess why the JVM crash is
> only happening on Win XP?

I am able to reproduce the crash with the SSE2 version DLL on WinXP.
No problem if the pure C DLL, clib_jiio.dll, is used. So, there must be a
bug in the SSE2 version DLL, clib_jiio_sse2.dll. Would you like to file an
issue against jai-imageio-core/codeclib? Or, I can do so with your test
case, if you prefer.

As for why it happened only on WinXP, it might be that your WinXP boxes have
CPUs with SSE2 while your other boxes have older CPUs without SSE2.

Thanks,
-James

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Marco Sambin - NeoLogica

Hi,

I've just submitted the Issue (Issue #115). I hope I've provided a clear
enough explanation.
Those of you who are interested can read further details about the issue or
vote for it at the following URL:

https://jai-imageio-core.dev.java.net/issues/show_bug.cgi?id=115

Regards,

Marco.

-----Original Message-----
From: Marco Sambin - NeoLogica [mailto:marco.sambin@neologica.it]
Sent: giovedì 8 febbraio 2007 10.52
To: interest@jai-imageio.dev.java.net
Subject: RE: [JAI-IMAGEIO] JPEG lossy image file crashing JVM with native
JIIO reader

Hi James,

thank you for your message and the additional explanations about SSE2.

Actually, the strange thing is that I run the test case on a Pentium 4, 3.2
GHz server with Windows 2003 Server OS, and the JVM does not crash on this
PC. I believe this machine should support SSE2, am I correct?

In any case, I confirm that if I remove the "clib_jiio_sse2.dll" file,
everything works fine on Windows XP as well, so the problem must certainly
reside in the SSE2 version of the DLL. It is still quite strange that I can
only reproduce it on Windows XP PC's...

I will file an issue ASAP.

Thanks again for your feedback,

Marco.

-----Original Message-----
From: James.Cheng@Sun.COM [mailto:James.Cheng@Sun.COM]
Sent: mercoledì 7 febbraio 2007 20.17
To: interest@jai-imageio.dev.java.net
Subject: Re: [JAI-IMAGEIO] JPEG lossy image file crashing JVM with native
JIIO reader

Hi Marco,

> Please let me know your comments. Can you guess why the JVM crash is
> only happening on Win XP?

I am able to reproduce the crash with the SSE2 version DLL on WinXP.
No problem if the pure C DLL, clib_jiio.dll, is used. So, there must be a
bug in the SSE2 version DLL, clib_jiio_sse2.dll. Would you like to file an
issue against jai-imageio-core/codeclib? Or, I can do so with your test
case, if you prefer.

As for why it happened only on WinXP, it might be that your WinXP boxes have
CPUs with SSE2 while your other boxes have older CPUs without SSE2.

Thanks,
-James

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

James Cheng

Hi Marco,

> I've just submitted the Issue (Issue #115). I hope I've provided a clear
> enough explanation.

It looks good.

> Actually, the strange thing is that I run the test case on a Pentium 4, 3.2
> GHz server with Windows 2003 Server OS, and the JVM does not crash on this
> PC. I believe this machine should support SSE2, am I correct?

Yes, P4 should support SSE2. It might be that clib_jiio_util.dll fails to
detect SSE2 on that PC, or the bug is exposed only with a certain version
of system library KERNEL32.dll.

Thanks,
-James

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net