-
Notifications
You must be signed in to change notification settings - Fork 274
Fixup e59511c9168f04cb21e85642aa8875c1cb4b4 #2964
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
Fixup e59511c9168f04cb21e85642aa8875c1cb4b4 #2964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, add the test that exposed the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: e7cc22e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84904634
The test is not trivial with our current scripts; in particular, it would fail on anything other than x86/i386. |
Ok, needs a rebase. |
src/goto-programs/read_goto_binary.h
Outdated
@@ -19,25 +19,33 @@ class goto_modelt; | |||
class message_handlert; | |||
class symbol_tablet; | |||
|
|||
// Read given goto binary | |||
// Does not update config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the documentation please be placed with the definition and use Doxygen style?
@@ -898,11 +898,13 @@ void goto_instrument_parse_optionst::get_goto_program() | |||
{ | |||
status() << "Reading GOTO program from `" << cmdline.args[0] << "'" << eom; | |||
|
|||
config.set(cmdline); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually necessary/useful at all? AFAIK the config will be overwritten below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but not all of it -- only what is called 'architectural configuration'. Say include paths aren't.
if(read_goto_binary(cmdline.args[0], | ||
goto_model, get_message_handler())) | ||
throw 0; | ||
|
||
config.set(cmdline); | ||
config.set_from_symbol_table(goto_model.symbol_table); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need a custom wrapper script to test this, but some tests certainly seem necessary. In particular, the command-line should actually be ignored.
e7cc22e
to
a816370
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: a816370).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85188255
May I suggest that, in place of a proper CI-ed test, the commit message of the second commit describe in detail a workflow that failed before and works now? |
a816370
to
6aa7d25
Compare
ok, done |
There is temptation to allow regression tests that are arbitrary shell scripts; my main fear is that we'll have tests that nobody can debug anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both ends of the spectrum:
- I really like how the commit message has been extended (with the minor note that mentioning 32 vs. 64 bit architecture seems necessary). I think this is a better route than coming up with arbitrary test scripts, even though it would mean we don't catch such problems in CI for now.
- The comments added need a big overhaul.
@@ -27,6 +27,8 @@ Module: Read Goto Programs | |||
#include "elf_reader.h" | |||
#include "osx_fat_reader.h" | |||
|
|||
/// Read given goto binary | |||
/// Does not update config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to be a bit more explicit? To be frank: this is a commit that has one job, and it doesn't actually do that job. The parameters are not documented, the return value is not explained, failure modes are not covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: 6aa7d25).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85395135
Fixes #2949 This enables auto-detecting the architecture of a goto-binary when performing transformations on it, e.g., with main.c: int main(){ char buffer[] = "a"; int x = strlen(buffer); return x; } the commands goto-cc -m32 -o main.gb main.c goto-instrument --add-library main.gb main2.gb now pass.
6aa7d25
to
637afdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: 637afdc).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85544888
read_goto_binary does not set the config; only read_object_and_link does that.
Fixes issue #2949