Skip to content

Fix empty _report fields and add comprehensive validation for kernel error parsing#24

Merged
nuclearcat merged 6 commits into
kernelci:mainfrom
padovan:fix-missing-_report-field
Jul 18, 2026
Merged

Fix empty _report fields and add comprehensive validation for kernel error parsing#24
nuclearcat merged 6 commits into
kernelci:mainfrom
padovan:fix-missing-_report-field

Conversation

@padovan

@padovan padovan commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator

This PR fixes a critical issue where _report fields in kernel BUG and panic reports were empty when logs lacked standard end trace markers, and adds comprehensive test coverage to prevent future regressions.

When parsing kernel logs using ./logspec.py --json-full, the _report fields for KernelBug and KernelPanic errors were coming up empty for logs without standard ---[ end trace markers. This meant valuable debugging information (call traces, hardware details, register dumps) was being lost even though the errors were successfully detected.

Fixed empty _report fields in KernelBug and KernelPanic parsers by adding fallback logic when end trace markers are missing.

Also added test coverage for the _report field in all linux_boot files.

@padovan padovan self-assigned this Aug 20, 2025
Gustavo Padovan added 3 commits August 20, 2025 18:50
When kernel BUG or panic reports don't have standard '---[ end trace'
markers, the _report field remained empty even though the error was
parsed successfully.

This fix adds self._report = text[:report_end] in the fallback logic
for both KernelBug and KernelPanic classes when report_end is calculated
but no end marker is found.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
This test case covers BUG reports without end trace markers, which is
the scenario fixed by the previous commit for empty _report fields.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Implement position-based validation testing for _report field content
across all linux_boot log files. This ensures the parser correctly
extracts detailed error information for various kernel error types,
preventing regressions in _report field extraction and ensures
consistent error debugging information across all supported log formats.

🤖 Generated with AI help.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
@padovan
padovan force-pushed the fix-missing-_report-field branch from ba46366 to 0663cb7 Compare August 20, 2025 21:50
Use the initial timestamp block and its contiguous call trace to find a safe fallback boundary when the kernel omits an end-trace marker. This prevents later watchdog, reboot, and DT output from being attached to the BUG report, and allows subsequent BUGs to be discovered.

Add focused truncated-report coverage and correct the MediaTek fixture to account for all three bounded BUG reports.

Incident: https://lore.kernel.org/all/178426434363.11836.10489080558310367907@kernelci.org/
Extend _report validation with forbidden-content and size checks for the MediaTek DT crash log. The assertions cover complete traces, abrupt reboot truncation, and a later BUG that was previously hidden by parser overrun.

Incident: https://lore.kernel.org/all/178426434363.11836.10489080558310367907@kernelci.org/
KernelPanic always sets report_end from either the explicit end marker or the initial timestamped block. Remove the unreachable fallback so the panic path does not imply a third boundary mechanism.

Incident: https://lore.kernel.org/all/178426434363.11836.10489080558310367907@kernelci.org/
@nuclearcat
nuclearcat merged commit de1b1c8 into kernelci:main Jul 18, 2026
1 check passed
nuclearcat added a commit to nuclearcat/kernelci-core that referenced this pull request Jul 18, 2026
Install logspec through configurable URL and revision build arguments, defaulting to kernelci/logspec@370c994c. An explicit revision invalidates the Docker layer on upgrades and makes pipeline images reproducible.

Expose KCI_VER_LOGSPEC in the image so deployments can verify the installed source revision. This revision includes the bounded BUG-report fix from kernelci/logspec#24 and the DTC parser updates.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants