-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdecode_asan.sh
More file actions
executable file
·37 lines (31 loc) · 1.12 KB
/
decode_asan.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Helper script to decode AddressSanitizer stack traces
BINARY="${1:-wikidata_cli_debug}"
if [ ! -f "$BINARY" ]; then
echo "❌ Error: Binary '$BINARY' not found"
echo "Usage: $0 <path-to-binary>"
echo ""
echo "Looking for the binary in common locations..."
find . -name "wikidata_cli*" -type f 2>/dev/null
exit 1
fi
echo "📍 Using binary: $BINARY"
echo ""
echo "To decode a specific address from the stack trace:"
echo " addr2line -e $BINARY -f -C -i <address>"
echo ""
echo "Example from your error (replace with actual addresses):"
echo " addr2line -e $BINARY -f -C -i 0x569372c1d194"
echo ""
echo "----------------------------------------"
echo ""
echo "To run your program with symbols enabled:"
echo " ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \\"
echo " ASAN_OPTIONS='symbolize=1:detect_leaks=0:abort_on_error=1' \\"
echo " $BINARY [args]"
echo ""
echo "To get more detailed output:"
echo " ASAN_OPTIONS='symbolize=1:detect_leaks=0:abort_on_error=1:print_stacktrace=1' \\"
echo " ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \\"
echo " RUST_BACKTRACE=full \\"
echo " $BINARY [args]"