aboutsummaryrefslogtreecommitdiffstats
path: root/main/freeswitch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-08-17 14:23:38 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-17 14:31:04 +0200
commitc061fce149110378345eb286958a0648cacee76b (patch)
tree27d685e44831424835addec98fe89cba366d3c56 /main/freeswitch
parent60495944150585cc30f0f85cce8c5526f349d4f7 (diff)
downloadaports-c061fce149110378345eb286958a0648cacee76b.tar.bz2
aports-c061fce149110378345eb286958a0648cacee76b.tar.xz
main/freeswitch: set threading priority before thread is created
This should fix segfault that happens when pthread_setschedparam is called ona thread that already exited.
Diffstat (limited to 'main/freeswitch')
-rw-r--r--main/freeswitch/APKBUILD18
-rw-r--r--main/freeswitch/fix-pthread-sched.patch38
2 files changed, 49 insertions, 7 deletions
diff --git a/main/freeswitch/APKBUILD b/main/freeswitch/APKBUILD
index 0edefcb780..eb8c74d606 100644
--- a/main/freeswitch/APKBUILD
+++ b/main/freeswitch/APKBUILD
@@ -3,7 +3,7 @@
# Contributor: Cameron Banta <cbanta@gmail.com>
pkgname=freeswitch
pkgver=1.4.19
-pkgrel=1
+pkgrel=2
pkgdesc="A communications platform written in C from the ground up"
url="http://www.freeswitch.org"
arch="all"
@@ -69,6 +69,7 @@ source="http://files.freeswitch.org/$pkgname-$pkgver.tar.xz
libshout-disable-examples.patch
freeswitch-mod_shout-textrels.patch
system-lame.patch
+ fix-pthread-sched.patch
"
_builddir="$srcdir/$pkgname-$pkgver"
@@ -209,7 +210,7 @@ conf() {
mkdir -p "$pkgdir"/etc/freeswitch/scripts
}
-md5sums="6c0d11a132b7aba6229d28ba9dfeaea5 freeswitch-1.4.19.tar.xz
+md5sums="b022de109946ea6cbd54ab89a1a74c05 freeswitch-1.4.19.tar.xz
4653b3b9c568bb9c782178abfaac128d freeswitch-json-c-0.9.tar.gz
645db96ffc296cbb6d37f231cc1cc6b2 freeswitch-flite-2.0.0-release.tar.bz2
8e9866ad6b570c6c95c8cba48060473f freeswitch-lame-3.98.4.tar.gz
@@ -221,8 +222,9 @@ c608cca8ad773acebf201f581438c7e7 freeswitch.confd
d823b7fd353c9a95467e736e4a226b74 freeswitch.initd
90b133b14a42c86d53d5e54dcbfbaf58 libshout-disable-examples.patch
4cd4923463c89bed053e6295b5a4ec40 freeswitch-mod_shout-textrels.patch
-6a6c4aba80e99c236ef712b17f3cdd01 system-lame.patch"
-sha256sums="cc5f9f23d181889cf714b6747e12d322e6ed4adb35b7ae6b6a6dd99b6d8b6fe0 freeswitch-1.4.19.tar.xz
+6a6c4aba80e99c236ef712b17f3cdd01 system-lame.patch
+077b00789cf6b108283819cc105faa00 fix-pthread-sched.patch"
+sha256sums="0c257f8731fb2bfe4dfafe26ef1458c4dea00859f089092b2e75df01bc7dbf7e freeswitch-1.4.19.tar.xz
816fb2d4baab09e2f51a7c1be75bc9e03ed09d4cf3c2cd03c183f433bb9b565f freeswitch-json-c-0.9.tar.gz
678c3860fd539402b5d1699b921239072af6acb4e72dc4720494112807cae411 freeswitch-flite-2.0.0-release.tar.bz2
ac3144c76617223a9be4aaa3e28a66b51bcab28141050c3af04cb06836f772c8 freeswitch-lame-3.98.4.tar.gz
@@ -234,8 +236,9 @@ f83f9680d243eb254bf045571f971a6c5cf716367444cd48ed26d4c3367f4c41 modules.conf
9b5429cb74f4626c427f7ab198ad0487d8a20c0077e8612b845eca8318273baa freeswitch.initd
db0d3c252b5664ecb071bcf6868eff77c85dd7943a63fcfcac7e19db6a0ff61f libshout-disable-examples.patch
be1009327de615f04956ba0b0f44183f31c263e380af8027f94b976a84bcb09a freeswitch-mod_shout-textrels.patch
-11b107ca8632bb9c8fcb2aedfcfb421af24929aace4f56c34d4e701eb410e190 system-lame.patch"
-sha512sums="144bd408e94bd04d325dc4a933927bde792d1bc89804b0cd471526197aa3186d52867c4e266f637026b9d27326eafcb288f9ed1ccaa8907157935f5a1e765372 freeswitch-1.4.19.tar.xz
+11b107ca8632bb9c8fcb2aedfcfb421af24929aace4f56c34d4e701eb410e190 system-lame.patch
+84e0150f217bc10d0a66d532cc4726ab74928bf10e68e7cad0dc419cf998ffa9 fix-pthread-sched.patch"
+sha512sums="9d334abc28367cfcf4bae5ce6e61b8f166407b7623493266364ede6ccde116e60bf7512bfe261f795a94659f538b780a5584c90eae03030cd8e3d1e03ab9941f freeswitch-1.4.19.tar.xz
38b8729275bbfebaee783e703d19481f3d32b50cfdeb338644b8db2742573ea025702c789b5ce8d5067dcde23c5a16b46231eaadf0b9c5dbff392d410912c772 freeswitch-json-c-0.9.tar.gz
e2b353721d0316fbd7948f90f9c9561d080eebd50e8dd0449a9c803ffbdb060a469385fadd63f535ade8d627cba37928d8e72ac61d5bcf98f73ca5ebb66549f8 freeswitch-flite-2.0.0-release.tar.bz2
cf6cff914c06c2d65470c577eed2bfa226e9017cdfd26aa3e95c3b3b76c40568151ca223327859d6dacb982c80c06b672ba4e9f32ce1e452363c95126edb301b freeswitch-lame-3.98.4.tar.gz
@@ -247,4 +250,5 @@ a585f6411185a26206137a1ad97a06fd6c73e80c5439e9be45eabfa70e7a83120169ba882971fcd3
d823ce7924f281b5808ffec0cd99569cd161b0749eca77dd076ea0dc86502e4d767c2fd2ff0d0c9c7ff67df3e077769268024a8e447a3ca19f77f28a2de775a4 freeswitch.initd
91a6d7c8456de65855930b371f568f0230c28422e667453aa48fababd185b47677c06ff0c79f94c2a02182439b012d48cb54548cbde3d12b8d0e1ffbb9b229cc libshout-disable-examples.patch
5f085254ca9f5dc196afd39fc55e083b1998e776d9de2428e5657d99077526c33c1fc13f12432598184ce63138447fed7c318c384b743681703f5682dc8e1e50 freeswitch-mod_shout-textrels.patch
-398dd0f2665415ff40348dc94d26ec7008fb59ec033f9d2c64dc1aa01071021f83f47954e95efc58c4033f22bb6da159e83e3b0d36b99189d5e7535ed6ae70bd system-lame.patch"
+398dd0f2665415ff40348dc94d26ec7008fb59ec033f9d2c64dc1aa01071021f83f47954e95efc58c4033f22bb6da159e83e3b0d36b99189d5e7535ed6ae70bd system-lame.patch
+c2b42c3504e62ce57e2781c5128fe82d9fb73f8202d561d7a2e6bfaa86ea2d53c4bdfce1b8ff34939729ee30a736e5e751e926bf4a56ebbd0c81e2d82debf90d fix-pthread-sched.patch"
diff --git a/main/freeswitch/fix-pthread-sched.patch b/main/freeswitch/fix-pthread-sched.patch
new file mode 100644
index 0000000000..8cb6d28715
--- /dev/null
+++ b/main/freeswitch/fix-pthread-sched.patch
@@ -0,0 +1,38 @@
+Set sched param via pthread_attr_* before thread is created.
+
+This fixes segfault when trying to modify scheduling priority if thread
+exits before pthread_setschedparam() is called.
+
+diff --git a/libs/apr/threadproc/unix/thread.c b/libs/apr/threadproc/unix/thread.c
+index 8859e79..a34e29f 100644
+--- a/libs/apr/threadproc/unix/thread.c
++++ b/libs/apr/threadproc/unix/thread.c
+@@ -174,19 +174,16 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
+ return stat;
+ }
+
+- if ((stat = pthread_create(&tt, temp, dummy_worker, (*new))) == 0) {
+-
+-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
+- if (attr && attr->priority) {
+- int policy;
+- struct sched_param param = { 0 };
+-
+- pthread_getschedparam(tt, &policy, &param);
+- param.sched_priority = attr->priority;
+- pthread_setschedparam(tt, policy, &param);
+- }
+-#endif
++ if (attr && attr->priority) {
++ struct sched_param param;
++ if (pthread_attr_getschedparam(&attr->attr, &param) == 0) {
++ param.sched_priority = attr->priority;
++ pthread_attr_setschedparam(&attr->attr, &param);
++ pthread_attr_setinheritsched(&param, PTHREAD_EXPLICIT_SCHED);
++ }
++ }
+
++ if ((stat = pthread_create(&tt, temp, dummy_worker, (*new))) == 0) {
+ *(*new)->td = tt;
+
+ return APR_SUCCESS;