Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve verifier failure debugging experience by interleaving lines of code in the output more #688

Open
Austin-Lamb opened this issue Sep 25, 2024 · 0 comments

Comments

@Austin-Lamb
Copy link

Today if I get a verifier failure, I get a line at the end something like this:

; C:\path\to\my\file.c:208
;                 memcpy_s(buffer, BUFFER_SIZE, ctx->command_start, len);
260: Upper bound must be at most packet_size (valid_access(r3.offset, width=r4) for read)

It's super helpful that I get that line of source to tie back to, but then I usually need to walk backwards to understand how different registers got their values to see why it's not happy on that line. I wish I could see source lines for the entire output - so if it showed me something like this:

; C:\path\to\my\file.c:123
;                 my_first_line_of_code_here

Pre-invariants: <stuff>
Post-invariants: <stuff>
Instructions: <stuff>

; C:\path\to\my\file.c:124
;                 my_second_line_of_code_here

Pre-invariants: <stuff>
Post-invariants: <stuff>
Instructions: <stuff>

All the way through, then I would be able to correlate better between the code I wrote and how it got compiled by LLVM and ultimately failed to verify. I can piece this together today using a combination of verifier output, noting instruction numbers, and llvm-objdump but that's a pain to keep swapping back and forth - having it inline in the verifier output would be way nicer for debugging. If this is too much info, then it could stay in the "verbose" level of output.

It seems the verifier already hooks up to symbolic information somewhere to show the line number and text of the code in the failure line, so hopefully this is possible to just do more often for each line.

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

No branches or pull requests

1 participant