Debugging as a Science
CSE 598 – Applied Program Analysis and Debugging
Fall 2025
Fish Wang
Arizona State University
How I Solved The First Module
2
Debugging Your Program
3
4
The Very First Step
Explorer.exe Handle Leaks
6
D:\> handle64.exe -p explorer.exe -s -nobanner
Handle type summary:
…
Key : 1780
…
Total handles: 9744
Explorer.exe Handle Leaks
7
explorer.exe pid: 19428 type: Key 9C14: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore
explorer.exe pid: 19428 type: Key 9C1C: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.SortGroupsDescending
explorer.exe pid: 19428 type: Key 9C40: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore
explorer.exe pid: 19428 type: Key 9C48: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.Cancel
explorer.exe pid: 19428 type: Key 9C98: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.SortGroupsAscending
...
What Tools Should You Use?
8
What Tools Should You Use?
9
What Tools Should You Use?
10
What Tools Should You Use?
11
Requirements
12
Requirements
13
Transient Bugs
14
Transient Bugs (cont.)
15
Other Tools
16
Slow Duplicati
17
https://github.com/duplicati/duplicati/issues/3167
Slow services.exe
18
Slow services.exe
19
Slow GTA Online
20
https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/
Slow GTA Online
21
https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/
Slow UAC Dialog on Windows
22
Slow UAC Dialog on Windows
23
Slow UAC Dialog on Windows
24
Screenshot credit: https://randomascii.wordpress.com/2025/05/26/acronis-true-image-costs-performance-when-not-used/
Side Note: Reporting The Bug
25
Side Note: Reporting The Bug
26
Other Tools (cont.)
27
Broken Connections
28
Broken Connections (cont.)
29
Poor Man’s Logger (Profiler)
30
31
Debugging Others’ Programs
32
An Implicit Requirement
33
An Implicit Requirement
34
Understanding A Program
35
Understanding A Program
36
Understanding A Program
37
Understanding A Program
38
Educated Guesses
39
Educated Guesses
40
Educated Guesses
41
Educated Guesses
42
Variance Reduction
43
Binary Search
44
Git Bisect
40b15f3164cca196f794bb2c4d47b1d0a7a7bf9b
ab187ac80deeeaf2e4e0d60562169556cfa1bacf
838cc653e4af003df00a4abf0c1ca60d063661dd
b0b456b794ed1b42c0292b2db8dd80820c8cd5d4
dc499fea726781a4e609d3429536fce7e7a902e2
515ab0d0bcb150939584f09959d4e279f2d8d956
d5391f96394a9415da1d50caa07e8dc99103050d
45
Broken
Works
?
ls /tmp/ is taking forever
46
Complexity: Hard drives
47
Complexity: File systems
48
Complexity: Hidden behaviors
49
Complexity: Formatting Output
50
Complexity: The Actual Output
51
Where is the bottleneck?
52
Key Debugging Steps
Which process? Which executable? Which operation? Which input?
53
Slow Docker
54
Slow Docker
55
Unicorn Engine Running Slower
56
Unicorn Engine Running Slower
57
Unicorn Engine Running Slower
58
Unicorn Engine Running Slower
59
Unicorn Engine Running Slower
60
https://github.com/unicorn-engine/unicorn/pull/655
Questions?
61