aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/openvswitch/0001-ovs-thread-Set-stacksize-to-1M.patch57
-rw-r--r--testing/openvswitch/APKBUILD12
2 files changed, 65 insertions, 4 deletions
diff --git a/testing/openvswitch/0001-ovs-thread-Set-stacksize-to-1M.patch b/testing/openvswitch/0001-ovs-thread-Set-stacksize-to-1M.patch
new file mode 100644
index 0000000000..9533c4a29d
--- /dev/null
+++ b/testing/openvswitch/0001-ovs-thread-Set-stacksize-to-1M.patch
@@ -0,0 +1,57 @@
+From a298bd267fae3238bde1847292efd2da08ad5b34 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 25 Aug 2014 08:50:26 +0000
+Subject: [PATCH] ovs-thread: Set stacksize to 1M
+
+With musl libc the default stacksize is 80k which is too small and
+makes it segfault.
+
+We increase it to 1MB.
+http://permalink.gmane.org/gmane.linux.network.openvswitch.general/5831
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ lib/ovs-thread.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
+index fe6fb43..0522242 100644
+--- a/lib/ovs-thread.c
++++ b/lib/ovs-thread.c
+@@ -32,6 +32,9 @@
+ #include "socket-util.h"
+ #include "util.h"
+
++/* set default stack size to 1M */
++#define OVS_STACK_SIZE (1024 * 1024)
++
+ #ifdef __CHECKER__
+ /* Omit the definitions in this file because they are somewhat difficult to
+ * write without prompting "sparse" complaints, without ugliness or
+@@ -339,6 +342,7 @@ ovs_thread_create(const char *name, void *(*start)(void *), void *arg)
+ {
+ struct ovsthread_aux *aux;
+ pthread_t thread;
++ pthread_attr_t attr;
+ int error;
+
+ forbid_forking("multiple threads exist");
+@@ -350,6 +354,15 @@ ovs_thread_create(const char *name, void *(*start)(void *), void *arg)
+ aux->arg = arg;
+ ovs_strlcpy(aux->name, name, sizeof aux->name);
+
++ error = pthread_attr_init(&attr);
++ if (error) {
++ ovs_abort(error, "pthread_attr_init failed");
++ }
++ error = pthread_attr_setstacksize(&attr, OVS_STACK_SIZE);
++ if (error) {
++ ovs_abort(error, "pthread_attr_setstacksize failed");
++ }
++
+ error = pthread_create(&thread, NULL, ovsthread_wrapper, aux);
+ if (error) {
+ ovs_abort(error, "pthread_create failed");
+--
+2.1.0
+
diff --git a/testing/openvswitch/APKBUILD b/testing/openvswitch/APKBUILD
index ffcb987282..aeffe07b06 100644
--- a/testing/openvswitch/APKBUILD
+++ b/testing/openvswitch/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=openvswitch
pkgver=2.3.0
-pkgrel=1
+pkgrel=2
pkgdesc="A production quality, multilayer virtual switch - includes Kernel Modules for best performance."
url="http://openvswitch.org/"
arch="all"
@@ -19,6 +19,7 @@ source="http://openvswitch.org/releases/$pkgname-$pkgver.tar.gz
ovs-vswitchd.confd
ovs-modules.initd
musl-if_packet.patch
+ 0001-ovs-thread-Set-stacksize-to-1M.patch
"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -77,18 +78,21 @@ f10a8ac784654bec359bda52779f16fe ovsdb-server.confd
003297c9ec93877508812332101c2bf5 ovs-vswitchd.initd
2d1e0111ea62779f49e14d62678294b2 ovs-vswitchd.confd
ae128e5c349710c0fb3849b2d3b3aa40 ovs-modules.initd
-6e17032bd6e7caf6e6e844b5a84d7080 musl-if_packet.patch"
+6e17032bd6e7caf6e6e844b5a84d7080 musl-if_packet.patch
+c424d9831533653c13eed336da5a9a79 0001-ovs-thread-Set-stacksize-to-1M.patch"
sha256sums="011052645cd4c7afee2732e87d45e589a0540ac7b7523027d3be2d7c7db7c899 openvswitch-2.3.0.tar.gz
b58a4bdab9ca035a9271067edadb19598985c55820f020d8aefe71b516a3e7f6 ovsdb-server.initd
d0d8a6a7256f4cc47ab1b9f9f7657202388133bcfff3668e7c1d4adbcc572261 ovsdb-server.confd
591d8c10080ba2fa2ddf5bf8da281d931421c95ff728f56fbaa10be7c3d8431c ovs-vswitchd.initd
cc189d5ca24708ff775a4de312df3f611c65714724b8901ec6527c9e3f22e14a ovs-vswitchd.confd
94f4dba5e2ddedb9c91911b02dbfc41a5114e8a5066a8db3ef4444ebb5400173 ovs-modules.initd
-d0e9e3e30b2943b10e7efa59c41c3bf8d5b599d55fc99198146bf4761df4d8ae musl-if_packet.patch"
+d0e9e3e30b2943b10e7efa59c41c3bf8d5b599d55fc99198146bf4761df4d8ae musl-if_packet.patch
+b871f395e8b4b34d48a84a42065eed86a9f10c42af121dd27740e587c01a7668 0001-ovs-thread-Set-stacksize-to-1M.patch"
sha512sums="f3a665bc84d8a6e282928db61ae648a826f273e44e34311a60e6f0e74a6ab10c8410cb374f0ce80abe7c58b9559a97388cdbfe2ef28ac4bedd2f5e52b3cd6ed1 openvswitch-2.3.0.tar.gz
6d660c986666b3f3b052d5ff6a8555c8bf5234fee8c4740d70974b1ac00ee2a0711e931494556290e18fce820ce8f2d4a5f25e40e9c863da9b639c18c0515763 ovsdb-server.initd
b1588d076bbfc7ef2dd46fce8e46186f40cbbc4667697f7ac13ddc68e34568fdab315fde47838de7f6d32916853190336cfe3735f672ad7cb624ae14dbff55a5 ovsdb-server.confd
3d493047a6729b7e0742438de828a2530acbcdac9c1c410786bf1eefb5e9f09850fb479f45245f550d1077146d4545fb91a845ae79f673b6c1c2902220920e33 ovs-vswitchd.initd
346aea099f51707d2b4fc9fdc8c1502582723fb4e00c4d5d1624b0378c94dfb76674fa95e2af894f36169df52109dbe441ee6a45aa744584d9e4c74d15a46c1d ovs-vswitchd.confd
e1f88ff11cd1d5a4025626acad49411e8a2d5d7caa20d0a63ef0422a9b1bb55b070843327d8bb209e1e915d2a3f1c3bcae911acf40e0a419bc6cce6250239232 ovs-modules.initd
-1ebfb2629081cc0b34383e6c2f163f3c1d43da3a399b8ba8745871b77029d3b8fc21a287ff859a6a9cca2cb4885715458d4e4086cb6c17765ff7c898d4004850 musl-if_packet.patch"
+1ebfb2629081cc0b34383e6c2f163f3c1d43da3a399b8ba8745871b77029d3b8fc21a287ff859a6a9cca2cb4885715458d4e4086cb6c17765ff7c898d4004850 musl-if_packet.patch
+ce2521c2eecb1f501c6512a13b7aba7d884ba80ea0a497c9ca16b3fd5c25f414d801a8fde3b1645811656f1fd1f6aecb70ea1738a0070bda58237bcad7fd8840 0001-ovs-thread-Set-stacksize-to-1M.patch"