Page MenuHomeFreeBSD

loader.efi: faults could try to print out call trace
ClosedPublic

Authored by tsoome on Jun 8 2022, 1:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 8:19 PM
Unknown Object (File)
Feb 20 2024, 1:01 PM
Unknown Object (File)
Feb 13 2024, 1:37 PM
Unknown Object (File)
Jan 12 2024, 8:35 AM
Unknown Object (File)
Dec 20 2023, 4:09 AM
Unknown Object (File)
Dec 6 2023, 1:10 AM
Unknown Object (File)
Nov 30 2023, 2:15 AM
Unknown Object (File)
Nov 10 2023, 7:45 AM
Subscribers

Details

Summary

with grab_faults, we can try to print out the trace of function calls.
Without symbol table, we can not translate addresses to function names,
but even addresses can help to track the bugs.

For loader functions, print out absolute address, so it could be
searched from objdump -d output.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tsoome requested review of this revision.Jun 8 2022, 1:16 PM

I like this notion. Would love to see it applied as widely as we can because crashes on EFI are rather opaque

stand/efi/loader/arch/amd64/trap.c
127

Please have some kind of sanity / limit on the number of frames you print so this doesn't infinitely scroll...

Make sure we do not dereference NULL pointer. If fp is NULL,
also zero out pc.

stand/efi/loader/arch/amd64/trap.c
127

fp/pc handling should be fixed now. But also the pager prompt does allow quit - not that it actually matters because once this function is done, we will hung in halt anyhow.

stand/efi/loader/arch/amd64/trap.c
127

I'm more worried about infinite scroll creating a denial of service attack, inadvertently, against the console server that's getting this trap. There the pager wouldn't necessarily be in the loop and having a fixed limit of 50 would likely balance the needs to get a full traceback with the needs to terminate output w/o flooding someone's monitoring infrastructure.

imp added inline comments.
stand/efi/loader/arch/amd64/trap.c
127

ah, pager_open() does that, so we'll be limited by LINES or 24 naturally.

This revision is now accepted and ready to land.Jul 11 2022, 5:07 PM