aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/report_test.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/report: move TitleToCrashType to crash packageDmitry Vyukov2026-01-091-1/+1
| | | | | | | | | TitleToCrashType is a simple function with no heavy dependencies that is used by the dashboard app. Currnetly we have to import pkg/report into dashboard/app, and this package has lots of heavy deps (symbolizer, demangler, coverage report generation, etc). Move TitleToCrashType to pkg/report/crash (where it arguably belongs anyway).
* pkg/report: tune tests generationTaras Madan2026-01-091-1/+7
| | | | | 1. We use empty TITLE and TITLE absence. Let's use TITLE absence by default. 2. FRAME header shouldn't be generated, only updated.
* pkg/report: don't print empty FRAME in failing testsTaras Madan2025-10-301-5/+5
| | | | | There is no need to see empty FRAME: field content in failing pkg/report tests. This change allow us to remove 1 parameter.
* pkg/manager: store tail reportsTaras Madan2025-08-281-0/+35
| | | | Send only the first report to dashboard.
* dashboard/app: use crash types instead, no regexpsTaras Madan2025-07-021-1/+1
|
* pkg/report: factor out type definitionsTaras Madan2025-06-271-4/+1
|
* pkg/report: demangle Rust reportsAleksandr Nogikh2025-06-181-2/+41
| | | | | | | | Do demangling as a part of Symbolize() processing. Add a TestSymbolize test to verify the results. Fix old report_test.go bugs to better react to the -update flags. Closes #6035.
* pkg/report: refactor parse testsAleksandr Nogikh2024-08-221-51/+71
| | | | The linter is complaining about a too high code complexity.
* pkg/report: extract the syz-executor infoAleksandr Nogikh2024-08-221-6/+15
| | | | | For Linux bugs, extract the proc id and the prog id from the crash report.
* tools/syz-linter: check t.Logf/Errorf/Fatalf messagesDmitry Vyukov2024-04-171-6/+6
| | | | | Fix checking of Logf, it has string in 0-th arg. Add checking of t.Errorf/Fatalf.
* syz-manager: truncate repro logs before reportingAleksandr Nogikh2024-02-211-0/+15
| | | | | Until we have figured out a way to solve #4495, let's just truncate repro logs before sending them over the dashboard API.
* pkg/report: move report.Type to pkg/report/crashAleksandr Nogikh2023-07-051-5/+6
| | | | | This will help avoid a circular dependency pkg/vcs -> pkg/report -> pkg/vcs.
* pkg/report: extract more report types for LinuxAleksandr Nogikh2023-07-051-14/+6
| | | | Amend oops and oopsFormat to contain report type.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-5/+5
|
* pkg/report: test ReportToGuiltyFileAleksandr Nogikh2023-02-081-21/+39
| | | | | | | Refactor the existing guilty path testing code to allow for simpler extension. Reuse the resulting code to invoke guilty_raw tests.
* pkg/report: export GuiltyFile and report it to the dashboardAleksandr Nogikh2022-12-161-2/+2
|
* pkg/report: don't run all tests in race modeDmitry Vyukov2021-12-211-4/+9
| | | | Update #2886
* pkg/report: decompile opcodes from reportsAleksandr Nogikh2021-08-121-0/+1
| | | | | | | | | | | Improve Linux reports quality by decompiling "Code: " descriptions. As that line of opcodes is not guaranteed to begin at the boundary of an instruction, try to find the right boundary. Handle the cases of multiple "Code: ..." lines by only decompiling the first one. In most cases the last such line shows user-space bytes, which is usually not of great importance.
* all: use entire log to detect reports to suppressAleksandr Nogikh2021-08-061-3/+3
| | | | | | | | | | Currently syzkaller only applies its suppressions regexps to the oops message itself and a small number of its preceding bytes. A case has been reported (#2685), where it was important to analyse a bigger portion of output data. Pass the whole log and a starting position to the `Report.Parse` method separately instead of passing an already cut log there. Adjust use cases of the `Report.Parse` method to handle its new behavior.
* pkg/report: separate reporter wrapper from OS-specific implementationsAleksandr Nogikh2021-08-061-5/+5
| | | | | | | | | | | | | Currently a number of report post-processing activities are implemented as a decorator over the interface that defines OS-specific implementations. Following exactly the same interface is too restrictive in this case as adding extra parameters to the post-processing forces the developer to adjust all implementations thay may not need these parameters at all. Untie the wrapper from the Reporter interface. Use a package-private reporterImpl interface for the OS-specific implementations, while having an exported Reporter structure. Make sure that Reporter is stored and passed as a pointer.
* pkg/report: support alternative bug titlesDmitry Vyukov2021-01-171-8/+28
| | | | Update #1575
* pkg/mgrconfig: move derived fields into separate structDmitry Vyukov2020-11-301-2/+4
| | | | | | Users should not be concerned with the internal derived fields. Move all derived fields into a separate struct before adding more. This leaves config.go as a better documentation for end users.
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-2/+3
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* vm/vmimpl/merger: remove all CRs from outputAlexander Egorenkov2020-10-021-10/+6
| | | | | | | Get rid of all places stripping \r in pkg/report. And adapt all tests. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
* pkg/report: add Report.SkipPosDmitry Vyukov2020-05-131-14/+17
| | | | | SkipPos is what pkg/instance needs, but also will be needed for ParseAll.
* pkg/report: detect syzkaller panics in lost connection bugsDmitry Vyukov2019-11-061-14/+28
| | | | | | | | | Some syzkaller panics happen due to memory corruptions, but it still would be useful at least to get some visibility into these crashes. On some OSes we actualy already detect them as they have "panic:" oops pattern, but not e.g. on linux. Fixes #318
* syz-fuzzer, executor: Add support for blacklisting data race framesMarco Elver2019-10-221-0/+2
| | | | | This adds support to add frames that have already been in data races, to the KCSAN report blacklist.
* prog: fix out-of-bounds accessDmitry Vyukov2019-07-301-1/+1
| | | | | ParseLog can access data out-of-bounds. Fix that and fix regression fuzz tests to catch this.
* pkg/report: add Type/Frame to ReportDmitry Vyukov2019-05-201-45/+79
| | | | | | In several places we do special handling for some crash types. Currently we compare report title with magic strings, which is error-prone. Add explicit Type to reports.
* pkg/report: support CONFIG_PRINTK_CALLERDmitry Vyukov2019-01-031-0/+5
| | | | | | | | | | | | | | | | | | CONFIG_PRINTK_CALLER has reached linux-next: https://groups.google.com/d/msg/syzkaller/xEDUgkgFvL8/d5bBS3BJBwAJ Enable CONFIG_PRINTK_CALLER and support parsing of its output format. This gives us several advantages: - output from different contexts don't intermix - intermixed output doesn't cause corrupted reports - we can keep larger prefix since we know it comes from the same task Credit for the kernel part goes to Tetsuo Handa. Also Sergey Senozhatsky and Petr Mladek for reviews of the kernel part. Fixes #596 Fixes #600
* pkg/report: split overly complex functionDmitry Vyukov2018-12-211-15/+19
| | | | gometalinter points to testParseImpl cyclomatic complexity.
* pkg/report: fix Start/EndPos calculation for fuchsiaDmitry Vyukov2018-12-201-2/+21
| | | | | | We computed Start/EndPos after trimming line prefix, this resulted in offsetted values which are not correct. Fix that. Add more tests and checks for Start/EndPos.
* pkg/report: pass the target to each OS report constructorAnton Lindqvist2018-12-081-1/+2
| | | | | In order to use the already defined kernel name in sys/targets to reduce duplications.
* pkg/report: fix few fuzz bugsDmitry Vyukov2018-09-271-0/+10
| | | | | | | Improve go-fuzz fuzzer function and fix few new bugs it finds: 1. Panic in linux parser (bad). 2. Akaros can report empty rep.Report. 3. Fuchsia can return empty rep.Report.
* pkg/report: fix guilty file extractionDmitry Vyukov2018-09-261-2/+20
| | | | | Account for the case that some file names can appear _before_ crash report starts. Start extracting guilty file starting from StartPos.
* pkg/mgrconfig: move from syz-manager/mgrconfigDmitry Vyukov2018-08-021-1/+1
| | | | | | | | mgrconfig was used only by syz-manager initially, but now it's used by a dozen of packages and it's weird to import from under a binary dir. pkg/ is much more reasonable dir for a widely used helper package.
* pkg/report: refactor testDmitry Vyukov2018-08-021-16/+20
| | | | | | Split a long function. Update #538
* pkg/report: improve akaros reporter and implement symbolizationDmitry Vyukov2018-07-161-1/+1
|
* pkg/report: add suppressions for Go race OOMsDmitry Vyukov2018-06-231-17/+34
|
* pkg/report: allow to specify suppressions per OSDmitry Vyukov2018-06-221-1/+5
| | | | | | | | | | | | | Currently all (linux-specific) suppressions are hardcoded in mgrconfig. This is very wrong. Move them to pkg/report and allow to specify per OS. Add gvisor-specific suppressions. This required a bit of refactoring. Introduce mgrconfig.KernelObj finally. Make report.NewReporter and vm.Create accept mgrconfig directly instead of passing it as multiple scattered args. Remove tools/syz-parse and it always did the same as tools/syz-symbolize. Simplify global vars in syz-manager/cover.go. Create reporter eagerly in manager. Use sort.Slice more. Overall -90 lines removed.
* pkg/report: pass vm type to NewReporterDmitry Vyukov2018-06-221-1/+1
| | | | | For the case when VM type affects output. Will be needed for gvisor. It is kinda linux, but kinda not.
* pkg/report: sanitize titles betterDmitry Vyukov2018-04-241-8/+1
| | | | | | | | Strip non-printable characters from titles. Trim whitespaces on both ends. Replace tabs with spaces. Remove duplicate spaces. Reduce max title length.
* pkg/report: detect hangs in unregister_netdeviceDmitry Vyukov2018-04-131-3/+4
| | | | | | Add special report format for hangs in unregister_netdevice. And support new format of lockdep reports (otherwise they all are marked as corrupted).
* pkg/report: fix typo in test failure messageDmitry Vyukov2018-04-091-2/+2
|
* pkg/report: improve corrupted report detectionDmitry Vyukov2018-04-091-15/+24
| | | | | | | | | | | 1. If we see should_failslab frames during report parsing, that's a corrupted report with intermixed frames from fault injection stack. 2. If we matched report title and this report should contains a guilty stack frame, but we failed to extract any frame, consider it as corrupted. New tests added. Also one of the old tests is fixed.
* pkg/report: add few tests where we mis-detect title/guilty fileDmitry Vyukov2018-01-061-0/+7
|
* pkg/report: fix __this_cpu_* report header call trace captureAndrey Konovalov2017-12-131-1/+1
|
* pkg/report: merge TestLinuxParseLog into TestParseDmitry Vyukov2017-12-121-4/+27
| | | | | | | | That was the last test that used inline input data. Merge it into TestParse. Test Output for all crashes in TestParse. Support multiple oopes in crash Add more test cases for start/end line.
* pkg/report: move guilty file test data to testdir/Dmitry Vyukov2017-12-121-26/+61
| | | | | | | | linux_test.go is total mess and very hard to work with. Turns out we had 2 tests that do exactly the same (verify Report), but nobody ever noticed. Move all test data to testdir/. One file per crash.
* pkg/report: move test data to testdir/Dmitry Vyukov2017-12-121-58/+152
| | | | | | | | linux_test.go is total mess and very hard to work with. Turns out we had 2 tests that do exactly the same (verify Report), but nobody ever noticed. Move all test data to testdir/. One file per crash.