aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/symbolizer
Commit message (Collapse)AuthorAgeFilesLines
* pkg/symbolizer: fix parser handling of small hex valuesjodaco2025-08-181-1/+1
| | | | | | The parser in symbolizer was incorrectly handling values of 0x0-0xf. Fixes #6290
* all: manual linter fixesTaras Madan2025-07-171-1/+0
| | | | | | | | 1. recover the removed comment 2. unnecessary leading newline 3. unnecessary brackets 4. restore dropped "..." 5. use bytes.Equal instead of conversion to string
* all: apply linter auto fixesTaras Madan2025-07-171-4/+2
| | | | ./tools/syz-env bin/golangci-lint run ./... --fix
* pkg/symbolizer: retain the frame if line number is 0Jiao, Joey2025-03-262-1/+19
| | | | | | | | | There are numerous line_entries with a line number of 0 for __sanitizer_cov_trace_pc. Currently, if only one program counter (PC) is hit in the function and the line number is 0 for that PC, the frame is ignored. To accurately report function coverage, we should include the function in such cases.
* pkg/symbolizer: introduce Symbolizer interfaceTaras Madan2025-03-077-196/+206
| | | | To simplify interface Read*Symbols were moved out from symbolizer.Symbolizer.
* pkg/symbolizzer: use thread safe sync.Map to avoid concurrency issueJoey Jiao2024-06-111-7/+4
|
* pkg/symbolizer: remove unused parameter: targetJoey Jiao2024-05-091-7/+5
|
* tools/syz-linter: check t.Logf/Errorf/Fatalf messagesDmitry Vyukov2024-04-171-2/+2
| | | | | Fix checking of Logf, it has string in 0-th arg. Add checking of t.Errorf/Fatalf.
* pkg/symbolizer: intern file/func stringsDmitry Vyukov2024-04-103-10/+35
| | | | | | | | Intern/deduplicate file/func strings created during symbolization. There are lots and lots of duplicates. In my local run syz-manager heap size jumps from 1.9G to 4.0G are requesting /cover?jsonl=1 without this change, and from 1.9G to 2.9G with this change.
* pkg/symbolizer: use llvm-addr2lineDmitry Vyukov2024-04-091-27/+1
| | | | | | | | | Use llvm-addr2line instead of addr2line if it's available. llvm-addr2line seems to be way faster than llvm-addr2line and consumes less memory on syzbot's vmlinux. Also move the detection logic to sys/targets since that's where we generally do this type of logic. This also allows to reuse addr2line binary in other packages if needed.
* pkg/symbolizer: add Cache typeDmitry Vyukov2024-04-022-0/+80
| | | | | | | | When the same crash happens all over again, we repeatedly symbolize the same PCs. This is slow and blocks VM loop in the manager. Cache PCs we already symbolize, we are likely to symbolize them again.
* all: use special placeholder for errorsTaras Madan2023-07-242-5/+5
|
* pkg/symbolizer: skip the elf.SHF_WRITE checkAleksandr Nogikh2023-07-131-1/+2
| | | | | | | | | The remaining checks (elf.SHF_ALLOC and elf.SHF_EXECINSTR) seem to a good enough filter for matching symbols. Additionally, there have already been cases when absolutely valid functions ended up in SHF_WRITE sections: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=0fddb79bf283
* pkg/symbolizer: match kernel symbol size calculationDmitry Vyukov2022-10-062-11/+36
| | | | | | | Function sizes reported by the Linux kernel do not match symbol tables. The kernel computes size of a symbol based on the start of the next symbol. We need to do the same to match kernel sizes to be able to find the right symbol across multiple symbols with the same name.
* pkg/symbolizer: limit addr2line output checks to DarwinMark Johnston2022-06-011-2/+5
| | | | | The checks assume that addr2line comes from binutils, but by default this is not the case on FreeBSD.
* pkg/symbolizer: extend error messageDmitry Vyukov2022-01-201-1/+1
|
* pkg/symbolizer: switch to debug/elf for symbol extractionDmitry Vyukov2022-01-131-61/+23
| | | | Using debug/elf is better on all fronts: faster, simpler, no external deps.
* pkg/symbolizer: set LC_ALL to C when launching addr2line checkPatrick Meyer2021-06-241-0/+2
| | | | | As the --help message is localised, this check will fail on systems with non english locales otherwise.
* pkg/symbolizer: check if binutils was build with macho supportPatrick Meyer2021-05-201-0/+21
|
* Revert "all: add KernelModule cfg to show DLKM coverage"Dmitry Vyukov2021-03-052-17/+10
| | | | This reverts commit 69a06ca2b532ff4021a43fdead4e2ac1452a44c0.
* all: add KernelModule cfg to show DLKM coverageJoey Jiao2021-03-052-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PC returned for dynamic loaded module (DLKM) is not parsed in coverage page. So the commit is to use DLKM modules' load address to restore the PC and show coverage data of DLKM. As the load address is written in cfg file, so kaslr needs to be disabled. And for linux target, load address is getting from /proc/modules during instance setup. For either manual or auto address setting case, name and path are needed in config kernel_modules, where name is module name on target. path is module unstripped object path on host. addr is decimal value of module load address on target. Example of config: "kernel_modules": [ { "name": "nf_nat", "path": "/usr/src/linux-source/net/netfilter/nf_nat.ko", "addr": 18446744072637911040 } ]
* all: fix dup types in func argsDmitry Vyukov2020-07-041-1/+1
|
* pkg: support compiler triple for 'nm' and 'addr2line'Alexander Egorenkov2020-06-183-10/+22
| | | | In preparation to support big-endian architectures.
* .golangci.yml: enable godot checkerDmitry Vyukov2020-06-051-1/+1
| | | | | A good one. Lots of fixed comments are contributed by episodic contributors. So it's good to catch these earlier.
* tools/syz-check: check netlink policy descriptionsDmitry Vyukov2020-01-222-7/+23
| | | | | | | | | | | | | | Overall idea of netlink checking. Currnetly we check netlink policies for common detectable mistakes. First, we detect what looks like a netlink policy in our descriptions (these are structs/unions only with nlattr/nlnext/nlnetw fields). Then we find corresponding symbols (offset/size) in vmlinux using nm. Then we read elf headers and locate where these symbols are in the rodata section. Then read in the symbol data, which is an array of nla_policy structs. These structs allow to easily figure out type/size of attributes. Finally we compare our descriptions with the kernel policy description. Update #590
* pkg/symbolizer: favor portable nm(1) formatAnton Lindqvist2018-09-242-24/+40
| | | | | | | | | On OpenBSD, nm(1) does not support the `-S' option. The order of symbols from nm(1) varies between platforms, therefore rework the test case to cope with that. Fixes #723
* pkg/symbolizer: skip nm tests on non-linuxDmitry Vyukov2018-09-171-0/+5
| | | | The test fails on openbsd, and probably everything else other than linux.
* .gometalinter.json: enable gofmtDmitry Vyukov2018-07-311-5/+5
| | | | | | | The part that we want from gofmt is simplify (-s). Fix all code that needs fixing. Update #538
* all: fix gometalinter warningsDmitry Vyukov2018-03-082-5/+10
| | | | Fix typos, non-canonical code, remove dead code, etc.
* pkg/osutil: don't leace runaway processesDmitry Vyukov2017-11-162-3/+6
| | | | | | When manager is stopped there are sometimes runaway qemu processes still running. Set PDEATHSIG for all subprocesses. We never need child processes outliving parents.
* pkg/symbolizer: fix race on inputr in testDmitry Vyukov2017-07-251-0/+6
| | | | Pointed out by race detector.
* pkg/symbolizer: move from symbolizerDmitry Vyukov2017-06-175-0/+492