diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-10-11 11:20:27 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-10-11 12:32:09 -0700 |
| commit | 963fc79e271e56d323b626f2ca1d214ad74c3e4d (patch) | |
| tree | 40ed0b1bff37335f035116eb4b7b9f627a18576d /meta-oe/recipes-support/poco | |
| parent | 9f312824d429603417109eb08d13d260d6231361 (diff) | |
| download | meta-openembedded-963fc79e271e56d323b626f2ca1d214ad74c3e4d.tar.gz | |
poco: Fix data race when create POSIX thread
This back fixes the ptest failures seen with musl
AssertionError:-
Failed ptests:
{'poco': ['Foundation-testrunner', 'NetSSL-testrunner', 'Net-testrunner']}
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/poco')
| -rw-r--r-- | meta-oe/recipes-support/poco/poco/0001-Fix-data-race-when-create-POSIX-thread.patch | 33 | ||||
| -rw-r--r-- | meta-oe/recipes-support/poco/poco_1.12.4.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/poco/poco/0001-Fix-data-race-when-create-POSIX-thread.patch b/meta-oe/recipes-support/poco/poco/0001-Fix-data-race-when-create-POSIX-thread.patch new file mode 100644 index 0000000000..1a7f4dcdca --- /dev/null +++ b/meta-oe/recipes-support/poco/poco/0001-Fix-data-race-when-create-POSIX-thread.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 03b68fc924b24e12c87512d790d37fc6ddc352ac Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Dawid Drozd <drozddawid@gmail.com> | ||
| 3 | Date: Sat, 11 Feb 2023 14:48:39 +0400 | ||
| 4 | Subject: [PATCH] Fix data race when create POSIX thread | ||
| 5 | |||
| 6 | When creating thread using pthread_create() `_pData->thread` will be set. | ||
| 7 | It could lead to data race as in runnableEntry() we refer to that variable. | ||
| 8 | |||
| 9 | Instead use pthread_self(). | ||
| 10 | getName() is already under mutex. | ||
| 11 | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | Upstream-Status: Backport [https://github.com/pocoproject/poco/pull/3942/commits/9c8a79b994a367f626c5551e0f38c27d0d8431f1] | ||
| 14 | --- | ||
| 15 | Foundation/src/Thread_POSIX.cpp | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/Foundation/src/Thread_POSIX.cpp b/Foundation/src/Thread_POSIX.cpp | ||
| 19 | index ceab76e82..3e52cd31f 100644 | ||
| 20 | --- a/Foundation/src/Thread_POSIX.cpp | ||
| 21 | +++ b/Foundation/src/Thread_POSIX.cpp | ||
| 22 | @@ -351,7 +351,7 @@ void* ThreadImpl::runnableEntry(void* pThread) | ||
| 23 | #endif | ||
| 24 | |||
| 25 | ThreadImpl* pThreadImpl = reinterpret_cast<ThreadImpl*>(pThread); | ||
| 26 | - setThreadName(pThreadImpl->_pData->thread, reinterpret_cast<Thread*>(pThread)->getName()); | ||
| 27 | + setThreadName(pthread_self(), reinterpret_cast<Thread*>(pThread)->getName()); | ||
| 28 | AutoPtr<ThreadData> pData = pThreadImpl->_pData; | ||
| 29 | try | ||
| 30 | { | ||
| 31 | -- | ||
| 32 | 2.42.0 | ||
| 33 | |||
diff --git a/meta-oe/recipes-support/poco/poco_1.12.4.bb b/meta-oe/recipes-support/poco/poco_1.12.4.bb index 8505f66e8b..12532e4ef1 100644 --- a/meta-oe/recipes-support/poco/poco_1.12.4.bb +++ b/meta-oe/recipes-support/poco/poco_1.12.4.bb | |||
| @@ -11,6 +11,7 @@ DEPENDS = "libpcre2 zlib" | |||
| 11 | SRC_URI = "git://github.com/pocoproject/poco.git;branch=master;protocol=https \ | 11 | SRC_URI = "git://github.com/pocoproject/poco.git;branch=master;protocol=https \ |
| 12 | file://0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch \ | 12 | file://0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch \ |
| 13 | file://0001-cppignore.lnx-Ignore-PKCS12-and-testLaunch-test.patch \ | 13 | file://0001-cppignore.lnx-Ignore-PKCS12-and-testLaunch-test.patch \ |
| 14 | file://0001-Fix-data-race-when-create-POSIX-thread.patch \ | ||
| 14 | file://run-ptest \ | 15 | file://run-ptest \ |
| 15 | " | 16 | " |
| 16 | SRCREV = "1211613642269b7d53bea58b02de7fcd25ece3b9" | 17 | SRCREV = "1211613642269b7d53bea58b02de7fcd25ece3b9" |
