Qpid
  1. Qpid
  2. QPID-2798

C++ Messaging Client .NET binding fails to clone managed objects correctly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: None
    • Labels:
      None
    • Environment:

      A case where managed code asserts while creating a managed object.

      Description

      The specific case that failed was
      request = receiver.fetch();
      address = request.ReplyTo;
      sender = session.CreateSender(address);

      The bug occurs during the cloning of the Address object from the request.ReplyTo. After that line of code there are two managed objects that have pointers to the same unmanaged object. When the CreateSender function asserts then the process will get an accvio during shutdown.

        Activity

        Chuck Rolke created issue -
        Hide
        Chuck Rolke added a comment -

        Based at qpid\cpp\bindings\qpid\dotnet, this patch creates managed objects in a more rational way.

        Identified in comments as an 'unmanaged clone', a managed object constructor is given an unmanaged object. The unmanaged object is copied and wrapped in a new managed object maintaining the principle that now two managed objects reference the same unmanaged object.

        Also:

        • csharp.map.sender and csharp.map.receiver get the target Address from a command line arg.
        • functions bool Receiver::Fetch(), and bool Receiver::Get() are temporarily removed.
        • Session copy constructor adds a missing copy of the parentConnection pointer.
        • Some stray debug code is deleted.
        Show
        Chuck Rolke added a comment - Based at qpid\cpp\bindings\qpid\dotnet, this patch creates managed objects in a more rational way. Identified in comments as an 'unmanaged clone', a managed object constructor is given an unmanaged object. The unmanaged object is copied and wrapped in a new managed object maintaining the principle that now two managed objects reference the same unmanaged object. Also: csharp.map.sender and csharp.map.receiver get the target Address from a command line arg. functions bool Receiver::Fetch(), and bool Receiver::Get() are temporarily removed. Session copy constructor adds a missing copy of the parentConnection pointer. Some stray debug code is deleted.
        Chuck Rolke made changes -
        Field Original Value New Value
        Attachment crash-double-free-02.patch [ 12452045 ]
        Ted Ross made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Ted Ross [ tedross ]
        Fix Version/s 0.7 [ 12314455 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Ted Ross
            Reporter:
            Chuck Rolke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development