-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread save key detect #2113
Thread save key detect #2113
Conversation
Save the values into a new buffer, normalized for zero average.
I still don't spot any thread-safety issues?? Those pseudo-constant static arrays should not cause any harm, neither before nor after your changes. The elements will be initialized before the first analysis starts and are never changed ever after. |
Oh, no, now I see it. It's in MathUtilities::circShift()!! OMG, that's really, really, bad |
One more reason to stick with Rust! The compiler prevents most of the ridiculous bullshit a mediocre developer (like me) tries to write. |
Does this mean #2009 can be reverted? |
Not sure. The bug is not able to trigger a segfault and that's what I remember what we have experienced casually. This fix only ensures that no bogus values are returned. |
There might be more and even more serious bugs hidden in the code, which looks like it has been ported literally from Mathlab without carefully considering those technical aspects. |
|
||
m_MajProfileNorm = new double[m_BPO]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_BPO is just the constant 36. Static allocation would work for all those arrays as well as a single dynamic allocation with partitioning/slicing.
Thanks @Be-ing for checking this out. That's what I planned to do now. So this will finally allow us to unleash the full power of the multi-threaded analysis!! |
Please rebase after #2112 has now been merged. |
Done. CI has timed out. |
This was superseded by #2136 and can be closed. |
This fixes that a global buffers is used from the key detector object. Now every object used is own instance.
This PR also removes some intermediate buffers.
Currently we don't even need to copy the buffer locally if we store the but I have kept using it, because I do not want to alter the numbers from the original profiles which are taken from an academic paper.