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
refactor: fix undefined behavior and cleanup lock debugging code #3313
base: 1.15.0-dev
Are you sure you want to change the base?
refactor: fix undefined behavior and cleanup lock debugging code #3313
Conversation
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.
All tests pass on x86-64 Linux and my first skim of the code looks correct. I'll review the linked commits in more detail.
yeah no complaints re headless unit testing/qa on m2 👍 |
i did however fail a couple times in a for range 10 loop for qa on m2 but i think we'll be able to iron out that stuff now that debugging on dogecoin binaries is upgraded + the getmocktime stuff i'm looking into 👍 |
I'm having some issues reproducing deadlock detection on macOS w/ a set of wip code that I know to have the issue (and does trigger both before and after this PR on x86_64 linux w/ gcc12). Because the code in question is networking related, and of course we use a newer boost on macOS arm64 local builds, and we use clang instead of gcc... there can be a handful of potential causes. Therefore I'm putting this back into draft, pending addition of a unit test. I'm sorry for opening this too soon. |
eb9b160
to
3489351
Compare
I've rebased this on top of 1.15.0-dev |
Removes undefined behavior by refactoring the way we destruct objects that track mutexes when debugging. 1. Prevent UB from LockData custom destructor by making it implicit 2. Replace the thread_specific_ptr holding the lock stack with a static map that stores it per thread. Also cleans up the aliasing to make the code better readable. Backported from: 458992b 8d8921a f511f61 58e6881 26c093a Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>
Removes boost dependencies in sync.cpp in favor of standard c++ for-loops, improving readability.
Cherry-picked from: 41b88e9
3489351
to
11f5dd6
Compare
All unit and qa tests passed on x86_64-linux jammy. All unit tests passed on M2 but I encountered an issue with asyncore deprecation that I have to figure out. I don't think that issue should block this though. |
Yes, we'll have to fix that separately - not related to this code. Would you mind filing an issue with a log? |
My pleasure. |
ACK. #3524 |
This was triggered by and fixes #3305 (comment)
Removes undefined behavior by refactoring the way we destruct objects that track mutexes when debugging.
LockData
custom destructor by making it implicitthread_specific_ptr
holding the lock stack with a static map that stores it per thread.Backported from:
Note to testers: this functionality is only compiled in when using
-DDEBUG_LOCKORDER
, this is set with./configure --enable-debug
.