Advanced Debugging Techniques and Strategies
CSE 598 – Applied Program Analysis and Debugging
Fall 2025
Fish Wang
Arizona State University
Becoming a Debugging Pro
2
A Step-by-step Guide
3
A Step-by-step Guide (Cont.)
4
Making the problem reproducible
5
Random exceptions in Python
... Snip ...
File "f:\angr\angr\angr\analyses\forward_analysis.py", line 557, in _analyze
self._analysis_core_graph()
File "f:\angr\angr\angr\analyses\forward_analysis.py", line 580, in _analysis_core_graph
changed, output_state = self._run_on_node(n, job_state)
File "f:\angr\angr\angr\analyses\variable_recovery\variable_recovery_fast.py", line 712, in _run_on_node
input_state = prev_state.merge(input_state, successor=node.addr)
File "f:\angr\angr\angr\analyses\variable_recovery\variable_recovery_fast.py", line 488, in merge
merged_register_region = self.register_region.copy().replace(replacements).merge(other.register_region,
File "f:\angr\angr\angr\keyed_region.py", line 159, in copy
kr._object_mapping = self._object_mapping.copy()
File "D:\My Program Files\Python37\lib\weakref.py", line 174, in copy
for key, wr in self.data.items():
RuntimeError: dictionary changed size during iteration
6
Random exceptions in Python
7
Random exceptions in Python
8
Random exceptions in Python
9
Random exceptions in Python
10
Random exceptions in Python
11
https://bugs.python.org/issue35615
https://github.com/python/cpython/pull/11384
Making hypotheses
12
Weird Network Jitters
13
Weird Network Jitters
14
Weird Network Jitters
15
A Key Observation
16
Weird Network Jitters
17
https://mnpn.dev/blog/airplay-network-disaster
Floats in Python
18
xmm0
00 00 00 00 aa 9d f4 36
3a 26 00 44 aa 9d f4 36
angr’s emulation
Real execution
Floats in Python
19
xmm0
00 00 00 00 aa 9d f4 36
3a 26 00 44 aa 9d f4 36
angr’s emulation
Real execution
IEEE 754
20
Mantissa
-1S x 2E x M
Floats in Bytes
21
xmm0
00 00 00 00 aa 9d f4 36
3a 26 00 44 aa 9d f4 36
angr’s emulation
Real execution
How does breakpoint work?
22
What instruction to use?
23
On ARM…
24
https://www.jwhitham.org/2015/04/the-mystery-of-fifteen-millisecond.html
14.8 milliseconds
9 microseconds
10 microseconds
10 microseconds
9 microseconds
One is slower than others?
25
One is slower than others?
26
What’s next?
27
DSCR value | Reason for entering debug | Handled? |
0 | A Halt DBGTAP instruction occurred | No |
1 | A breakpoint occurred | Yes |
2 | A watchpoint occurred | Yes |
3 | A BKPT instruction occurred | No |
Fallback code
28
Proper tools and artifacts
29
Tips for using debuggers
30
Understanding The Bug
31
Understanding The Bug
32
Differential Debugging
33
Differential Debugging (Cont.)
34
Poor Man’s Differential Debugging
35
Time Travel Debugging
36
Time Travel Debugging
37
Core dumps
38
A big problem in debugging
39
Questions?
40