Description of problem: None of the binding objects has a lock around the code that deletes the kept object resource. If a client application deletes aliased copies of the object from multiple threads then the application will crash with an access violation. Version-Release number of selected component (if applicable): 1.3.0.24 How reproducible: Unseen in the wild. 100% in staged tests. Steps to Reproduce: 1. Create aliased copies of a single Message in multiple threads. 2. All threads try to delete the object at the same time. 3. Actual results: Access violation exception when code executes "delete 0;". Expected results: No access violations. Additional info: Grep the code for "TODO: add lock". Several hits found.
Fixed upstream at r1057350
Hi Chuck, could you possibly attach an example of above described scenario, please? Attached example can drastically reduce validation effort on this defect.
Hi Frantisek, Yes, I'm attaching a patch. It's based at qpid/cpp/bindings/qpid/dotnet. It modifies two files: 1. Message.cpp - adds a delay in the Finalizer to make the collision-that-needs-locking window much larger. 2. *.helloworld.cs - Rewrites the whole file to become a lock test. Instructions and theory are comments in this file. You have to run the program twice: once with the locks in place to see them work, and once with the locks removed (edit Message.cpp - rebuild org.apache.qpid.messaging.dll) to see the access violation. -Chuck
Created attachment 483282 [details] Demo to show locks working/failing.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: Messaging binding object access was not properly interlocked. Consequence: Under certain circumstances object deletions could fail with an access violation. Fix: Add interlocks to serialize references to objects being deleted. Result: Object deletions no longer fail due to access violations.
Object deletions caused by client applications do not fail due to access violation any more. Tested on the package qpid-cpp-*-2.0.0.4. --> VERIFIED
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2011-0890.html