Commit Graph

1251 Commits

Author SHA1 Message Date
Angus Salkeld
b116eaca00 ipc: Fix error handling of mmap util functions.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2972 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-29 05:31:44 +00:00
Steven Dake
7b832592b0 Fix problem where flight data leaks files in /dev/shm when corosync is
restarted continuously via init scripts.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2964 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-28 22:15:48 +00:00
Jan Friesse
c4cb9ae4f0 Fix OBJDB locking
Patch fixes following situation:

1. objdb receives reload notification and ends in function
object_reload_config. This will call objdb_wrlock. I will call this
thread #1

2. Another thread will decide to update corosync statistics and calls
object_key_increment. This calls objdb_rdlock. This thread is #2. But
because condition (lock_thread != pthread_self()) is satisfied, it will
also calls pthread_rwlock_rdlock. This will blocks, because thread #1
holds the lock.

3. object_reload_config will call reload functions (as real example
xml2objdb). xml2objdb needs to calls object_create. This calls
objdb_rdlock, but will hang on pthread_mutex_lock(&meta_lock), because
this lock is held by thread #2.

-> deadlock

It is handled by using recursive mutex.

Also every function is now really locked.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2963 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-28 13:32:56 +00:00
Jan Friesse
eda1e364f4 Remove pathconf which may fall
Corosync has problem with readdir_r if pathconf function fails.

Main problem is hidden in calling pathconf (internally calls statfs)
which may fail. After this fail, newly allocated memory for readdir_r
was smaller than expected and memory was overwritten by readdir_r.

Patch removes calling of pathconf and rather use NAME_MAX constant which
is always large enough for all file systems.

Also return value of malloc SHOULD be checked.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2962 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-23 08:39:49 +00:00
Steven Dake
0eb0a06a14 Stop the totem stats updater timer during shutdown to prevent references to
invalid memory.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2953 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-19 00:27:46 +00:00
Steven Dake
1e76356159 Unlock global serializer lock during shutdown.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2949 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-19 00:10:41 +00:00
Andrew Beekhof
daa85f8f6c Prevent segfault in fork()
Not closing stdin/stderr/stdout leads to a segfault in fresetlockfiles()
See https://lists.linux-foundation.org/pipermail/openais/2010-June/014854.html for further info.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2948 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-18 14:33:01 +00:00
Christine Caulfield
bc1cca69b3 object_key_iter() calls object_key_iter_typed() and then always tries to
dereference the string it returns, even if the call fails. The attached
patch fixes this. 



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2944 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-15 15:48:58 +00:00
Steven Dake
402c553dd2 Update logsys to use proper ring buffer on file backed map
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2922 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-09 20:14:50 +00:00
Steven Dake
b8af7c3764 sem_wait can be interrupted by signal. Handle interruption properly.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2920 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-03 22:05:17 +00:00
Steven Dake
22471e113d Fix fail to receive logic which occurs very rarely on high loss networks with
software based multicast.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2919 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-03 21:36:21 +00:00
Steven Dake
79c60fd0ad Totem spec is clear:
reject retransmitted tokens
if token.aru = aru in token on last rotation ... do some logic

Here is how the current code works:

last_aru = instance->my_last_aru;
instance->my_last_aru = token->aru;
reject retransmitted tokens
if token.aru = aru in token on last rotation ... do some logic

The issue is last_aru will be set to token->aru when a token retransmission
occurs before a new token arrives.

This results in the "do some logic" part happening more often then it should.    


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2917 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-01 20:35:53 +00:00
Steven Dake
c3a6b98bdc The static function 'decode_mode()' is used by the static function
'dump_subsys_config()' which is is turn used by the static function
'dump_full_config()' which is never used.

Are these functions used by someone using some magic? I did not find
any reference and even the flag LOGSYS_DEBUG, which prevents them from
compiling, does not exist at some other point.

If these functions are really not used, please remove them (because at
least one of them has a buffer overflow). Patch against 1.2.3
is attached.

If there is a need for these functions, I'll send a patch to fix
the 'decode_mode()' function.

Kind regards

Andreas Florath

Signed-off-by: Andreas Florath <gnu4u at flonatel dot org>



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2915 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-28 20:39:58 +00:00
Steven Dake
4561c6dcf6 Fix problem where memcpy operation occurs incorrectly to copy schedule
parameter data resulting in priority inversion deadlocks on single cpu systems.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2906 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-26 17:47:39 +00:00
Steven Dake
d209f7bb27 Fix leak in error path in nss encryption.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2857 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-19 05:30:18 +00:00
Angus Salkeld
7999995273 cov 10412: fix mem leak in encrypt_and_sign_nss()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2854 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-19 04:35:25 +00:00
Angus Salkeld
4ff33854ad add __attribute__((noreturn)) to functions that always exit.
we had some __attribute__((__noreturn__))
and some    __attribute__((noreturn))

