Make `debug_sync` regex more robust 2022-01-lockorder-windows-robust
authorMatt Corallo <git@bluematt.me>
Tue, 10 Jan 2023 06:37:39 +0000 (06:37 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 10 Jan 2023 06:48:04 +0000 (06:48 +0000)
commitab46f6b988c9c6f1e4fdc0d8f549dd64a1c07fcf
tree984bee4a0c1c2eaaeb028b82457de18bc8379963
parent230331f3e8efe9cee0ad2dc1644051bd9679a01f
Make `debug_sync` regex more robust

On windows the symbol names appear to sometimes be truncated,
which causes the symbol name to not include the `::new` at the end.
This causes the regex to mis-match and track the wrong location
for the mutex construction, leading to bogus lockorder violations.

For example, in testing the following symbol name appeared on
Windows, without the function name itself:

`lightning::debug_sync::RwLock<std::collections::hash::map::HashMap<lightning::chain::transaction::OutPoint,lightning::chain::chainmonitor::MonitorHolder<lightning::util::enforcing_trait_impls::EnforcingSigner>,std::collections::hash::map::RandomState> >::`
lightning/src/sync/debug_sync.rs