Bug 929101 - 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:19 UTC by Libor Miksik
Modified: 2014-04-10 06:56 UTC (History)
9 users (show)

Fixed In Version: corosync-1.4.1-15.el6_4.1
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: 2014-04-10 06:56:29 UTC
Target Upstream Version:


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


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 389613 None None None Never
Red Hat Product Errata RHBA-2013:0824 normal SHIPPED_LIVE corosync bug fix update 2013-05-15 00:43:25 UTC

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

Comment 4 Jan Friesse 2013-03-29 10:50:36 UTC
Created attachment 718022 [details]
6.4.z-bz929101-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 10:50:41 UTC
Created attachment 718023 [details]
6.4.z-bz929101-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 10:50:44 UTC
Created attachment 718024 [details]
6.4.z-bz929101-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 10:50:47 UTC
Created attachment 718025 [details]
6.4.z-bz929101-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>


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