@@ -109,11 +109,24 @@ impl LockMetadata {
109
109
// use that as the mutex construction site. The second frame should always be in
110
110
// debug_sync (the first may be in Backtrace itself).
111
111
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 ( ) {
113
127
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) ;
116
128
if !sync_mutex_constr_regex. is_match ( symbol_name) {
129
+ eprintln ! ( "Picked framepointer {:p}" , frame. ip( ) ) ;
117
130
ip = Some ( frame. ip ( ) as usize as u64 ) ;
118
131
break ;
119
132
}
0 commit comments