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

"Invalid ELF header" error doesn't print location information #678

Closed
brianhuffman opened this issue Apr 14, 2020 · 1 comment · Fixed by #1194
Closed

"Invalid ELF header" error doesn't print location information #678

brianhuffman opened this issue Apr 14, 2020 · 1 comment · Fixed by #1194
Assignees
Labels
topics: error-messages Issues involving the messages SAW produces on error
Milestone

Comments

@brianhuffman
Copy link
Contributor

Running the bike_r2 verification from s2n, I got the following error message (due to some C file not being compiled properly, I guess)

[22:21:02.577] Verifying bit_scan_reverse ...
[22:21:02.577] Simulating bit_scan_reverse ...
[22:21:02.715] Checking proof obligations bit_scan_reverse ...
Calling Yices to check sat
Running check sat
[22:21:02.729] Proof succeeded! bit_scan_reverse
[22:21:02.729] Finding symbol for "secure_cmp32"
[22:21:02.737] X86Error "Invalid ELF header"

The problem is that I expected the error message to be printed along with a saw-script call stack and saw-script source location information, but I got none.

Perhaps there is a mismatch of exception types in the x86 verification code compared to the saw-script exception handlers?

@langston-barrett langston-barrett added the topics: error-messages Issues involving the messages SAW produces on error label Apr 14, 2020
@atomb atomb added this to the 0.6 milestone Apr 24, 2020
@atomb atomb modified the milestones: 0.6, 0.7 Aug 20, 2020
@atomb atomb self-assigned this Oct 16, 2020
@atomb atomb modified the milestones: 0.7, 0.8 Dec 14, 2020
@atomb
Copy link
Contributor

atomb commented Apr 19, 2021

This happens because there are various places where the x86 processing code (and other code in SAW) throws exceptions from IO code that are of specific types that we don't currently catch. I'm going to prepare a PR to experiment with adapting the io function in SAWScript.Value to have special processing for each type of exception we specifically want to handle, and then use io in preference to liftIO in most TopLevel code. In preparation for that, I've confirmed that doing so allows us to give a much nicer error message in this case, and we could relatively easily extend that to handle other exceptions, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topics: error-messages Issues involving the messages SAW produces on error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants