forked from scylladb/seastar
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decode kernel backtraces in seastar-addr2line
This change implements best-effort kernel backtrace decoding using /proc/kallsyms. We look up the kernel address against the addresses fro kallsyms and report the symbol with the largest-but-not-greater address. This file is only avalible to non-root users if: /proc/sys/kernel/kptr_restrict is set to 0, it defaults to 1, for security. If the file is not accessible or the above tunable isn't set we do not decode kernel addresses. That /proc/kallsyms file lists the true addresses of all kernel symbols in the running kernel. "True" here refers to the fact that under KASLR the address in the kernel image will in general not be the same as the address in the running kernel: they will vary by a random offset that changes each boot. This means that decoding only works on the machine that generated the backtrace and only until the next reboot. If these conditions are violated, we don't detect it directly, but in the case of KASLR we will probably at least fail to decode everything as the entire block of symbols moves enough that addresses will be invalid. Without KASLR and when decoding against the "wrong" kallsyms file you will probably just get a bogus backtrace, i.e., ones where callees don't call the callees shown, etc.
- Loading branch information
1 parent
baaccf1
commit 0af8ee3
Showing
2 changed files
with
138 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters