jai-imageio-core
  1. jai-imageio-core
  2. JAI_IMAGEIO_CORE-187

VM crash using J2KImageReaderCodecLib with SegmentedImageInputStream

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: codeclib
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      187

      Description

      VM crash using J2KImageReaderCodecLib with SegmentedImageInputStream, if the
      associated StreamSegmentMapper returns a StreamSegment with length = -1 to
      signal eof:

      $ java J2KDecodeSegmentedIIS image.jp2 262144 -1
      Start decoding image.jp2 using
      com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib@10655dd
      Enter getStreamSegment(0, 8)
      return StreamSegment(0, 8)
      :
      Enter getStreamSegment(257947, 4096)
      return StreamSegment(257947, 4096)
      Enter getStreamSegment(262043, 3735)
      return StreamSegment(262043, 101)
      Enter getStreamSegment(262144, 4096)
      return StreamSegment(262144, 3634)
      Enter getStreamSegment(265778, 4096)
      return StreamSegment(265778, -1)
      #

      1. A fatal error has been detected by the Java Runtime Environment:
        #
      2. SIGSEGV (0xb) at pc=0x7b43e736, pid=6177, tid=3063769968
        #
      3. JRE version: 6.0_20-b02
      4. Java VM: Java HotSpot(TM) Server VM (16.3-b01 mixed mode linux-x86 )
      5. Problematic frame:
      6. C [libclib_jiio.so+0x56736]
        #

      If a StreamSegmentMapper returns a StreamSegment with length = 0 to signal eof,
      J2KImageReaderCodecLib loops infinitely:

      $ java J2KDecodeSegmentedIIS image.jp2 262144 0
      Start decoding image.jp2 using
      com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib@ef5502
      Enter getStreamSegment(0, 8)
      return StreamSegment(0, 8)
      :
      Enter getStreamSegment(257947, 4096)
      return StreamSegment(257947, 4096)
      Enter getStreamSegment(262043, 3735)
      return StreamSegment(262043, 101)
      Enter getStreamSegment(262144, 4096)
      return StreamSegment(262144, 3634)
      Enter getStreamSegment(265778, 4096)
      return StreamSegment(265778, 0)
      Enter getStreamSegment(265778, 4096)
      return StreamSegment(265778, 0)
      Enter getStreamSegment(265778, 4096)
      return StreamSegment(265778, 0)
      Enter getStreamSegment(265778, 4096)
      :
      Using pure java J2KImageReader works in both cases.

      1. image.jp2
        260 kB
        gunterze
      2. J2KDecodeSegmentedIIS.java
        3 kB
        gunterze

        Activity

        Hide
        gunterze added a comment -

        Created an attachment (id=149)
        Test Driver Usage: java J2KDecodeSegmentedIIS <file> <segmentlength> -1|0

        Show
        gunterze added a comment - Created an attachment (id=149) Test Driver Usage: java J2KDecodeSegmentedIIS <file> <segmentlength> -1|0
        Hide
        gunterze added a comment -

        Created an attachment (id=150)
        Test image

        Show
        gunterze added a comment - Created an attachment (id=150) Test image

          People

          • Assignee:
            jxc
            Reporter:
            gunterze
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: