Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1687401 - sporadic segfault in qpid-cpp-client when closing connection
Summary: sporadic segfault in qpid-cpp-client when closing connection
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 3.2
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: 3.2.13
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-11 12:49 UTC by Pavel Moravec
Modified: 2019-04-02 19:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Pavel Moravec 2019-03-11 12:49:02 UTC
Description of problem:
Under an unknown scenario, sporadic segfaults of qpid-cpp client were seen. It is assumed the cause is due to the fix in https://bugzilla.redhat.com/show_bug.cgi?id=1663609 that was in the right direction but swapped 2 commands:

Index: qpid-cpp-1.36.0/src/qpid/client/TCPConnector.cpp
===================================================================
--- qpid-cpp-1.36.0/src/qpid/client/TCPConnector.cpp	(revision 23730)
+++ qpid-cpp-1.36.0/src/qpid/client/TCPConnector.cpp	(revision 23991)
@@ -316,8 +316,8 @@
 
 void TCPConnector::aborted(AsynchIO&) {
     closed = true;
+    socket->close();
     socketClosed(*aio, *socket);
-    socket->close();
 }

The above should be the fix for this BZ.

Rationale: we should close socket first, and then release its FD it used (in socketClosed that calls Poller::unregisterHandle later on).



Version-Release number of selected component (if applicable):
qpid-cpp 1.36.0-20+hf1


How reproducible:
n.a.


Steps to Reproduce:
???


Actual results:


Expected results:


Additional info:


Note You need to log in before you can comment on or make changes to this bug.