Bug 929098 - CPG: Corosync can duplicate and/or lost messages - Local IPC
Summary: CPG: Corosync can duplicate and/or lost messages - Local IPC
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: corosync
Version: 6.4
Hardware: All
OS: All
urgent
urgent
Target Milestone: rc
: ---
Assignee: Jan Friesse
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 922671
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-29 09:18 UTC by Libor Miksik
Modified: 2013-04-09 10:29 UTC (History)
9 users (show)

Fixed In Version: corosync-1.4.1-4.el6_2.5
Doc Type: Bug Fix
Doc Text:
When running applications which used the Corosync IPC library, some messages in the dispatch() function were lost or duplicated. This update properly checks the return values of the dispatch_put() function, returns the correct remaining bytes in the IPC ring buffer, and ensures that the IPC client is correctly informed about the real number of messages in the ring buffer. Now, messages in the dispatch() function are no longer lost or duplicated.
Clone Of:
Environment:
Last Closed: 2013-04-09 10:29:36 UTC


Attachments (Terms of Use)
6.2.z-bz929098-1-Put-handle-to-hdb-in-dispatch-on-unknown-message (1.60 KB, patch)
2013-03-29 11:26 UTC, Jan Friesse
no flags Details | Diff
6.2.z-bz929098-2-Properly-check-result-of-coroipcc_dispatch_put (4.63 KB, patch)
2013-03-29 11:26 UTC, Jan Friesse
no flags Details | Diff
6.2.z-bz929098-3-coroipcs-Ensure-rb-data-are-not-overwritten (1.19 KB, patch)
2013-03-29 11:26 UTC, Jan Friesse
no flags Details | Diff
6.2.z-bz929098-4-Properly-lock-pending_semops (3.02 KB, patch)
2013-03-29 11:26 UTC, Jan Friesse
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0724 normal SHIPPED_LIVE corosync bug fix update 2013-04-09 14:28:42 UTC

Description Libor Miksik 2013-03-29 09:18:13 UTC
This bug has been copied from bug #922671 and has been proposed
to be backported to 6.2 z-stream (EUS).

Comment 4 Jan Friesse 2013-03-29 11:26:01 UTC
Created attachment 718032 [details]
6.2.z-bz929098-1-Put-handle-to-hdb-in-dispatch-on-unknown-message


Put handle to hdb in dispatch on unknown message

When we receive unknown dispatch type, we should put handle to hdb,
because it was correctly obtained. This problem is only cfg and confdb
libraries, cpg, evs, quorum, ... are not affected and works correctly.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Comment 5 Jan Friesse 2013-03-29 11:26:04 UTC
Created attachment 718033 [details]
6.2.z-bz929098-2-Properly-check-result-of-coroipcc_dispatch_put


Properly check result of coroipcc_dispatch_put

When result of coroipcc_dispatch_put it can happen, that one message is
delivered to user application multiple times.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Comment 6 Jan Friesse 2013-03-29 11:26:07 UTC
Created attachment 718034 [details]
6.2.z-bz929098-3-coroipcs-Ensure-rb-data-are-not-overwritten


coroipcs: Ensure rb data are not overwritten

With introduce of rb alignment (55600762), it's not enough to subtract
one from number of free bytes, but also alignment must be taken to
account. Easiest solution is to subtract 9 bytes.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>

Comment 7 Jan Friesse 2013-03-29 11:26:10 UTC
Created attachment 718035 [details]
6.2.z-bz929098-4-Properly-lock-pending_semops


Properly lock pending_semops

pending_semops variable can be changed in two threads. One is actual IPC
connection and second is coropoll. It's really scholar example of race
(one thread doing i++, second doing i--). If socket is full, it can
happen that IPC will increase value and coropoll will decrease,
resulting in unpredictable value. This means, that client IPC can be
informed about more messages then really available, resulting
in reading of garbage messages in library dispatch function.

Solution is to properly lock variable.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Comment 11 errata-xmlrpc 2013-04-09 10:29:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0724.html


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