]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_corosync: Change thread stack size
authorJan Friesse <jfriesse@redhat.com>
Thu, 30 Mar 2017 14:33:51 +0000 (16:33 +0200)
committerJan Friesse <jfriesse@redhat.com>
Fri, 16 Jun 2017 12:53:22 +0000 (07:53 -0500)
commit9aeab4aced35f668149aa083a96928766f645f23
tree6c00fbc347173e5d7ab4ce5bc9a055dec42c9a77
parentb1f46c2a365f08a60f03e0c0437cd0fe3aa8ac0e
res_corosync: Change thread stack size

In Corosync 2.x libraries were changed to use LibQB IPC.
Sadly LibQB IPC doesn't support copy-free access to received buffer, so
Corosync libraries were rewritten to use stack as buffer. Mostly the
needed stack size is quite small, but for all *_dispatch functions, 1MiB
is needed.

Asterisk function ast_pthread_create_background set stack size for new
thread to much smaller AST_BACKGROUND_STACKSIZE (~500KiB).

This results in Asterisk crash when running with Corosync 2.x.

Patch solves this issue by creating it's own version of
ast_pthread_create_background which sets stack size to much higher value
(actually it's AST_BACKGROUND_STACKSIZE + 3MiB).

Another problem may appear when "corosync show members" netconsole
command is executed. It is also executed in thread and also has only
500KiB stack size. Sadly it calls corosync_cfg_get_node_addrs which
again needs at least 1MiB stack.

Solution is to use HAVE_COROSYNC_CFG_STATE_TRACK as a discriminator
between Corosync 1.x and 2.x. If 1.x is found, nothing changes. If 2.x
is found, NodeID is displayed instead of IP address.

ASTERISK-25370 #close
Reported by: mdu113

Change-Id: Id95b0d21ab6e708e7d74ad8786c587211676fa08
res/res_corosync.c