svn commit: r512986 - in head/sysutils/intel-pcm: . files
Warner Losh
imp at FreeBSD.org
Thu Sep 26 20:53:43 UTC 2019
Author: imp
Date: Thu Sep 26 20:53:42 2019
New Revision: 512986
URL: https://svnweb.freebsd.org/changeset/ports/512986
Log:
The code creates a lambda function that takes by reference the core_id local
variable, and pass it to a thread that often executes after constructor has
exited causing per-core thread to use a corrupted core_id.
Depending on compiler and runtime execution (and whether executing over gdb),
the tool might segfault or have incorrect behavior.
This makes sure the lambda function takes copy of automatic variable in
enclosing environment.
Submitted upstream as https://github.com/opcm/pcm/pull/162
Submitted by: Loic Prylli
Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D21804
Added:
head/sysutils/intel-pcm/files/patch-cpucounters.cpp (contents, props changed)
Modified:
head/sysutils/intel-pcm/Makefile (contents, props changed)
Modified: head/sysutils/intel-pcm/Makefile
==============================================================================
--- head/sysutils/intel-pcm/Makefile Thu Sep 26 20:40:02 2019 (r512985)
+++ head/sysutils/intel-pcm/Makefile Thu Sep 26 20:53:42 2019 (r512986)
@@ -3,6 +3,7 @@
PORTNAME= intel-pcm
PORTVERSION= 201902
+PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= imp at FreeBSD.org
Added: head/sysutils/intel-pcm/files/patch-cpucounters.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/intel-pcm/files/patch-cpucounters.cpp Thu Sep 26 20:53:42 2019 (r512986)
@@ -0,0 +1,11 @@
+--- cpucounters.cpp
++++ cpucounters.cpp
+@@ -1617,7 +1617,7 @@ class CoreTaskQueue
+ CoreTaskQueue(CoreTaskQueue &) = delete;
+ public:
+ CoreTaskQueue(int32 core) :
+- worker([&]() {
++ worker([=]() {
+ TemporalThreadAffinity tempThreadAffinity(core);
+ std::unique_lock<std::mutex> lock(m);
+ while (1) {
More information about the svn-ports-head
mailing list