Skip to content

Commit 7d9ba2f

Browse files
committed
CI DEBUG
1 parent 0a3c912 commit 7d9ba2f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

lightning/src/debug_sync.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,24 @@ impl LockMetadata {
109109
// use that as the mutex construction site. The second frame should always be in
110110
// debug_sync (the first may be in Backtrace itself).
111111
let sync_mutex_constr_regex = regex::Regex::new(r"lightning.*debug_sync.*new").unwrap();
112-
for (idx, frame) in backtrace.frames().iter().enumerate() {
112+
for frame in backtrace.frames() {
113+
for symbol in frame.symbols() {
114+
eprint!("{} ", symbol.name().unwrap().as_str().unwrap());
115+
}
116+
eprintln!("- {:p}", frame.ip());
117+
}
118+
assert!(sync_mutex_constr_regex.is_match(backtrace.frames()[0].symbols().last().unwrap().name().unwrap().as_str().unwrap()) ||
119+
sync_mutex_constr_regex.is_match(backtrace.frames()[1].symbols().last().unwrap().name().unwrap().as_str().unwrap()) ||
120+
sync_mutex_constr_regex.is_match(backtrace.frames().get(2).map(|f| f.symbols().last().unwrap().name().unwrap().as_str().unwrap()).unwrap_or("")) ||
121+
sync_mutex_constr_regex.is_match(backtrace.frames().get(3).map(|f| f.symbols().last().unwrap().name().unwrap().as_str().unwrap()).unwrap_or("")) ||
122+
sync_mutex_constr_regex.is_match(backtrace.frames().get(4).map(|f| f.symbols().last().unwrap().name().unwrap().as_str().unwrap()).unwrap_or("")) ||
123+
sync_mutex_constr_regex.is_match(backtrace.frames().get(5).map(|f| f.symbols().last().unwrap().name().unwrap().as_str().unwrap()).unwrap_or("")) ||
124+
sync_mutex_constr_regex.is_match(backtrace.frames().get(6).map(|f| f.symbols().last().unwrap().name().unwrap().as_str().unwrap()).unwrap_or("")),
125+
"should contain lightning...debug_sync...new");
126+
for frame in backtrace.frames() {
113127
let symbol_name = frame.symbols().last().unwrap().name().unwrap().as_str().unwrap();
114-
assert!(idx != 1 || sync_mutex_constr_regex.is_match(symbol_name),
115-
"{} should contain lightning...debug_sync...new", symbol_name);
116128
if !sync_mutex_constr_regex.is_match(symbol_name) {
129+
eprintln!("Picked framepointer {:p}", frame.ip());
117130
ip = Some(frame.ip() as usize as u64);
118131
break;
119132
}

0 commit comments

Comments
 (0)