diff options
author | Warner Losh <imp@FreeBSD.org> | 2019-09-26 20:53:42 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2019-09-26 20:53:42 +0000 |
commit | 72f722fa373052b00bf8b1b50fd6a9261a80940d (patch) | |
tree | f30e70cb238548c53841197ca2775ee921361589 /sysutils/intel-pcm | |
parent | 8a54d36ea6764e5291f8e1dc6f0a3e39370cdfc0 (diff) | |
download | ports-72f722fa373052b00bf8b1b50fd6a9261a80940d.tar.gz ports-72f722fa373052b00bf8b1b50fd6a9261a80940d.zip |
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
Notes
Notes:
svn path=/head/; revision=512986
Diffstat (limited to 'sysutils/intel-pcm')
-rw-r--r-- | sysutils/intel-pcm/Makefile | 1 | ||||
-rw-r--r-- | sysutils/intel-pcm/files/patch-cpucounters.cpp | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sysutils/intel-pcm/Makefile b/sysutils/intel-pcm/Makefile index eff0c691017c..d75bde0bb392 100644 --- a/sysutils/intel-pcm/Makefile +++ b/sysutils/intel-pcm/Makefile @@ -3,6 +3,7 @@ PORTNAME= intel-pcm PORTVERSION= 201902 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= imp@FreeBSD.org diff --git a/sysutils/intel-pcm/files/patch-cpucounters.cpp b/sysutils/intel-pcm/files/patch-cpucounters.cpp new file mode 100644 index 000000000000..2b2f2b5e1a60 --- /dev/null +++ b/sysutils/intel-pcm/files/patch-cpucounters.cpp @@ -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) { |