IBM Support

IV47606: DEADLOCK IN RANDOMACCESSFILE/FILEINPUTSTREAM/FILEOUTPUTSTREAM IN MULTI-THREAD ENV

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: There is deadlock found between
    java.nio.channels.spi.AbstractInterruptibleChannel and
    RandomAccessFile/FileInputStream/FileOutputStream when in multi
    thread environment
    .
    Stack Trace: There is a deadlock in the classes code:
    3XMTHREADBLOCK Blocked on: java/lang/Object@0x00000000FFF51D58
    Owned by: "Attach API initializer"
    (J9VMThread:0x0000000000F02D00,
    java/lang/Thread:0x00000000FFF479F8)
    3XMHEAPALLOC Heap bytes allocated since last GC cycle=3768
    (0xEB8)
    3XMTHREADINFO3 Java callstack:
    4XESTACKTRACE at
    java/nio/channels/spi/AbstractInterruptibleChannel.close(Abstrac
    tInterruptibleChannel.java:111)
    4XESTACKTRACE at
    java/io/RandomAccessFile.close(RandomAccessFile.java:586)
    5XESTACKTRACE (entered lock:
    java/lang/Object@0x00000000FFF515B0, entry count: 1)
    3XMTHREADBLOCK Blocked on: java/lang/Object@0x00000000FFF515B0
    Owned by: "Attach API teardown" (J9VMThread:0x0000000000F07E00,
    java/lang/Thread:0x00000000FFF48098)
    3XMHEAPALLOC Heap bytes allocated since last GC cycle=19584
    (0x4C80)
    3XMTHREADINFO3 Java callstack:
    4XESTACKTRACE at
    java/io/RandomAccessFile.close(RandomAccessFile.java:575)
    4XESTACKTRACE at
    sun/nio/ch/FileChannelImpl.implCloseChannel(FileChannelImpl.java
    :123)
    4XESTACKTRACE at
    java/nio/channels/spi/AbstractInterruptibleChannel$1.interrupt(A
    bstractInterruptibleChannel.java:165)
    5XESTACKTRACE (entered lock:
    java/lang/Object@0x00000000FFF51D58, entry count: 1)
    4XESTACKTRACE at
    java/nio/channels/spi/AbstractInterruptibleChannel.begin(Abstrac
    tInterruptibleChannel.java:180)
    4XESTACKTRACE at
    sun/nio/ch/FileChannelImpl.lock(FileChannelImpl.java:1007)
    4XESTACKTRACE at
    java/nio/channels/FileChannel.lock(FileChannel.java:1052)
    .
    N/A
    

Local fix

  • Do not close RandomAccessFile/FileInputStream/FileOutputStream
    and its channel in different thread at same time.
    

Problem summary

  • There is a wrong patch in
    java.io.RandomAccessFile/FileInputStream/FileOutputStream which
    synchronizes too much code and it cause the deadlock.
    

Problem conclusion

  • This defect will be fixed in:
    7.0.0 SR6
    .
    Modify the code to synchronize the really needed code to solve
    the deadlock
    

Temporary fix

  • N/A
    

Comments

APAR Information

  • APAR number

    IV47606

  • Reported component name

    JAVA CLASS LIBS

  • Reported component ID

    620700130

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-08-27

  • Closed date

    2013-09-03

  • Last modified date

    2013-09-03

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    JAVA CLASS LIBS

  • Fixed component ID

    620700130

Applicable component levels

  • R700 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
21 February 2022