IBM Support

IT15391: Memory leak in managed .NET application as a result of MQRC_CONNECTION_BROKEN (2009) situation

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The application thread issues MQAPI calls and waits for reply
    from the server. Before sending data across the socket a lock is
    acquire, but not released upon a SocketException. Later when the
    disposer thread wants to clean the objects, it is issuing a
    MQCLOSE call and waiting to acquire the lock  endlessly. Since
    the disposer thread is blocked, the clean up is held by .NET
    runtime and hence memory is leaking.
    
    Dump of the application shows Finalizer thread is blocked, it is
    waiting to acquire lock.
    
            Child SP               IP Call Site
    0000000009c9eeb8 00000000778dd96a [HelperMethodFrame_1OBJ:
    0000000009c9eeb8]
    System.Threading.WaitHandle.WaitOneNative(System.Runtime.Interop
    Services.SafeHandle, UInt32, Boolean, Boolean)
    0000000009c9efe0 000007fe9b8846ad
    System.Threading.WaitHandle.InternalWaitOne(System.Runtime.Inter
    opServices.SafeHandle, Int64, Boolean, Boolean)
    0000000009c9f010 000007fe9bf248fd
    IBM.WMQ.Nmqi.MQFAPConnection.RequestSendLock()
    0000000009c9f050 000007fe9c3058ab
    IBM.WMQ.Nmqi.MQSession.SendTSH(IBM.WMQ.MQTSH)
    0000000009c9f0f0 000007fe9c369501
    IBM.WMQ.MQFAP.MQCLOSE(IBM.WMQ.Nmqi.Hconn, IBM.WMQ.Nmqi.Phobj,
    Int32, Int32 ByRef, Int32 ByRef)
    0000000009c9f1a0 000007fe9c39a873 IBM.WMQ.MQDestination.Close()
    0000000009c9f210 000007fe9c39a734 IBM.WMQ.MQQueue.Close()
    0000000009c9f250 000007fe9c39a630
    IBM.WMQ.MQDestination.Dispose(Boolean)
    0000000009c9f290 000007fe9c39a4de
    IBM.WMQ.MQDestination.Finalize()
    0000000009c9f688 000007fefa3d36c6 [DebuggerU2MCatchHandlerFrame:
    0000000009c9f688]
    
    
    Application trace shows connection broken error and socket
    exception
    
    007BB02C 22:16:19.112807  28400.364         :       Exception
    received
    IBM.WMQ.MQManagedClientException
    Message: MQRC_CONNECTION_BROKEN
    StackTrace:
       at IBM.WMQ.MQQueueManager.CheckHConnHealth(Int32 Reason)
       at IBM.WMQ.MQManagedObject.Close()
       at IBM.WMQ.MQQueueManager.Disconnect()
    007BB02D 22:16:19.112826  28400.364         :
    MQQueueManager::Disconnect Close - [Exception thrown]
    MQRC_CONNECTION_BROKEN
    
    007BB04D 22:16:19.113153  28400.364         :       (03)----{
    MQTCPConnection.SendData(byte [ ],int,int
    
    007BB051 22:16:19.113205  28400.364         :       Send >>
    007BB052 22:16:19.113324  28400.364         :       Exception
    received
    System.Net.Sockets.SocketException
    Message: An established connection was aborted by the software
    in your host machine
    StackTrace:
       at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32
    offset, Int32 size, SocketFlags socketFlags)
       at IBM.WMQ.MQTCPConnection.Send(Byte[] bytes, Int32 offset,
    Int32 length, Int32 segmentType, Int32 tshType)
    007BB053 22:16:19.113347  28400.364         :       e.ErrorCode
    = 10053
    007BB054 22:16:19.113429  28400.364         :       Exception
    received
    IBM.WMQ.Nmqi.NmqiException
    Message: Exception of type 'IBM.WMQ.Nmqi.NmqiException' was
    thrown.
    StackTrace:
    007BB055 22:16:19.113480  28400.364         :       Send << - n
    = 0
    007BB056 22:16:19.113545  28400.364         :       Exception
    received
    IBM.WMQ.Nmqi.NmqiException
    Message: Exception of type 'IBM.WMQ.Nmqi.NmqiException' was
    thrown.
    StackTrace:
       at IBM.WMQ.MQTCPConnection.Send(Byte[] bytes, Int32 offset,
    Int32 length, Int32 segmentType, Int32 tshType)
    007BB057 22:16:19.113610  28400.364         :       (03)----}
    MQTCPConnection.SendData(byte [ ],int,int) (rc=OK)
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    Users of Managed .Net client applications
    
    
    Platforms affected:
    Windows
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    A coding error within the locking logic of the MQ managed .NET
    client resulted in lock not being released when an exception was
    encountered. This blocked the disposer thread and the cleanup is
    held causing memory leak.
    

Problem conclusion

  • The MQ .Net Managed client logic has been updated to correct
    this locking issue.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v7.5       7.5.0.8
    v8.0       8.0.0.6
    v9.0 CD    9.0.1
    v9.0 LTS   9.0.0.1
    
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006037
    
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006309
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT15391

  • Reported component name

    WMQ WINDOWS V7

  • Reported component ID

    5724H7220

  • Reported release

    710

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-05-31

  • Closed date

    2016-10-27

  • Last modified date

    2017-06-01

  • 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

    WMQ WINDOWS V7

  • Fixed component ID

    5724H7220

Applicable component levels

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSDEZSF","label":"IBM WebSphere MQ Managed File Transfer for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
31 March 2023