I made them all: __attribute__((noreturn))



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2853 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-19 04:34:53 +00:00
Steven Dake
6d79a218e2 Fix signed comparison with unsigned value in mainconfig.c
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2851 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 16:44:59 +00:00
Angus Salkeld
0c790c067a cov 10388: fix check for no mcast address
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2850 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:46:35 +00:00
Angus Salkeld
ad71b66c7b cov (many): make sure all _set() functions return a signed int
in the body it can return -1, and callers check for -1.
but the return type is unsigned int?



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2849 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:46:08 +00:00
Angus Salkeld
2a23dfc585 cov 10391: allow assert to check for a negative number
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2848 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:43:41 +00:00
Angus Salkeld
8236a0873e cov 10404: don't assign loc pointer when not used.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2847 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:14:02 +00:00
Steven Dake
d4f92c864a Fix problem where logsys messages are not flushed at exit before worker thread
is created.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2846 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:13:54 +00:00
Angus Salkeld
92985c31d9 cov 10405: remove unused pointer from totemsrp.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2845 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:12:52 +00:00
Angus Salkeld
18326ad242 cov 10392: remove pointless assert
backlog is unsigned



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2842 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:40:19 +00:00
Angus Salkeld
71a09466e4 cov 10413: crypto init a variable.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2841 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:36:51 +00:00
Angus Salkeld
b2a304d8f8 cov (10387, 10397): cleanup memory mapping functions
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2840 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:35:52 +00:00
Angus Salkeld
d08c6d577f cov 10399: set the msg_flags to 0 in coroipcs.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2838 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:33:32 +00:00
Angus Salkeld
43d4f9d040 cov 10389: remove unneccessary check.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2836 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:31:28 +00:00
Angus Salkeld
2f21e126be cov 10371: check return of lcr_ifact_reference
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2835 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:29:30 +00:00
Angus Salkeld
5eba844916 cov 10401: error_string never set
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2834 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:28:13 +00:00
Angus Salkeld
202de1b8e2 cov 10411: fix leak in totemudp.c
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2833 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:26:15 +00:00
Angus Salkeld
ff8d0084cb cov 10400: unit'ed variable.
not important, easy to fix.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2832 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:25:33 +00:00
Angus Salkeld
45152f0902 cov 10378: fix syntax error.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2829 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:08:02 +00:00
Angus Salkeld
3eb76c2154 cov 10382: improve error handling around open()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2825 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:05:32 +00:00
Angus Salkeld
b4f61842b6 cov 10381: check result of open()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2824 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:04:53 +00:00
Angus Salkeld
3ebd6fab52 cov 10379 &10380: check result of open before calling ftruncate.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2823 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:03:49 +00:00
Steven Dake
5e8f1a730f logsys rework to deal with memory corruption around debug:on configurations.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2816 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-13 04:36:42 +00:00
Angus Salkeld
6bae61d835 log: remove "Member left/join" log messages
No longer needed by CTS and likely to be very noisy
with large node numbers.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2804 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-05 04:36:56 +00:00
Angus Salkeld
ea345ef0fd check and discard unknown messages
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2800 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 04:25:31 +00:00
Angus Salkeld
8ebe03efd5 diags: add a mechanism to trigger the writing the flight data
trigger the dumping of flight data using:
 corosync-objctl -w runtime.blackbox.dump_flight_data=anything
trigger the dumping of state using:
 corosync-objctl -w runtime.blackbox.dump_state=anything

then read the flight data as usual:
 corosync-fplay

This patch includes a wrapper script called:
 corosync-blackbox



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2799 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 00:56:25 +00:00
Steven Dake
5672c3efa8 The retransmit token storage area is an improper type of an array of pointers
rather then a pointer to a buffer.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2795 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-30 05:18:02 +00:00
Steven Dake
005b9af59d When a message is retransmitted, a memmove operation is done to remove the
newly retransmitted entry from the list.  It is possible this memmove operation
can buffer overflow because it has an invalid length calculation fixed by this
revision.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2794 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-30 05:15:41 +00:00
Steven Dake
80d621e25f Allow maximum entries in the retransmit queue when recovery takes place.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2793 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-30 05:14:08 +00:00
Steven Dake
107ef19913 Save the ring id and restore it properly when the recovery operation fails as
a result of a new gather or token loss.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2792 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-30 05:12:26 +00:00
Jan Friesse
12c5f31a89 Handle some valgrind errors
- Memset for res_setup variable in coroipcs:req_setup_send
- Two memset in logsys for buffers
- Problem in corosync_totem_stats_updater where avg_token_holdtime has
size of avg_backlog_calc
- corosync_totem_stats_init where avg_backlog_calc is 32 bits (not 64)
- objdb problem if new_valie_len != object->value_len. In such case
newly allocated memory is not initialized and in some situations,
value_len is not updated.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2787 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-23 08:03:05 +00:00
Christine Caulfield
e88c09e7c2 Fix a crash in YKD
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2767 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-20 07:27:14 +00:00
Angus Salkeld
212126fa34 When sync is aborted clear the "my_ring_id" variable.
This patch fixes crashes found by repeated pacemaker CTS SimluStart
tests. When you bring up the nodes together it can cause a lot of
configuration changes and sync gets started and aborted
lots of times.

When abort is called the ring_id is not changed which means that any
sync packet that arrive from that point on will be accepted as valid.
I have seen old barrier messages causing the processing index to increment
later causing an array out of bounds.

This patch memsets the ring_id to 0, thus causing the ring_id in the packet and
my_ring_id not to match.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2757 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-12 19:51:38 +00:00
Steven Dake
97174868b1 Allow modifying POLLIN/POLLOUT state in another thread while the main thread
is blocked in poll system call.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2755 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-02 19:16:23 +00:00
Steven Dake
cf4e2069b6 Fix barrier operation with syncv2 and compat:none or openais service engines.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2750 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-30 08:23:10 +00:00